Repository navigation
[CI] Add Buildkite step to validate changelog PR links - #19171
Conversation
Add a new script `.buildkite/scripts/check_changelog_entries.sh` that inspects any `changelog.yml` files modified in a pull request and verifies that newly added `link:` entries point to the current PR. Issue links (`/issues/<n>`) are accepted as-is. A matching Buildkite step is wired into `.buildkite/pipeline.yml`, gated on PR builds and triggered only when a `changelog.yml` file is changed (`if_changed`). Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract the validation logic of check_changelog_entries.sh into discrete, testable functions (github_repo_path, get_added_links, check_changelog_file) guarded by a BASH_SOURCE main guard so the script can be sourced by tests without executing. Fix the common.sh source path to be relative to the script's own directory. Add test_check_changelog_entries.sh covering URL parsing, correct PR links, wrong PR links, issue link exemption, no new entries, deleted files, and multiple-error accumulation. Hook the new test file into run_dev_scripts_tests.sh so it runs in the existing CI step. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract all tests for get_release_commit.sh from run_dev_scripts_tests.sh into a dedicated dev/scripts/test_get_release_commit.sh, following the same pattern established for test_check_changelog_entries.sh. The runner run_dev_scripts_tests.sh is now a thin orchestrator that delegates to each test file in sequence. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename run_dev_scripts_tests.sh to run_shell_scripts_tests.sh and update the Buildkite step label and key accordingly (check-shell-scripts). Update all references in common.sh and the test file comments. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
🚀 Benchmarks reportTo see the full report comment with |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/test |
This comment has been minimized.
This comment has been minimized.
…iles Refactor notify_changelog_mismatch to accept a combined message and a fixed annotation context, then accumulate all failing changelog files into an array during the loop and call the function once after it with a bulleted list of every affected file instead of one notification per file. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a depends_on on check-shell-scripts (allow_failure: false) to the check-changelog-pr-links step so it only runs once the shell unit tests have completed successfully. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Add edit_gh_pr_comment_if_exists to common.sh next to add_or_edit_gh_pr_comment: it edits an existing PR comment identified by its marker, and does nothing if no matching comment is found. Use it in check_changelog_entries.sh to update the mismatch comment with a resolved message when all changelog links are correct, avoiding a spurious success comment on clean runs. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Add delete_and_create_gh_pr_comment to common.sh: it deletes any existing comment with the given marker and posts a fresh one, moving the status to the bottom of the PR thread for visibility. Use it in check_changelog_entries.sh on the success path instead of edit_gh_pr_comment_if_exists, so the resolved message appears as a new comment rather than an in-place edit. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace add_or_edit_gh_pr_comment with delete_and_create_gh_pr_comment in notify_changelog_mismatch so that repeated failures always post a fresh comment at the bottom of the PR thread instead of editing in place. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Pinging @elastic/ecosystem (Team:Ecosystem) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Move duplicated assert_equals and assert_exit_code functions from test_check_changelog_entries.sh and test_get_release_commit.sh into a shared test_helpers.sh file to avoid repetition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Changelog link mismatch — expected
Tip Add the |
💔 Build Failed
Failed CI StepsHistory
cc @mrodm |
TL;DRThe failing Buildkite step ( Remediation
Investigation detailsRoot CauseThe PR head commit
That change expands downstream Buildkite scripts that consume Evidence
Verification
Follow-upIf running all packages is intentional, this PR likely also needs a separate fix for the Note 🔒 Integrity filter blocked 2 itemsThe following items were blocked because they don't meet the GitHub integrity level.
To allow these resources, lower tools:
github:
min-integrity: approved # merged | approved | unapproved | noneWhat is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |

Proposed commit message
WHAT:
Add a new Buildkite CI step that inspects
changelog.ymlfiles modified in a pull request and verifies that newly addedlink:entries point to the current PR URL. The check:changelog.ymlfile changed at any directory depth (supporting both flat and nested package layouts)./issues/<n>) without requiring them to match the PR URL.changelog.ymlis part of the changed files (if_changed).The validation logic is extracted into discrete, testable shell functions (
github_repo_path,get_added_links,check_changelog_file) with aBASH_SOURCEmain guard so the script can be sourced by tests without executing.A dedicated test file (
test_check_changelog_entries.sh) is added covering: SSH/HTTPS URL parsing, correct PR links, wrong PR links, issue link exemption, no new entries, deleted files, and multiple-error accumulation.As part of this work, the existing
run_dev_scripts_tests.shis refactored into a thin orchestrator (run_shell_scripts_tests.sh) and theget_release_commit.shtests are moved to their own self-contained file (dev/scripts/test_get_release_commit.sh), following the same pattern.WHY:
Changelog entries with wrong PR links (e.g. copied from another PR) are a recurring source of noise in the release process. Automating this check at CI time catches the mistake before merge without requiring manual review of every changelog entry.
Author's Checklist
.buildkite/scripts/run_shell_scripts_tests.shsoft_fail). https://buildkite.com/elastic/integrations/builds/43361github-actions[bot]must notifyecosystemteam.changeschangelog-link-check:skiplabelHow to test this PR locally
Run the shell script test suite:
To simulate the changelog link check against a PR branch manually (this is based on the remote
originand it must be updated):Related issues
Screenshots
soft_fail: