Skip to content

Migrate changelog workflows to unified release-notes reusable workflow - #1237

Open
Mpdreamz wants to merge 11 commits into
mainfrom
docs/migrate-to-release-notes-workflow
Open

Mpdreamz wants to merge 11 commits into
mainfrom
docs/migrate-to-release-notes-workflow

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Sep 16, 2026

Copy link
Copy Markdown
Member

Replaces the three legacy changelog workflows and the upstream-update script with the unified `release-notes` reusable workflow from `elastic/docs-actions`, and moves changelog bundle creation from the pre-release phase into a post-release job that runs after the GitHub release is cut.

Affects: CI/CD workflows, release process

Prompt summary: Migrate elastic/elastic-otel-java to use the same release-notes workflow strategy as the docs-playground-release-notes-tagged-workflow repo — wire bundle generation inline in release-step-3 after the GITHUB_TOKEN-created release, instead of relying on the on: release event (which GITHUB_TOKEN suppresses) or the old pre-release committed-bundle approach.

Why

The legacy setup had three problems. First, changelog-upload.yml uploaded per-PR entries to the CDN, while changelog-init.yml / changelog-submit.yml handled validation, comments, and auto-committing changelog files separately — three workflows doing what one can. Second, pre-post-release.yml generated the bundle by running docs-builder changelog bundle and committing docs/releases/<version>.yaml into the pre-release branch; the release notes markdown referenced those committed files, which meant the bundle was baked before the release tag existed and couldn't be updated post-facto. Third, bundle-on-release: true in release-notes.yml was dead code because release-step-3.yml creates the GitHub release with GITHUB_TOKEN, and GitHub suppresses the on: release event for GITHUB_TOKEN-created releases.

What

Three old workflows deleted

changelog-init.yml, changelog-submit.yml, and changelog-upload.yml are removed, along with .ci/changelog-upstream-update.sh. Their responsibilities are covered by the new workflows below.

Three new workflows added

release-notes.yml handles validate (on PR), upload (on push to main), and is the trigger that the two downstream workflows listen to. release-notes-comments.yml upserts the changelog preview comment on PRs. release-notes-changelog-file.yml auto-commits a changelog entry file for PRs that are missing one. These two downstream workflows are intentionally kept as separate files so repos can opt into each independently.

Bundle creation moved post-release

