Skip to content

fix(ci): PAT-reachability fallback + pin-ref shape guard for the data-ingestors jobs - #326

Merged
LukasWodka merged 1 commit into
developfrom
fix/canary-pat-fallback-and-pin-shape-guard
Jul 14, 2026
Merged

fix(ci): PAT-reachability fallback + pin-ref shape guard for the data-ingestors jobs#326
LukasWodka merged 1 commit into
developfrom
fix/canary-pat-fallback-and-pin-shape-guard

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Fixes two Cursor Bugbot findings surfaced on the #323 promotion re-review of the data-ingestors drift jobs. Both are pre-existing and advisory (neither is a required check), but worth closing.

1. Invalid PAT breaks canary checkout (Medium)

head-drift-canary.yml passed secrets.CROSS_REPO_READ_TOKEN || github.token straight to actions/checkout. || only falls back when the secret is empty, so a set-but-expired / mis-scoped PAT reds the weekly canary even though data-ingestors is public and github.token would work.

Fix: ported goldens-drift.yml's reachability probe — a git ls-remote check selects the PAT only when it actually works and falls back to the default token otherwise (use_pat output kept in lockstep with the checkout). goldens-drift.yml already had this; only the canary was missing it.

2. Pin ref lacks shape guard (Low)

goldens-drift.yml and head-drift-canary.yml read scripts/.data-ingestors-ref with only an emptiness check — and goldens-drift.yml passes it straight to actions/checkout — unlike chart-drift.yml, which validates ref shape. A malformed pin then fails opaquely at checkout.

Fix: added chart-drift.yml's guard to both pin-resolution steps — SHA / branch / tag characters only, no .. — so a bad pin fails with a clear ::error instead.

Verification

  • Shape guard accepts the real pin, develop, a 40-char SHA, release/v1.2.3; rejects../../etc/passwd, foo..bar, x;rm -rf /, $(whoami), empty.
  • Probe no-token path selects github.token.
  • actionlint + shellcheck clean, YAML valid.

Once merged to develop, #323 inherits it.


Note

Low Risk
CI-only workflow shell changes; no application auth, data paths, or runtime behavior.

Overview
Hardens the data-ingestors drift workflows so bad pins and broken cross-repo tokens fail predictably instead of deep in checkout.

Pin resolution in goldens-drift.yml and head-drift-canary.yml now validates scripts/.data-ingestors-ref the same way as chart-drift.yml: allowed ref characters only, no .., with a clear ::error before checkout uses the value.

HEAD-drift canary no longer passes CROSS_REPO_READ_TOKEN to checkout whenever the secret is merely set. A new git ls-remote probe picks the PAT only when it can read the repo; expired or mis-scoped PATs fall back to github.token, matching the probe/checkout pairing already used in goldens-drift.yml.

Reviewed by Cursor Bugbot for commit 7e2c233. Bugbot is set up for automated code reviews on this repo. Configure here.

…-ingestors jobs
Two Cursor Bugbot findings surfaced on the #323 promotion re-review of the
data-ingestors drift jobs:
1. Invalid PAT breaks canary checkout (Medium). head-drift-canary.yml passed
`secrets.CROSS_REPO_READ_TOKEN || github.token` straight to actions/checkout.
`||` only falls back when the secret is EMPTY, so a set-but-expired /
mis-scoped PAT reds the weekly canary even though data-ingestors is public
and github.token would work. Ported goldens-drift.yml's reachability probe:
a `git ls-remote` check picks the PAT only when it actually works and falls
back to the default token otherwise (use_pat output, kept in lockstep with
the checkout). goldens-drift.yml already had this probe.
2. Pin ref lacks shape guard (Low). goldens-drift.yml and head-drift-canary.yml
read scripts/.data-ingestors-ref and (for goldens-drift) pass it straight to
actions/checkout after only an emptiness check, unlike chart-drift.yml which
validates ref shape. Added the same guard to both: SHA / branch / tag
characters only and no "..", so a malformed pin fails with a clear error
instead of an opaque checkout failure.
Verified: the shape guard accepts the real pin, branch/tag/SHA refs, and
rejects "..", shell metacharacters, and empty; the probe's no-token path
selects github.token; actionlint + shellcheck clean; YAML valid.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodkaLukasWodka self-assigned this Jul 14, 2026
@LukasWodka
LukasWodka requested a review from saadqbalJuly 14, 2026 18:59
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

@BugBot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7e2c233. Configure here.

@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

👋 Heads-up — Code review queue is at 48 / 30

Above the WIP limit. The team convention is to review existing PRs before opening new work.

Open PRs currently in Code review (oldest first):

Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.)

@LukasWodka
LukasWodka merged commit 0bf4b9f into developJul 14, 2026
25 checks passed
@LukasWodka
LukasWodka deleted the fix/canary-pat-fallback-and-pin-shape-guard branch July 14, 2026 19:02
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@LukasWodka@saadqbal