Skip to content

Fix stale Java release preparation - #2543

Merged
devm33 merged 2 commits into
mainfrom
fix/java-release-stale-main
Sep 4, 2026
Merged

Fix stale Java release preparation#2543
devm33 merged 2 commits into
mainfrom
fix/java-release-stale-main

Conversation

@devm33

@devm33 devm33 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • check out the live main branch when preparing Java releases instead of the workflow dispatch SHA
  • retry the documentation version commit from the latest remote commit when main advances
  • record the documentation commit and rollback base only after the push succeeds, avoiding unsafe rollback attempts with empty identities

Root cause analysis

Actions run 33810120846 failed differently on its two attempts:

  1. Attempt 1, September 3: the Java job checked out 39c027b0, pushed documentation commit 70fa5d31, and created Maven release commit d6791fcd. The Maven release plugin then failed when GitHub rejected the java/v1.0.13-preview.6 tag push with remote: fatal error in commit_refs. The guarded rollback succeeded and pushed 18fba144 and 81ffc2a7, reverting the release and documentation commits.
  2. Attempt 2, September 4: rerunning the workflow retained the original run SHA, 39c027b0. The Java workflow used the default actions/checkout ref, so it checked out that old commit even though main had advanced through the rollback commits and Update @github/copilot to 1.0.83-4 #2507 to 184e504c. Its new documentation commit 3bdce0b6 was therefore rejected as a non-fast-forward push.
  3. The documentation step wrote docs_commit_sha before the failed push, which triggered rollback. However, pre_prepare_commit was recorded by the following step, which never ran. The rollback received an empty base SHA and failed with Recorded pre-prepare commit does not exist.

Regression provenance

The original attempt-1 GitHub tag rejection is separate from this workflow regression. This change makes release preparation and reruns safe after that or any similar partial failure.

Fix

  • explicitly check out live main for release preparation
  • rebuild and retry the documentation commit up to three times if main advances
  • publish the final documentation commit and its parent as outputs only after the push succeeds

Validation

  • cd java && ./scripts/test-update-documentation-versions.sh
  • YAML parse check
  • actionlint comparison against main (no new findings)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 617fe660-3b53-47f4-a7a6-a62b24c0589e
Copilot AI balanced review requested due to automatic review settings September 4, 2026 20:38
@devm33
devm33 requested a review from a team as a code owner September 4, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Retries can use a newer POM while retaining a stale automatically derived release version.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity .github/​workflows/​java-publish-maven.yml — When releaseVersion is omitted, VERSION is derived from the POM before this loop. This reset…
What changed in this PR

Updates Java release preparation to operate safely against live main.

Changes:

  • Checks out and retries against current main.
  • Records rollback identities only after a successful documentation push.
File Description
.github/​workflows/​java-publish-maven.yml Adds live-branch checkout, retry logic, and safer rollback outputs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/java-publish-maven.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 617fe660-3b53-47f4-a7a6-a62b24c0589e
@devm33
devm33 added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 4de05fb Sep 4, 2026
24 checks passed
@devm33
devm33 deleted the fix/java-release-stale-main branch September 4, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants