fix(ci): publish the public kit with the Vault token that already exists #215
No reviewers
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design!215
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/publish-public-kit-vault-token"
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?
Publish public design kit / publish-public-repohas never succeeded — every run it has ever had is afailure. This fixes it using credentials and grants that already exist, and fixes a second defect that would have destroyed files the moment it first went green.Scope
Defect 1 — the secret was never created. The job fails on its first publish line,
test -n "$PUBLIC_REPO_TOKEN". That secret does not exist at org scope (11 secrets, none by that name) or repo scope (zero). The log is unambiguous: its last output is the build step'sbuilt dist/starter/and/tmp/public-repo, thenexitcode '1'with nothing printed. Reproduced inpython:3.12-slim— the build emits exactly those two lines and exits 0; the guard with the secret unset exits 1 printing nothing.No new credential and no new grant were needed.
secret/forge/forgejo/ciholds theforge-citoken, and theci-runnerACL policy already grants read on it:So the job now fetches it through
.forgejo/actions/bastia-secret, exactly astest-generator.yml,block-validation.ymlandudg-copy-coverage.ymlalready fetchsecret/forge/rituals-read. One copy of the credential, in OpenBao, rotatable in one place, with the fetch audited — rather than a second copy pasted into a Forgejo Actions secret that then has to be rotated twice.Defect 2 — the publish would have deleted the public repo's governance. Found while verifying the first, and fixed here because shipping the credential fix alone would have triggered it. The step wipes the target with
find … ! -name .git -exec rm -rfthenrsync --delete. Diffing the export against the livedesign-kit-publicgives an exact delta of three files the export does not produce:.forgejo/workflows/pr-policy-check.yml.forgejo/pull_request_template.mdCONTRIBUTING.mdcore.contributor_review_policyby.spel/bin/forge-policy-sync.shThe first successful publish would have removed all three. The wipe and the rsync now exclude them.
Out of scope: the export script, the token itself, the
ci-runnerpolicy (deliberately not widened — it already covers this path), and the workflow's path filter.Testing
built dist/starter/+/tmp/public-repo, exit 0test -n "$PUBLIC_REPO_TOKEN"with secret unsetforge-citoken →git-upload-packadvertisementforge-citoken →git-receive-packadvertisementyamllint .forgejo/workflows/Push capability was proven by requesting the
git-receive-packadvertisement, which the server only serves to a caller authorized to push, and which sends no ref update — so the probe writes nothing. Repo ACL showingpush: trueis not sufficient evidence on its own, since Forgejo scopes tokens separately from repo permissions.The preservation fix was verified against a failing control, not just the happy path:
CONTRIBUTING.md.forgejo/Impact Statement
Risk: moderate, and concentrated in the first successful run — this job has never completed, so its publish path has never actually executed against the real target. What it will do on success is now bounded: replace the generated content, leave the three repo-owned files alone.
Nothing new was provisioned. No Forgejo Actions secret was created, no Vault path written, no AppRole or policy changed. The fix consumes a grant that has been in place all along. If you would rather publish under a dedicated identity than
forge-ci, that is a separate decision and this PR does not foreclose it.What to watch on the first green run: confirm
design-kit-publicstill carriesCONTRIBUTING.mdand.forgejo/, and that its diff is limited to generated content. The workflow is path-filtered (Brand/UDG/dtcg/**,components/**,templates/**,udg/generators/**,tools/export_public_repo.py,justfile,docs/public-repo.md), so it will not fire on merge of this PR alone — useworkflow_dispatchto exercise it deliberately rather than waiting for an unrelated change to trigger the first-ever publish.Unrelated and still open:
Test Generator / testis not a blocking context onmain, which is how #210/#211 merged red. That is a branch-protection setting, not a code change.