feat: release-gate action #7
No reviewers
Labels
No labels
auto-update
blocked
dependency
major
release-blocker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Wi3eDigital/laravel-deploy-actions!7
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/release-gate"
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
release-gate/: Docker action (Python 3.14 slim, pinned digest) that reads the Forgejo API and decides:mode: release: publish the draft now or notmode: promote: which tag to promote to prod, or why nonemode: recheck: whether a queueddeploy_prod(source=auto) may still deployThe gate only reads and never writes. The calling workflow acts on
decision. Rules followdocs/plan.md. README:release-gate/README.md. Closes #2.Layout:
forgejo.py(API client with retries, GET only),rules.py(all rules),main.py(inputs, outputs, step summary).Inputs / outputs
modedecisionpublish/promote/skip/dry-runtoken,repotagapi_urlhttps://forgejo.entwirr.me/api/v1release_iddefault_branchmaincriticaltrue/falseauto_release,auto_promoteoffreasonsautomation_paused""skip_reason;(also filled in dry-run)deps_threshold/deps_max_age_days/soak_days10/14/4pre_notice_neededprod_version_url,candidate""env_keys_new.env.examplekeysrequires_repo,requires_version_url""How each rule is implemented
Release
Kill switches:
automation_paused == true→ skip, and this wins over dry-run. Ifauto_releaseis anything other thanonordry-run, it counts asoff→ skip.dry-runcomputes everything and returnsdecision=dry-run.Exactly one draft, with a strict
vX.Y.Ztag that is newer than the highest published non-prerelease release.Draft not empty. PRs in the draft come from the API, not from the markdown:
compare/<last tag sha>...<default_branch>;merge_commit_shais in that commit set;sort=recentupdate, and stop at the first full page that is older than the tag commit.Content rule:
security, ordeps_thresholddependency PRs, ordeps_max_age_daysago.A dependency PR has the label
dependencyor a title starting withchore(deps).security,breaking-changeorcaution;major;database/migrationsdirectory listing between the two refs);.env.examplekeys (raw file at both refs, same rules as env-diff:exportcounts, commented# KEY=does not).Promote
/version(plain text or JSON).deploy/staging=success(combined status endpoint) and is at leastsoak_daysold.release-blockerissues. The label is also checked on the client side, in case the server ignores the filter.<!-- env-acknowledged -->.up()is scanned fordropColumn|dropTable|renameColumn|dropIfExists|Schema::drop. A hit gives "manual deploy required".notify/pre-prod=successthat is at least 24h old.pre_notice_needed=true, but only if nothing else blocks..release/requires.json{"kima/portal": "vX.Y.Z"}at the candidate must be ≤ the live/versionatrequires_version_url.Recheck: checks the kill switches, then
release-blockerissues, then whether prod is belowcandidate→promote. Otherwise →skip.Tests
86 pytest tests, with no network. A fake
requestssession answers from hand-written fixtures (tests/fixtures/release.json,promote.json,migrations/*.php). The fixture shapes were checked against read-onlyfj apiGETs on Aevana/aevana (releases, pulls, tags, compare, combined status, contents, raw).Every rule has passing and failing tests. They include:
down()-only drops and strings/comments)/versionor printed, pagination, query paramsCI:
.github/workflows/test_release_gate.yaml(pull_request + push to main) runs inpython:3.14-slim@sha256:…. The tests also pass locally, and the image builds and runs (docker buildplus a smoke run).Deviations / not verified
uses: https://forgejo.entwirr.me/Wi3eDigital/laravel-deploy-actions/release-gate@<sha>. This must be confirmed in the Aevana pilot.decision/taginstead ofpublish/candidate;recheckmode;soak_days=0: a missingdeploy/stagingstatus is allowed (homepage has no staging). Afailurestill excludes the tag..release/requires.jsonformat is defined here:{"<requires_repo>": "vX.Y.Z"}. A missing file means no requirement.deploy_stagingmust post the commit status contextdeploy/stagingexplicitly. Today Aevana only has job-named statuses such asDeploy to Staging / deploy (release), so promote would find no candidate./versionis unreachable or unparsable, or prod's version has no tag, the step fails with exit 1, so thatschedule.failedfires.Schema::drop(. Not detected:dropTimestamps,dropSoftDeletes,dropMorphs, raw SQL.actions/checkout, because the slim image has neither node nor git.🤖 Generated with Claude Code
https://claude.ai/code/session_0114prpbjyD3Bqt26YpZ1MEL