lab build --upload: add --prerelease flag and anchor the release tag to the built commit #318
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#318
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
lab build --uploadneeds two small improvements so release publishing is correct and CI stays clean:--prereleaseflag.Right now both are hardcoded in
crates/lab/src/repo/releases.rs:ensure_release()always sends"prerelease": false."target_commitish": "development", and on the rolling (already-exists) path it only PATCHes name/body — it never moves the tag.Why this matters
We roll out a single canonical release workflow to every
hero_*repo. It builds each branch and publishes to a per-branch rolling release:latest-mainlatest-developmentlatest-integrationBecause of the two hardcodes:
latest-mainonhero_procended up anchored to a development commit (ce2f199) instead of the main tip. Every repo would hit this — the release never points at the commit it was built from.development/integrationcan't be marked as pre-releases, so everything shows up as stable.To work around it today, the workflow hand-rolls a
git push -fof the tag plus acurl PATCHof theprereleaseflag after every build. That logic belongs inlab, not copied into 43 repos' CI.Reference workflow (the consumer):
hero_proc/.forgejo/workflows/lab-publish.yamlRequested changes
crates/lab/src/repo/releases.rsensure_release()/upload_release_assets(): takeprerelease: boolandtarget_commitish: &strinstead of hardcoding them; use them in both the create and patch JSON bodies.anchor_tag()helper that force-moves the rolling tag onto the built commit (the PATCH API can't move an existing tag): Run it before upload so the create-POST binds to the correctly-placed tag.Wiring
crates/lab/src/main.rs: add#[arg(long)] prerelease: boolto theBuildcommand and carry it through.crates/lab/src/builder/orchestrator.rs:repo_root,release_tag, and(forge_url, token, owner, repo)are already in scope. ResolveHEAD(git -C <repo_root> rev-parse HEAD), callanchor_tag(...)once, and passprerelease+ the sha down into the upload.End result (clean CI)
The whole "anchor tag + set prerelease" CI step disappears; the build step becomes just:
Related
install.shignores the fetched branch (same rollout; fixed in-workflow with--branch).