Fix: pass token for private repo isolation checks - #51
Closed
ModeSevenIndustrialSolutions wants to merge 1 commit into
Closed
Fix: pass token for private repo isolation checks#51ModeSevenIndustrialSolutions wants to merge 1 commit into
ModeSevenIndustrialSolutions wants to merge 1 commit into
Conversation
The change isolation verify job checks out TARGET_REPO with no token, so the reusable workflow falls back to this repository's GITHUB_TOKEN. That token cannot read other repositories, so every private target fails with "repository not found" and votes -1 on the Gerrit change. Eleven lfit repositories are private, among them the puppet-* and lfcore-* trees; lfcore-terraform accounts for every failure of this workflow so far. Pass REPLICATION_TOKEN through to the reusable workflow, matching what gerrit-required-verify.yaml already does for the same set of repositories. Depends on lfit/releng-reusable-workflows#813, which adds the 'token' secret this maps onto. The reusable workflow pin needs bumping to the resulting release before this merges. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Contributor
Author
|
Closing: the change isolation workflow is being removed from this repository, so there is no caller left to pass the token through to. The underlying fixes remain relevant and stay open in lfit/releng-reusable-workflows#813 — in particular the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Draft — blocked on lfit/releng-reusable-workflows#813.
Passing a secret that the referenced reusable workflow does not declare is a workflow validation error, so this must not merge first. The pin also still needs bumping (see below).
Problem
Every failed run of
Gerrit Required Change Isolation Verifyhas the same cause — the target repository is private. Example: run #17 againstTARGET_REPO: lfit/lfcore-terraform.The
change-isolation-verifyjob passes no token to the reusable workflow, so its Gerrit checkout falls back to this repository'sGITHUB_TOKEN. That token is scoped tolfit/.githubalone and returns404for any private mirror, so the job fails and votes -1 on a change that is perfectly fine.This is not specific to one repository — 11 of 63
lfitrepositories are private, including precisely thepuppet-*/lfcore-*/ci-managementtrees:gerrit-required-verify.yamlin this same repository already checks out that exact set successfully, usingtoken: ${{ secrets.REPLICATION_TOKEN }}. The credential exists and is proven; the isolation workflow just never plumbed it through.Change
Passed explicitly rather than via
secrets: inherit, to keep the reusable workflow's access limited to the one credential it needs.Why not just exclude
lfcore-terraform?It was considered and rejected:
INFO.yamland.githubisolation matters most, and they are already explicitly in scope for the sibling GPG-validation required workflow.workflow_dispatch-only, fired by thelfit-replicationservice account from Gerrit (event=workflow_dispatch,actor=lfit-replication); it is not a ruleset, so exclusion would mean either a guard job here or a change to the Gerrit-side dispatcher.Before merging
Bump the reusable workflow pin from
5278f76(v0.8.1) to the release containing lfit/releng-reusable-workflows#813. I will update this PR once that lands.Validation
zizmor --persona auditor: no findingsprekhooks pass; commit is GPG-signed with a DCO sign-offCompanion PR (the actual fix, plus a second defect where
if: !cancelled()masked the real checkout failure behind a misleadingHEAD~1error): lfit/releng-reusable-workflows#813