Skip to content

CI: Add OpenAPI lint + S3 publish workflows#6401

Open
reakaleek wants to merge 7 commits into
mainfrom
openapi-s3-publish
Open

CI: Add OpenAPI lint + S3 publish workflows#6401
reakaleek wants to merge 7 commits into
mainfrom
openapi-s3-publish

Conversation

@reakaleek

@reakaleek reakaleek commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Adds a fork-safe PR lint check (openapi-pr.yml) and a publish-on-merge workflow (openapi-publish.yml) that build the docs-final OpenAPI specs and upload them to S3.

Why

Rollout of RFC elastic/docs-eng-team#634 — replaces the hourly pull-based mirror (open-api-mirror.yml in docs-internal-workflows) with the producer repo pushing its own spec. Closes elastic/docs-eng-team#642.

How

  • Both workflows run the same build: make setupmake generatemake transform-to-openapi-for-docsmake overlay-docs, producing the two *-docs-final.json files.
  • openapi-pr.yml: pull_request, paths-filtered to specification/**, docs/overlays/**, docs/linters/**, Makefile. No secrets — lints both specs with openapi/lint.
  • openapi-publish.yml: push to main and [0-9]+.[0-9]+. Lints, then uploads via openapi/upload (OIDC): stateful spec on every publishable branch, serverless spec on main only (always-latest).
  • Existing generate.yml / publish-release-artifacts.yml are untouched.

Blocked / not yet mergeable: actual S3 upload needs the bucket/OIDC roles from elastic/docs-infra (tracked in elastic/docs-eng-team#641). Draft until that lands.

Test plan

  • docs-actions openapi/lint + openapi/upload released under v1; SHA pins swapped to @v1
  • docs-infra bucket + OIDC roles provisioned (elastic/docs-eng-team#641)
  • openapi-pr run is green on this PR
  • Lint verified to catch real errors: it flagged a malformed doc URL (double #), fixed in this PR
  • After merge to main, confirm both keys land at s3://elastic-docs-openapi-specs/elastic/elasticsearch-specification/main/elasticsearch{,-serverless}.json
  • Confirm a push to a version branch (e.g. 9.4) publishes the stateful spec only

Notes

Labeled for backport to 9.4 and 8.19 via this repo's label-driven backport bot. 7.17 was considered but dropped: its Makefile lacks the docs-final build targets (transform-to-openapi-for-docs, overlay-docs), so it cannot produce the spec.

Adds the push side of RFC elastic/docs-eng-team#634: a fork-safe PR lint
check and a publish-on-merge workflow that upload the docs-final OpenAPI
specs to S3 via the new elastic/docs-actions/openapi/{lint,upload} actions.
Closes elastic/docs-eng-team#642.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

reakaleek added 2 commits July 6, 2026 10:49
Lets the workflow run on this PR (which doesn't touch specification/**)
so it can be verified end-to-end before the filter goes back on.
The openapi-pr lint check (elastic/docs-actions/openapi/lint) flagged
this as an invalid uri-reference: a raw '#' isn't a legal fragment
character, so the second one broke the URL.
reakaleek and others added 4 commits July 6, 2026 11:26
Both openapi workflows ran the identical setup-node + make sequence;
.github/actions/build-openapi-docs now owns it. Same job, no artifact
round-trip.
Renames openapi-pr.yml to openapi-lint.yml and normalizes both
workflows' name: fields to match their filenames, aligning with the
convention used across the OpenAPI-to-S3 rollout (elastic/docs-eng-team#638).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@reakaleek
reakaleek marked this pull request as ready for review July 8, 2026 21:02
@reakaleek
reakaleek requested a review from a team as a code owner July 8, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant