Repository navigation
ci(repo): run this repository on the one-repo topology #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,20 +5,21 @@ name: Seal custom code (dispatch) | |
| # When genuine out-of-band custom code is merged to this SDK repo's `main` | ||
| # (a direct staging commit, or a contribution pulled back from production), | ||
| # notify the config repo to reseal so the custom-code tracking JSON absorbs it | ||
| # promptly instead of waiting for the config repo's poll. stlc-authored commits | ||
| # promptly instead of waiting for the config repo's poll. generator-authored commits | ||
| # are skipped by the loop guards below, so the bot's own pushes (the "Build SDK" | ||
| # squash commit and any regen commit) cannot trigger a reseal loop. | ||
| # | ||
| # This workflow is itself custom code on the SDK repo: seal it once with | ||
| # `stlc build --commit` to bootstrap, after which scaffold preservation keeps it | ||
| # the generator's commit step to bootstrap, after which scaffold preservation keeps it | ||
| # across regenerations. If you would rather keep things simple, drop this file | ||
| # and rely on the config repo's scheduled `stlc-sync-tracking.yml` poll alone. | ||
| # and rely on the config repo's scheduled tracking-sync poll alone. | ||
| # | ||
| # Lives in the STAGING repo. Requires CONFIG_DISPATCH_TOKEN — a token that can | ||
| # Requires the GitHub App secrets (SDK_APP_ID, SDK_APP_PRIVATE_KEY) or, as a | ||
| # fallback, CONFIG_DISPATCH_TOKEN — a token that can | ||
| # send a repository_dispatch to the config repo. | ||
| on: | ||
| push: | ||
| # main only. stlc preview/integrated/codegen branches never push to main. | ||
| # main only. the generator's preview, integrated and codegen branches never push to main. | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
|
|
@@ -31,21 +32,32 @@ permissions: | |
| jobs: | ||
| dispatch: | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'sentdm/sent-dm-python-staging' | ||
| if: github.repository == 'sentdm/sent-dm-python' | ||
| env: | ||
| CONFIG_REPO: sentdm/sent-dm-sdk-pipeline | ||
| HAS_APP: ${{ secrets.SDK_APP_ID != '' && secrets.SDK_APP_PRIVATE_KEY != '' }} | ||
| steps: | ||
| - name: Mint a pipeline token from the GitHub App | ||
| id: app | ||
| if: env.HAS_APP == 'true' | ||
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v3.3.0 | ||
| with: | ||
| app-id: ${{ secrets.SDK_APP_ID }} | ||
| private-key: ${{ secrets.SDK_APP_PRIVATE_KEY }} | ||
| owner: sentdm | ||
| repositories: sent-dm-sdk-pipeline | ||
|
|
||
| - name: Loop-guard and send reseal dispatch | ||
| env: | ||
| DISPATCH_TOKEN: ${{ secrets.CONFIG_DISPATCH_TOKEN }} | ||
| DISPATCH_TOKEN: ${{ steps.app.outputs.token || secrets.CONFIG_DISPATCH_TOKEN }} | ||
|
Comment on lines
+40
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 (optional) If minting the App token fails, the reseal dispatch is never sent, even when CONFIG_DISPATCH_TOKEN is set as the documented fallback. The mint step at :40-48 runs whenever both App secrets are non-empty. When it errors (App not installed on the target repo, bad key), the job stops before the fallback at :52 is tried. Fix: add Why this was flaggedTrigger: SDK_APP_ID and SDK_APP_PRIVATE_KEY are set, so HAS_APP at :38 is 'true', but actions/create-github-app-token fails. For example, the App is not installed on the target repository or lacks access. The step at .github/workflows/seal-dispatch.yml:40 has no continue-on-error, so the job fails there. The dispatch step with Verification: SDK_APP_ID and SDK_APP_PRIVATE_KEY are both set and CONFIG_DISPATCH_TOKEN is also set, but the App token mint fails. In .github/workflows/seal-dispatch.yml:40-48 the mint step has no |
||
| HEAD_MSG: ${{ github.event.head_commit.message }} | ||
| HEAD_AUTHOR_NAME: ${{ github.event.head_commit.author.name }} | ||
| SHA: ${{ github.sha }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # Loop guard 1: skip the stlc "Build SDK" squash commit (it carries | ||
| # Loop guard 1: skip the generator's "Build SDK" squash commit (it carries | ||
| # the Stainless-Generated-From trailer in its message). | ||
| if printf '%s' "$HEAD_MSG" | grep -q 'Stainless-Generated-From'; then | ||
| echo "Head commit is an stlc build — skipping reseal dispatch." | ||
|
Comment on lines
32
to
63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 (optional) Comments edited in this PR still name the generator, which breaks the CLAUDE.md rule "No provenance comments". That rule says to remove such comments from a block you are already editing. The rewording swapped "stlc" for "the generator" but did not drop the references. Fix: remove every comment and message in this file that names the generator or its tooling, which covers the 6 sites listed. Same pattern at 6 sites (seal-dispatch.yml:8, seal-dispatch.yml:13, seal-dispatch.yml:22, seal-dispatch.yml:60, seal-dispatch.yml:63, seal-dispatch.yml:67). Why this was flaggedCLAUDE.md says: "Don't add a comment that marks code as hand-written or names the generator, and remove one from a block you are already editing." REVIEW.md reports "A comment that ... names the generator" as Important. The diff rewrites lines 8, 13, 22 and 60 to "generator-authored commits", "the generator's commit step", "the generator's preview, integrated and codegen branches" and "the generator's "Build SDK" squash commit". All of them still name the generator. Line 63 still echoes "Head commit is an stlc build", and lines 67-69 still mention stlc-bot. These sit in hunks the PR edits, so the rule's remove-while-editing clause applies, and this public repo keeps carrying the provenance text. Verification: The diff rewrites comments at .github/workflows/seal-dispatch.yml lines 8, 13, 22 and 60, and each one still refers to the generator. The PR edits the |
||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 This public repository now names Sent's SDK pipeline repo in two places, and the PR adds the second one. CLAUDE.md forbids naming private repositories. The new
repositories: sent-dm-sdk-pipelineat :48 sits alongsideCONFIG_REPO: sentdm/sent-dm-sdk-pipelineat :37. The PR text also calls it the SDK pipeline. Fix: read the target from a repository variable or secret (for examplevars.CONFIG_REPO) and use it for both the env and the token'srepositoriesinput, so no private repo name stays in the file.Why this was flagged
CLAUDE.md says: "This repository is public. Nothing in it ... links to or names Sent's private repositories, internal systems or providers." REVIEW.md lists "A link to, or the name of, a private Sent repository ... anywhere in the diff" as Important. The added line 48 (
repositories: sent-dm-sdk-pipeline) and the context line 37 (CONFIG_REPO: sentdm/sent-dm-sdk-pipeline) both name the config/pipeline repo, which the PR description describes as Sent's internal SDK pipeline. The header comments also still mention staging and production repos (line 6). Before this PR the job only ran on the staging repo. Now the file is active in the public repo, and the PR adds another mention of the name.Verification: The PR adds
repositories: sent-dm-sdk-pipelineat .github/workflows/seal-dispatch.yml:48 as a+line of the diff. CLAUDE.md says: "This repository is public. Nothing in it ... links to or names Sent's private repositories, internal systems or providers." The same name already appears in the base at line 37 (CONFIG_REPO: sentdm/sent-dm-sdk-pipeline), so the leak itself predates this PR.