Skip to content

fix(sync-docs): diagnosable fetch + name the missing SOURCE_REPOS_TOKEN#69

Open
LukasWodka wants to merge 2 commits into
mainfrom
fix/sync-docs-token-diagnostics
Open

fix(sync-docs): diagnosable fetch + name the missing SOURCE_REPOS_TOKEN#69
LukasWodka wants to merge 2 commits into
mainfrom
fix/sync-docs-token-diagnostics

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Why sync-docs has been red for two weeks

Every run dies ~2 seconds in with a bare gh: Not Found (HTTP 404). Diagnosed:

  • SOURCE_REPOS_TOKEN is not set (verified — no repo or org secret).
  • The fetch step falls back to GITHUB_TOKEN, which is scoped to this repo.
  • The first source is tracebloc-py-package, which is private → cross-repo read with the
    docs-scoped token → 404.
  • jq | while ran in a subshell and set -e killed it on that first source, hiding the other four
    (all public — client, start-training, data-ingestors, model-zoo would sync fine).

The API path and ref are correct. It's purely the token.

What this PR does

Hardens the fetch step so the failure is diagnosable, not cryptic: fetch every source, collect
failures, name the repo and the gh message on each, drop truncated cache files, and — when
SOURCE_REPOS_TOKEN is unset — print the exact remediation. Still fails closed (a private source
must sync), but now tells you precisely why. Verified the loop with a stubbed gh.

The actual unblock — needs you (I can't mint a PAT)

Create a fine-grained PAT: resource owner tracebloc, repository access limited to
tracebloc/tracebloc-py-package (the only private source), permission Contents: Read, nothing
else. Add it as an Actions secret named SOURCE_REPOS_TOKEN on this repo (or the org, scoped to
docs). Once set, all five sources sync and the workflow goes green.

docs is exempt from the develop-only rule — mergeable to main directly.


Note

Low Risk
Changes are limited to GitHub Actions workflows (fetch error handling and a new reusable-workflow caller); no application runtime or data paths are modified.

Overview
Adds a new advance-deploy-env workflow that runs on pushes to develop, staging, master, or main and delegates to tracebloc/.github to advance each merged PR’s Deploy environment on the engineer kanban.

Hardens the sync-docs upstream fetch step so failures are actionable instead of a single gh: Not Found. It now tries every configured source (process substitution keeps the loop in the main shell), records per-repo errors, removes partial cache files, and still exits non-zero if anything failed. When SOURCE_REPOS_TOKEN is missing, it emits a workflow error that explains the private tracebloc-py-package source needs a fine-grained PAT with Contents read, without leaking secret values.

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

The sync has failed 13/13 runs, dying ~2s in with a bare 'gh: Not Found (HTTP
404)'. Root cause: SOURCE_REPOS_TOKEN is unset, so the fetch falls back to the
docs-scoped GITHUB_TOKEN, which 404s on the first PRIVATE source
(tracebloc-py-package). 'jq | while' ran in a subshell and 'set -e' killed it on
the first source, hiding the other four and the reason.

Harden the fetch step:
- process substitution instead of 'jq | while', so the loop runs in this shell
- fetch every source and collect failures instead of dying on the first
- on failure, emit '::error::' naming the repo and the gh message; drop the
  truncated cache file so a partial file is never synced
- when SOURCE_REPOS_TOKEN is unset, print the exact fix: create a fine-grained
  PAT with Contents:read on the private source repo(s) and add it as
  SOURCE_REPOS_TOKEN

Still fails closed until the token exists (a private source must sync), but now
says precisely why and which token. Verified the loop with a stubbed gh: public
sources cache, the private one reports a named error, exit 1 with guidance.

The token itself must be created by an admin — that is the actual unblock.
Refs RFC-BACKEND-0008 D21, tracebloc/backend#1279.
@LukasWodka LukasWodka self-assigned this Jul 26, 2026
@LukasWodka

Copy link
Copy Markdown
Contributor Author

👋 Heads-up — Code review queue is at 40 / 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.)

@mintlify

mintlify Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
tracebloc 🟢 Ready View Preview Jul 26, 2026, 2:10 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

docs had no advance-deploy-env caller, so its kanban items never advanced to Prod
when code shipped to main — feature tickets stranded. Adds the standard
push-triggered caller the other repos have, so shipping auto-advances tickets.

RFC-BACKEND-0008 board automation.
@mintlify

mintlify Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
tracebloc 🟡 Building Jul 26, 2026, 2:10 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to 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.

1 participant