Skip to content

ci: validate Plugin Hub snapshots via a scratch ref before pushing hub/publish - #113

Merged
AntonyGarand merged 1 commit into
masterfrom
fix/validate-pin-ref
Oct 19, 2026
Merged

AntonyGarand merged 1 commit into
masterfrom
fix/validate-pin-ref

Conversation

@AntonyGarand

Copy link
Copy Markdown
Contributor

What & why

The Publish workflow validates a new snapshot commit with the official packager before pushing hub/publish — but the packager clones the repo from GitHub and checks out that SHA, so validation can never pass for an unpushed commit (upload-pack: not our ref). First exercised by #112's run (log); earlier snapshots were pushed by local script runs, so the path was never hit.

Fix: push the snapshot to the scratch hub/validate ref first, validate (packager now fetches the exact commit from GitHub, exactly like the real Hub build), then fast-forward hub/publish and delete the scratch ref.

Testing

  • Evidence for the bug: run 39265002435 failed at the packager step with fatal: remote error: upload-pack: not our ref 7af049c…; hub/publish was correctly left untouched (push step is ordered after validation).

  • python -c "import yaml; yaml.safe_load(...)" on the edited workflow: YAML OK.

  • Failure-path behavior: summary now reports "Validation failed … Do not pin" instead of printing pin instructions for an unpushed commit.

  • No Java changes; ./gradlew clean build unaffected (CI runs it).

  • The merge of this PR itself triggers the fixed pipeline on a real README-bearing snapshot — that run is the end-to-end test (watched; summary will report the commit to pin).

  • ./gradlew clean build green

Risk

High tier (CI/publish workflow), contained: on validation failure hub/publish remains untouched and only the scratch hub/validate ref is created/deleted (hub/* is unprotected; concurrency group serializes runs). Fast-forward-only push of hub/publish is preserved.

How to revert

Revert this commit on master; the workflow returns to the previous order (validate-then-push, which fails for fresh snapshots until #112-era behavior is re-triggered). No hub/publish history is ever rewritten.

In-game verification

None — no in-game behavior.

Generated-by: GLM-5.3 (OpenCode)

The official packager clones the plugin repository from GitHub and
checks out the pinned SHA, but the workflow validated the new snapshot
commit before pushing it, so the packager always failed with
"upload-pack: not our ref". The pipeline had never exercised this path:
earlier snapshots were pushed by local script runs, and the automatic
runs all found nothing to publish.

Push the snapshot to the temporary hub/validate ref first so the
packager fetches the exact commit from GitHub exactly as the real Hub
build will, and only fast-forward hub/publish after validation passes.
The scratch ref is deleted afterwards (also on failure), and the job
summary no longer prints pin instructions when validation failed -
previously it recommended pinning a commit that was never pushed.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb805b5a-ec5d-4a6a-8bb8-d8ec566587ad
📥 Commits

Reviewing files that changed from the base of the PR and between 8abe4fb and fb71332.

📒 Files selected for processing: 2
  • .github/workflows/publish-hub.yml
  • README.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AntonyGarand
AntonyGarand merged commit 5ef114e into master Oct 19, 2026
3 checks passed
@AntonyGarand
AntonyGarand deleted the fix/validate-pin-ref branch October 20, 2026 02:22
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.

1 participant