release-step-3.yml gains a bundle job (runs bundle-create-version@v1, reads from CDN, no Docker) and a bundle-publish job (OIDC-scoped upload to S3), both chained after create-github-release. The docs-builder/setup@v1 and Generate documentation changelog bundle steps are removed from pre-post-release.yml — the committed docs/releases/*.yaml approach is replaced entirely.

Release notes now CDN-sourced

docs/release-notes/*.md files changed from :::{changelog} /releases/ (local file) to :::{changelog} edot-java (CDN product name). docs/docset.yml gains release_notes: [edot-java] so docs-builder prefetches bundles at startup.

Verify

# confirm the three deleted workflows are gone and release-notes.yml is present
git diff main --name-only
# confirm pre-post-release.yml no longer references docs-builder or changelog bundle
grep -n 'docs-builder\|changelog bundle' .github/workflows/pre-post-release.yml

Replace the three legacy shared workflows (changelog-init, changelog-submit,
changelog-upload) with the unified release-notes workflow. Bundle now fires
on GitHub release publish instead of push to main.

Changes:
- Delete changelog-init.yml, changelog-submit.yml, changelog-upload.yml
- Add release-notes.yml: unified validate/submit/bundle via docs-actions
- Add release-notes-comments.yml: PR comment upserts after release-notes run
- Add changelog-upstream-update.yml: preserve bespoke auto-entry generation
  for PRs labeled changelog:upstream-update (extracted from changelog-init)
- docs/docset.yml: add release_notes.product: edot-java so CDN prefetch works
- docs/release-notes/*.md: change :::{changelog} /releases/ to
  :::{changelog} edot-java (explicit product name, CDN-sourced)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mpdreamz and others added 4 commits September 16, 2026 14:32
The custom changelog-upstream-update.yml + .ci/changelog-upstream-update.sh
are replaced by the standard release-notes-changelog-file.yml from docs-actions,
which auto-generates and commits changelog entries for PRs missing one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pre-post-release.yml manually runs 'docs-builder changelog bundle' in the
pre-release phase (with a generated description from gradlew) and removes
the entries immediately after. bundle-on-release: true would fire a second
empty bundle when the GitHub release is published, which is wrong.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs-builder infers the CDN product from the repository name (elastic-otel-java
→ edot-java via products.yml) and fetches best-effort. A 404 is a hint not an
error, so no declaration is needed until bundles are published to the CDN.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mpdreamz
Mpdreamz marked this pull request as ready for review September 18, 2026 07:31
@Mpdreamz
Mpdreamz requested review from a team as code owners September 18, 2026 07:31

@v1v v1v left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, to use the same permission strategy where top-level is empty and the ones in the jobs are defined with more granularity

Comment thread .github/workflows/release-notes-comments.yml
Comment thread .github/workflows/release-notes-comments.yml Outdated
Comment thread .github/workflows/release-notes-changelog-file.yml
Comment thread .github/workflows/release-notes-changelog-file.yml Outdated
@theletterf

Copy link
Copy Markdown
Member

Hey, I was looking at this and had a couple of questions (happy to be wrong on either).

On the bundle strategy: release-step-3.yml creates the GitHub release with GH_TOKEN: ${{ github.token }}. GitHub doesn't fire on: release for events created by GITHUB_TOKEN, so bundle-on-release: true in release-notes.yml would never trigger. Would it make sense to add the bundle jobs directly inside release-step-3, after the create-github-release step, instead?

On the render pages: the four docs/release-notes/*.md files are now pointing at :::{changelog} edot-java on the CDN, but I don't think any bundles have been published there yet. The old changelog-upload.yml uploaded entries, not release bundles. The build / build check seems to be failing because of a CDN 404 on that. Could those four files (and the release_notes: block in docset.yml) stay on the local path for now, and move to CDN in a follow-up once the first bundle is published?

Martijn Laarman and others added 2 commits September 21, 2026 13:13
Top-level permissions: {} with job-scoped grants is the repo's
standard permission strategy; align these two workflows with it.

Co-Authored-By: Claude <noreply@anthropic.com>
GITHUB_TOKEN-created releases do not fire the `on: release` event, so
bundle-on-release in release-notes.yml never ran. Add bundle and
bundle-publish jobs directly to release-step-3.yml chained after
create-github-release, following the same pattern as
docs-playground-release-notes-tagged-workflow.

Remove the on:release trigger and bundle-on-release from
release-notes.yml; id-token:write on that workflow is no longer needed.

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

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

v1v
v1v previously approved these changes Sep 22, 2026
@@ -0,0 +1,13 @@
name: Changelog file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we could simplify and only have one workflow for both "comment" or "pushing the changelog file" when relevant ? It's quite likely to be replicated across repositories so having a single top-level GH action would make this simpler and avoid duplication.

Here they have the same run triggers and the same permissions on the PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping them separate is intentional — the onboarding guide documents these as two distinct files to copy, and repos can opt into either one independently (comments without auto-commit, or vice versa). I merged them in a previous commit and then reverted it; sorry for the noise, that was Claude being too eager.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also both are completely optional if you want neither comments or automated PR checkins, this limits blast radius a bit for repos that just want PR checks bundle automation.

uses: elastic/docs-actions/changelog/bundle-create-version@v1
with:
version: ${{ env.RELEASE_VERSION_TAG }}
github-token: ${{ github.token }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To implement #1238 would it be just a matter of modifying the bundle file just between those two steps ? Or is it something we would need to do on a separate workflow ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to add a description input to elastic/docs-actions/changelog/bundle-create-version@v1 itself, then wire the output of .ci/changelog-bundle-description.sh into it here in release-step-3.yml. That keeps the description logic in this repo and avoids rebuilding it inside the action. Tracked in #1238.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — elastic/docs-actions#367 adds a description input to bundle-create-version@v1, and this PR now runs .ci/changelog-bundle-description.sh before Create bundle and passes its output as that input. Ties off the last item from the old pre-release bundle step.

contents: read
pull-requests: read
packages: read
uses: elastic/docs-actions/.github/workflows/release-notes.yml@v1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only checking the PR has a changelog file and/or the appropriate labels are applied here ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a PR event it always validates labels, checks whether a changelog file is present (if the labels and workflow config require one), and if a file is present validates its name format and contents. On push to main it uploads the merged PR's changelog entry to the CDN. Bundle creation is separate, handled by bundle-create-version@v1 in release-step-3.yml after the GitHub release is cut.

The old docs-builder changelog bundle step in pre-post-release.yml committed
a docs/releases/<version>.yaml file into the pre-release branch. That file was
referenced by the old release notes markdown. Now that release notes use CDN
sourcing (:::{changelog} edot-java), the committed file is dead and the step
that generates it should go. The bundle is now created post-release by
bundle-create-version@v1 in release-step-3.yml.

Also merge release-notes-comments.yml and release-notes-changelog-file.yml into
a single release-notes-downstream.yml with two jobs, as suggested in review.

Co-Authored-By: Claude <noreply@anthropic.com>
Reverts the merge of release-notes-comments.yml and
release-notes-changelog-file.yml into a single file. While the
consolidation makes sense locally, the onboarding guide documents
these as two distinct files to copy — one for PR comments, one for
auto-committing changelog entries — and teams should be able to opt
into either independently.

Sorry for the noise; Claude was too eager to consolidate.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mpdreamz Mpdreamz changed the title Migrate changelog workflows to release-notes Migrate changelog workflows to unified release-notes reusable workflow Sep 23, 2026
Runs .ci/changelog-bundle-description.sh before the create step and
passes its output as the description input, restoring the upstream
dependency version context that was lost when the pre-release bundle
step was removed. Requires elastic/docs-actions#367.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
docs-preview 174e5482 Deployed Sep 23, 2026 by github-actions[bot]
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.

5 participants