Repository navigation
Add an opt-in skip for release notes checks on draft pull requests - #442
Conversation
|
💚 CLA has been signed |
|
@Mpdreamz, here is some context for this PR. A Kibana engineer asked in the Kibana Slack channel to stop the "Changelog labels needed" comment on draft PRs. An example is elastic/kibana#300907. They do not want to add the team label to a draft, because the label pings their team before the work is ready for review. Alex Szabó and Nigel Small agreed that the checks should apply only to PRs that are ready. Fabrizio took the request. The first version kept the check running on drafts and only removed the comment. That left a red check with no explanation, so the PR now skips the We tested it on elastic/docs-playground-release-notes-tagged#75. The caller on that PR points at this branch. The Verify section lists each transition. That PR is only a test and must not be merged. We will close it when this PR is done. After this PR merges, Kibana's A related change collapses the long label tables in the same comment: elastic/docs-builder#4610. Generated by Claude Code |
The release notes checks posted a "Changelog labels needed" comment on draft pull requests. Authors who did not want to add a team label before review got noise. The checks still run and fail on drafts, but the comment now waits until the pull request is ready for review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu
A failing check on a draft with no comment confused authors. Drafts now skip the checks. GitHub cannot merge a draft, so the skip is safe. The caller also listens for converted_to_draft, so a pull request that goes back to draft drops its failed check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu
c85cc9f to
cbe1fb6
Compare
Callers copied before this change do not listen for ready_for_review. With a default skip, a draft that leaves draft never runs the checks, and the skipped check counts as passing, so it can merge unchecked. The skip-drafts input keeps those callers on the old behavior. The downloadable caller sets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu
|
Rollout PRs that opt the callers in to
Generated by Claude Code |
Draft pull requests in this repository no longer get the release notes check or its pull request comment. The check runs when the pull request is marked ready for review. ## Why `Release notes: Check` runs on every pull request, drafts included. A draft without the right label gets a failed check and a comment before the author is ready. ## What The caller in `.github/workflows/release-notes.yml` now does three things: - It sets `skip-drafts: true`, so a draft shows the check as skipped and gets no comment. GitHub cannot merge a draft, so a skipped check never lets a pull request through. - It listens for `ready_for_review`, so the check runs as soon as a pull request leaves draft. - It listens for `converted_to_draft`, so a failed check turns into a skipped one when a pull request goes back to draft. **Do not merge yet.** The `skip-drafts` input comes from [elastic/docs-actions#442](elastic/docs-actions#442), which is not in `docs-actions@v1` yet. Until then, the release notes workflow on this pull request fails because it does not know the input. --- _Generated by [Claude Code](https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu)_ Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Draft PRs get a failed release notes check and a "Changelog labels needed" comment before the author is ready. skip-drafts skips both on drafts. The ready_for_review event runs the checks when the PR is ready, and converted_to_draft clears a failed check when a PR goes back to draft. Needs elastic/docs-actions#442 in docs-actions v1. Claude-Session: https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Summary Draft PRs no longer get the release notes check or the "Changelog labels needed" comment. The check runs when the PR is marked ready for review. Today `release-notes / validate` runs on every PR, drafts included. A draft that has no team label yet gets a failed check and a comment. Adding the label early pings the team before the work is ready for review. An example is elastic#300907. This PR changes `.github/workflows/release-notes.yml` and `.github/workflows/release-notes-comments.yml`. In `release-notes.yml`: - `skip-drafts: true` skips the check and the comment while the PR is a draft. The skipped check does not block anything, because GitHub cannot merge a draft. - `ready_for_review` runs the check as soon as the PR leaves draft. Without this event, a PR that leaves draft is not checked until the next push or label change. - `converted_to_draft` replaces a failed check with a skipped one when a PR goes back to draft. In `release-notes-comments.yml`, the comment job no longer starts when the `release-notes` run was skipped, which is what a draft PR produces. It used to start, find no decision, post nothing, and end green. Now it does not use a runner. This does not change what appears on a PR. It comes from elastic#300954. **Depends on:** elastic/docs-actions#442, released in `docs-actions` 1.69.0. `v1` declares the `skip-drafts` input. The change was tested end to end in elastic/docs-playground-release-notes-tagged#75: ready → failed check and comment; back to draft → skipped; push while draft → skipped; ready again → failed check and updated comment. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) — not applicable, CI workflow only. - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials — documented in the [docs-actions release notes README](https://github.com/elastic/docs-actions/tree/main/release-notes). - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios — not applicable; tested in the playground repository above. - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/docs/extend/kibana/contributing/workflow/how-we-use-github#release-notes) — `release_note:skip`. - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels — `backport:skip`. ### Identify risks - Low. The change only affects the release notes check on PRs. If a PR leaves draft without a `ready_for_review` run, it could merge with a skipped check; the `ready_for_review` trigger in this PR prevents that. --- _Generated by [Claude Code](https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu)_ --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Repositories can now skip the release notes checks on draft pull requests with a new
skip-draftsinput. With the input set, a draft shows no failed check and gets no comment, such as "Changelog labels needed". The checks run when the author marks the pull request ready for review. Without the input, nothing changes.Prompt summary: A Kibana engineer reported that draft pull requests get a "Changelog labels needed" comment. They do not want to add the team label to a draft, because the label pings their team before the work is ready. The ask is to stop the comment and the unexplained failed check on drafts.
Why
The
validatejob in the reusablerelease-notes.ymlworkflow runs on everypull_requestevent and does not checkdraft. Its failure uploads thechangelog-decisionartifact, and therelease-notes-comments.ymlcaller then posts the sticky comment. As a result, every draft that is missing a label gets a failed check and a comment. An example is elastic/kibana#300907.What
Opt-in skip for drafts
With
skip-drafts: true, thevalidatejob does not run on a draft, so the check shows as skipped. With no artifact, thechangelog/commentaction posts nothing. The input defaults tofalse, because a caller that does not listen forready_for_reviewwould never check a pull request that leaves draft. GitHub counts a skipped check as passing, so such a pull request could merge unchecked.The caller listens for draft transitions
The
release-notes/release-notes.ymlcaller template setsskip-drafts: trueand addsready_for_reviewandconverted_to_draftto itspull_requesttypes.ready_for_reviewruns the checks as soon as the pull request is ready.converted_to_draftreplaces a failed check with a skipped one when a pull request goes back to draft. An existing comment stays on the pull request until the next run that is not a draft updates it.Caller guidance
The
release-notes/README.mdfile has a new "Draft pull requests" section. It shows the input with the two event types, and it explains what happens withoutready_for_review. To opt in, Kibana's caller needs the input and both event types after this PR merges.Verify
elastic/docs-playground-release-notes-tagged#75 points its caller at this branch, sets
skip-drafts: true, and has no labels. Its run history on this branch shows each transition:Out of scope: The older
changelog-validate.ymlandchangelog-submit.ymlworkflows still run on drafts.release-notes-changelog-file.ymlstill runs after a skipped run, as it did before.https://claude.ai/code/session_0198Z15QXfthJ2QgGztrDHtu
Generated by Claude Code