ci: harden release PR check validation - #89
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Execute backlog item connect-java-release-check-rollup-fix-w3 as an isolated connect-java change: remove duplicate release-PR build statuses/check runs while preserving an exact-commit audit of the native workflow-dispatch matrix checks before auto-merge. The workflow must retain only checks:read capability, reject incomplete or unsuccessful native checks, and refuse to merge if the release PR head moved after validation. Preserve a regression guard and concise durable project guidance. Do not release, deploy, merge a PR, change production, send public replies, widen credentials, touch the separate Gate release or Moxy-consumption decision, or otherwise expand scope.
What Changed
Risk Assessment
✅ Low: The change is narrowly scoped, removes synthetic check/status writes, audits native checks on the captured commit, and now guards both the merge operation and externally observed merged state.
Testing
The focused regression test and workflow-level simulation passed, demonstrating native-check auditing, duplicate-check avoidance, and head-movement rejection; evidence is saved in the transcript artifact. No full suite, linter, formatter, release, merge, or deployment was run.
Evidence: Release workflow validation transcript
Success path exited 0; failed native check and moved-head scenarios exited 1 with expected workflow errors.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
.github/workflows/release-please.yml:127- The required intent says to “refuse to merge if the release PR head moved after validation.” Lines 123-129 perform only a non-atomic read, thengh pr mergeruns without an expected-head precondition; a push between those calls can merge an unvalidated head. Use--match-head-commit "$HEAD_SHA"so GitHub enforces the validated commit atomically.core/src/test/java/com/minekube/connect/release/ReleasePleaseCheckAuditTest.java:50- This regression test reads.github/workflows/release-please.yml, butcore/build.gradle.ktsonly declaresrelease.ymlandrelease-repair.ymlas test inputs. Gradle can therefore reuse cached:core:testafter the release-please workflow changes, silently skipping this guard. Add the release-please workflow to the test inputs.🔧 Fix: Make release-PR merge head-atomic and invalidate workflow test cache
1 error still open:
.github/workflows/release-please.yml:136- The--match-head-commitguard protects only this merge attempt. If the PR moves from the validated SHA and another actor merges the new head while this loop runs, the guarded merge fails, but lines 140-145 accept anyMERGEDstate and lines 150-161 continue the release flow. This still permits an unvalidated head to be treated as successfully merged. AcceptMERGEDonly after verifying the PR head is the validated SHA, otherwise fail.🔧 Fix: Guard merged release PRs against unvalidated head bypasses
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
./gradlew :core:test --tests com.minekube.connect.release.ReleasePleaseCheckAuditTestExecuted the actual release-PR validation block with mocked success, failed-check, and moved-head scenariosgit status --shortand scope inspection againstorigin/main✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.