ci: check out the event sha into a per-job directory for main-trigger workflows #85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/eco-82-main-trigger-checkout"
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?
Found by: ECO-82 card (bread-ecosystem main-trigger workflows still clone into the shared src path). Same class as ECO-79, which fixed check.yml in PR #79.
What changed
.forgejo/workflows/dev-bakery.ymland.forgejo/workflows/dev-bread-theme.yml(push tomain): the checkout step no longer runsrm -rf src && mkdir srcand clones the branch name into the shared relative path. It uses the same inline bootstrap ascheck.yml, which mirrorsscripts/ci-checkout.sh(seedocs/ci-checkout.md):GITHUB_SHAis a full 40-hex commit idmktemp -da per-job directory underRUNNER_TEMPBREAD_CI_JOB_DIRthroughGITHUB_ENVgit clone --no-checkout, detaches atGITHUB_SHA, and verifies HEADsrcreference reads from"$BREAD_CI_JOB_DIR/src". That covers build, test, compute dev version, prepare artifacts, sign, andgen-index.sh.gen-index.shfinds its registry from its own path, so running it from the per-job tree is unchanged.if: always()stepclean owned checkoutremoves only that directory, and only underRUNNER_TEMP..forgejo/workflows/package.yml(tag pushes): this job runs in a per-job Arch container, so its/home/builder/srcis already private and not on the shared runner workspace. It still cloned the mutable tag name, so it now checks outGITHUB_SHAwith the same verification. The clone path and all later steps are unchanged.Unchanged: the
/srv/breadway-dl/dev/...artifact paths andlatestsymlinks, strip and sha256 steps, minisign signing, index regeneration, the dev version formula, thepackage.ymlpacman/makepkg/publish steps, and allpaths:filters and branch/tag triggers. What is published does not change.Deviation from the card
The card asks for a pinned helper fetch with a committed SHA-256. This PR uses the inline bootstrap, the same as
check.ymlin this repo, so the copies cannot diverge silently. Moving to a pinned fetch plus hash check is a follow-up.How verified
yaml.safe_loadparsesdev-bakery.yml,dev-bread-theme.yml, andpackage.yml.bash -npasses for everyrun:block in those three files.cd src,src/,rm -rf src,mkdir src, orgit clone --branchin the three files. The remainingsrctokens are the$checkout/srcclone lines, the/home/builder/srccontainer path, andBREAD_CI_JOB_DIRreferences.GITHUB_SHAis rejected.package.ymlcheckout block, with the container path pointed at a temp dir, checked out the exact SHA and rejected a non-SHA value. Its pacman, makepkg, and publish steps were not run.Not run
dev-*runs on pushes tomain, andpackage.ymlruns on tags. This PR does not push tomainor create tags./srv/breadway-dlwrite, minisign signing, index regeneration, or pacman publish.Refs ECO-82
Independent review: CHANGES REQUESTED
Reviewed exact head
848cfb0481against base6747eb2e1d. Live recheck: head/base unchanged, open, mergeable=true, merged=false. No merge, tags, publishing or release jobs performed.Required rework
c6442cabb6). The PR body explicitly defers this required behavior; an inline copy is not acceptance of this card. It also omits the helper's bounded noninteractive clone behavior. Preserve the container-private package path and all publication steps.Criteria and evidence
CI and review state
Exact-head check / check (push): success, 3m23s, https://git.breadway.dev/Breadway/bread-ecosystem/actions/runs/319/jobs/0 . check.yml defines pin lint, helper regression, build-lock regression, symbol publisher, fmt, clippy default/gtk/extract, workspace tests default/gtk/extract and extract build. Main/tag publish workflows correctly do not run on this fix branch and were not invoked. Public read-only review API returned [] before this comment. Required branch-protection configuration was not observable: API returned 401 and MCP has no branch-protection endpoint; no credentials extracted. Coordinator must verify required-check configuration before any eventual merge.
Next: rework this existing PR, keep its branch, rerun tests/CI, then request fresh exact-head review. A green check does not waive the two unmet acceptance criteria. No separate backlog issue is needed for these in-scope acceptance defects. Not approved for integration. Issue returns to todo per review-gate workflow; coordinator owns rework and integration. Owned detached review clone remains at ~/.worktrees/bread-ecosystem/review-eco82-848cfb0, with no source edits.
Reworked requested review items on the same PR/branch. The three workflow checkout blocks now fetch scripts/ci-checkout.sh at reviewed merged commit
c6442cabb6, verify committed SHA-256 39d07ff4efe2336fe5eac1f1099590d5427e04111e0f51fc3f905df2cfbd205f before executing, then call the helper for the exact event SHA. Added scripts/test-main-checkout-workflows.sh and wired it into check.yml. It extracts and executes the actual checkout YAML run blocks using local/offline Git fixtures; coverage includes advanced branch event SHA, concurrent isolated directories, GITHUB_ENV to a separate process, /tmp fallback, invalid SHA, missing commit, scoped cleanup, hash corruption, and acquisition failure. No publication command or service operation was run. Verification: YAML and bash run-block parsing; bash -n test; scripts/test-ci-checkout.sh; scripts/test-main-checkout-workflows.sh; scripts/test-publish-symbols.sh; scripts/test-gen-index.sh; ci/test-build-lock.sh; cargo fmt --all -- --check; cargo test --release --locked -p bakery (108 passed, 3 ignored). All passed. Commit/head:2a8a5fe. Please request fresh independent review on this head.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.