Skip to content
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7954e99
stage
Mpdreamz Feb 24, 2025
6396b35
Merge branch 'main' into feature/publish-links-index-lamdba
Mpdreamz Feb 26, 2025
0e453e3
Simplify function
Mpdreamz Feb 26, 2025
3d2a08b
ensure binary is named bootstrap
Mpdreamz Feb 26, 2025
c021aea
add lambda docker build
Mpdreamz Feb 26, 2025
f015b1b
update lambda build
Mpdreamz Feb 27, 2025
4564519
Add `free-disk-space` input (#614)
reakaleek Feb 26, 2025
d255f9a
Simply if check on Free Disk Space (#616)
Mpdreamz Feb 26, 2025
552bf6d
Default CurrentUrlPath to empty string while we investigate further (…
Mpdreamz Feb 26, 2025
b733643
Fix `free-disk-space` input attempt 2 (#617)
reakaleek Feb 26, 2025
d148715
Just compare with repository name for now (#619)
reakaleek Feb 26, 2025
b1bb06d
Add update-reference-index action (#622)
Mpdreamz Feb 26, 2025
a84d015
Update links-index.json whenever a PR get's closed (#623)
Mpdreamz Feb 26, 2025
2512e28
Update links-index.json whenever we push a links.json (#624)
Mpdreamz Feb 26, 2025
199d427
Continue-on-error temporarily for validate-inbound-links (#627)
Mpdreamz Feb 27, 2025
a63dc2e
docs-preview: Use `since_last_remote_commit: true` for changed-files …
reakaleek Feb 27, 2025
68221f9
On ci skip if /docs folder has no docset.yml silently (#630)
Mpdreamz Feb 27, 2025
31af4f9
Revert "docs-preview: Use `since_last_remote_commit: true` for change…
reakaleek Feb 27, 2025
defe51d
Feature: allow the docs-build action to hint to subsequent steps to s…
Mpdreamz Feb 27, 2025
a9fcb3b
Set correct deployment status (#632)
reakaleek Feb 27, 2025
4c7b972
Optimize preview build to avoid checkout on pull_request* events (#633)
reakaleek Feb 27, 2025
b11ef54
Add `PrimaryNav` feature (#604)
reakaleek Feb 27, 2025
36b6f0a
Revert "Add `PrimaryNav` feature (#604)" (#635)
reakaleek Feb 27, 2025
2494506
Add smoke test (#637)
reakaleek Feb 27, 2025
04b29d7
Run free-disk-space action in security-docs (#639)
reakaleek Feb 27, 2025
9e445c4
Add `primary-nav` feature (#636)
reakaleek Feb 27, 2025
f1d7252
Inbound link checking, fully validate if found in links-index (#643)
Mpdreamz Feb 28, 2025
5a9cd46
Add `landing-page-path` output and use it in preview workflow (#642)
reakaleek Feb 28, 2025
e0b6e99
Fix preview-build.yml (#644)
reakaleek Feb 28, 2025
d78729a
Remove unused workflow (#646)
reakaleek Feb 28, 2025
1c9b6df
Add validate command for single published repository (#648)
Mpdreamz Feb 28, 2025
9e0d9e2
Refactor link index command into dedicated LinkRegistry module (#649)
Mpdreamz Feb 28, 2025
6a40a78
Better error messages for cross_link errors (From `docs-builder` and …
Mpdreamz Feb 28, 2025
bb0c9ca
Add logging to git remote resolving (#652)
Mpdreamz Feb 28, 2025
483f026
Update cross-repo links syntax info (#654)
leemthompo Feb 28, 2025
2763ef7
If GITHUB_REPOSITORY is set use it verbatim (#655)
Mpdreamz Feb 28, 2025
a8d4f79
Share inbound-links commands with `docs-builder` (#657)
Mpdreamz Feb 28, 2025
3f9eb40
Fix `environment_url` in preview deployment (#658)
reakaleek Feb 28, 2025
4dcfb39
Adjust links and wording in primary and secondary navigation (#659)
reakaleek Feb 28, 2025
e3a5e36
Add mobile navigations (#662)
reakaleek Mar 3, 2025
83a1955
Add extension hook points to all special usecases to inject themselve…
Mpdreamz Mar 4, 2025
c328730
Rename binary to follow kebab-case convention
Mpdreamz Mar 4, 2025
812a2e2
Move lambda.DockerFile
Mpdreamz Mar 4, 2025
29e0eb8
Update lambda.DockerFile
Mpdreamz Mar 4, 2025
7059fae
Update README.md for publish-links-index-lambda with build instructions
Mpdreamz Mar 4, 2025
1d551c5
Merge remote-tracking branch 'origin/main' into feature/publish-links…
Mpdreamz Mar 4, 2025
0e6f0e0
Update src/docs-lambda-index-publisher/lambda.DockerFile
Mpdreamz Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ dotnet_diagnostic.IDE0057.severity = none
dotnet_diagnostic.IDE0051.severity = suggestion
dotnet_diagnostic.IDE0059.severity = suggestion

dotnet_diagnostic.CA1859.severity = none

dotnet_diagnostic.IDE0305.severity = none


[DocumentationWebHost.cs]
dotnet_diagnostic.IL3050.severity = none
dotnet_diagnostic.IL2026.severity = none



[tests/**/*.cs]
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.IDE0022.severity = none
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ on:
type: string
default: '**'
required: false
free-disk-space:
description: 'Free disk space before running the build'
type: string
default: 'false'
required: false

permissions:
id-token: write
Expand All @@ -41,20 +46,27 @@ jobs:
steps:

- name: Checkout
if: contains(fromJSON('["push", "merge_group"]'), github.event_name)
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Get changed files
if: startsWith(github.event_name, 'pull_request') || github.event_name == 'merge_group'
if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name)
id: check-files
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
files: ${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }}


- name: Checkout
if: startsWith(github.event_name, 'pull_request') && steps.check-files.outputs.any_modified == 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: Free Disk Space
if: github.event_name != 'merge_group'
uses: jlumbroso/free-disk-space@main
if: contains(fromJSON('["elastic/asciidocalypse", "elastic/security-docs"]'), github.repository)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: false

Expand Down Expand Up @@ -128,21 +140,23 @@ jobs:
- name: Build documentation
if: github.repository != 'elastic/docs-builder' && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group'))
uses: elastic/docs-builder@main
id: docs-build
continue-on-error: ${{ fromJSON(inputs.continue-on-error != '' && inputs.continue-on-error || 'false') }}
with:
prefix: ${{ env.PATH_PREFIX }}
strict: ${{ fromJSON(inputs.strict != '' && inputs.strict || 'true') }}

- name: 'Validate Inbound Links'
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group')) }}
uses: elastic/docs-builder/actions/validate-inbound-local@main
if: ${{ !cancelled() && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group')) }}
continue-on-error: true

- uses: elastic/docs-builder/.github/actions/aws-auth@main
if: ${{ !cancelled() && steps.deployment.outputs.result }}
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && steps.deployment.outputs.result }}

- name: Upload to S3
id: s3-upload
if: ${{ !cancelled() && steps.deployment.outputs.result }}
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && steps.deployment.outputs.result }}
run: |
aws s3 sync .artifacts/docs/html "s3://elastic-docs-v3-website-preview${PATH_PREFIX}" --delete
aws cloudfront create-invalidation \
Expand All @@ -153,18 +167,23 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.s3-upload.outcome == 'success'
uses: elastic/docs-builder/actions/update-link-index@main

- name: Update Reference Index
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.s3-upload.outcome == 'success'
uses: elastic/docs-builder/actions/update-reference-index@main

- name: Update deployment status
uses: actions/github-script@v7
if: always() && steps.deployment.outputs.result
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
LANDING_PAGE_PATH: ${{ steps.docs-build.outputs.landing-page-path || env.PATH_PREFIX }}
with:
script: |
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: ${{ steps.deployment.outputs.result }},
state: "${{ steps.s3-upload.outcome == 'success' && 'success' || 'failure' }}",
environment_url: `https://docs-v3-preview.elastic.dev${process.env.PATH_PREFIX}`,
state: "${{ steps.docs-build.outputs.skip == 'true' && 'inactive' || (steps.s3-upload.outcome == 'success' && 'success' || 'failure') }}",
environment_url: `https://docs-v3-preview.elastic.dev${process.env.LANDING_PAGE_PATH}`,
log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
})
3 changes: 3 additions & 0 deletions .github/workflows/preview-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
aws s3 rm "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --recursive

- name: 'Update Reference Index'
uses: elastic/docs-builder/actions/update-reference-index@main
21 changes: 0 additions & 21 deletions .github/workflows/preview-deploy.yml

This file was deleted.

97 changes: 0 additions & 97 deletions .github/workflows/preview.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: smoke-tests

on:
pull_request: ~

jobs:
build:
runs-on: ubuntu-latest
name: build (${{ matrix.repository }})
strategy:
fail-fast: false
matrix:
include:
- repository: elastic/docs-content
landing-page-path-output: /docs/
- repository: elastic/apm-agent-android
landing-page-path-output: /docs/reference/

# This is a random repository that should not have a docset.yml
- repository: elastic/oblt-actions
landing-page-path-output: ""

steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/actions/bootstrap

- uses: actions/checkout@v4
with:
repository: ${{ matrix.repository }}
path: test-repo

- name: Build documentation
id: docs-build
run: |
dotnet run --project src/docs-builder -- --strict --path-prefix "/docs" -p test-repo

- name: Verify landing-page-path output
run: test ${{ steps.docs-build.outputs.landing-page-path }} == ${{ matrix.landing-page-path-output }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
<ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>
</Project>
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ inputs:
strict:
description: 'Treat warnings as errors'
required: false
outputs:
landing-page-path:
description: 'Path to the landing page of the documentation'
skip:
description: "hint from the documentation tool to skip the docs build for this PR"

runs:
using: 'docker'
Expand Down
16 changes: 0 additions & 16 deletions actions/generator/action.yml

This file was deleted.

10 changes: 10 additions & 0 deletions actions/update-reference-index/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Update Reference Index'
description: 'Updates links-index.json with the latest pointers to all links.json files'

runs:
using: "composite"
steps:
- name: Update Reference Index
run: |
curl -v https://kaqcb6pumme57zlb63wmoqcjxq0fhkdl.lambda-url.us-east-1.on.aws
shell: bash
2 changes: 1 addition & 1 deletion actions/validate-inbound-local/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ runs:
- name: Validate Inbound Links
uses: elastic/docs-builder/actions/assembler@main
with:
command: "link validate-inbound-local"
command: "inbound-links validate-link-reference"
4 changes: 0 additions & 4 deletions build/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ let private pristineCheck (arguments:ParseResults<Build>) =
let private publishBinaries _ =
exec { run "dotnet" "publish" "src/docs-builder/docs-builder.csproj" }
exec { run "dotnet" "publish" "src/docs-assembler/docs-assembler.csproj" }
Zip.zip
".artifacts/publish/docs-builder/release"
$"docs-builder-%s{OS.Name}-{OS.Arch}.zip"
[".artifacts/publish/docs-builder/release/docs-builder"]

let private publishZip _ =
exec { run "dotnet" "publish" "src/docs-builder/docs-builder.csproj" }
Expand Down
20 changes: 20 additions & 0 deletions docs-builder.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "validate-inbound-local", "v
actions\validate-inbound-local\action.yml = actions\validate-inbound-local\action.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "update-link-index", "update-link-index", "{6554F917-73CE-4B3D-9101-F28EAA762C6B}"
ProjectSection(SolutionItems) = preProject
actions\update-link-index\action.yml = actions\update-link-index\action.yml
actions\update-link-index\README.md = actions\update-link-index\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "update-reference-index", "update-reference-index", "{9FEC15F6-13F8-40B1-A66A-EB054E49E680}"
ProjectSection(SolutionItems) = preProject
actions\update-reference-index\action.yml = actions\update-reference-index\action.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "docs-lambda-index-publisher", "src\docs-lambda-index-publisher\docs-lambda-index-publisher.csproj", "{C559D52D-100B-4B2B-BE87-2344D835761D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -106,6 +119,10 @@ Global
{4CCE599A-B9FE-4DF2-8763-34CF0A99D4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CCE599A-B9FE-4DF2-8763-34CF0A99D4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CCE599A-B9FE-4DF2-8763-34CF0A99D4AA}.Release|Any CPU.Build.0 = Release|Any CPU
{C559D52D-100B-4B2B-BE87-2344D835761D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C559D52D-100B-4B2B-BE87-2344D835761D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C559D52D-100B-4B2B-BE87-2344D835761D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C559D52D-100B-4B2B-BE87-2344D835761D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4D198E25-C211-41DC-9E84-B15E89BD7048} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
Expand All @@ -119,5 +136,8 @@ Global
{CFEE9FAD-9E0C-4C0E-A0C2-B97D594C14B5} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
{4CCE599A-B9FE-4DF2-8763-34CF0A99D4AA} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
{6E2ED6CC-AFC1-4E58-965D-6AEC500EBB46} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
{6554F917-73CE-4B3D-9101-F28EAA762C6B} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
{9FEC15F6-13F8-40B1-A66A-EB054E49E680} = {245023D2-D3CA-47B9-831D-DAB91A2FFDC7}
{C559D52D-100B-4B2B-BE87-2344D835761D} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
EndGlobalSection
EndGlobal
Loading