Skip to content

ci(stlc): stop the seal step opening no-op PRs - #7

Merged
ladyofcode merged 2 commits into
mainfrom
fix/stlc-seal-churn
Sep 7, 2026
Merged

ci(stlc): stop the seal step opening no-op PRs#7
ladyofcode merged 2 commits into
mainfrom
fix/stlc-seal-churn

Conversation

@ladyofcode

@ladyofcode ladyofcode commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

stlc build writes a fresh empty seal commit into each staging SDK repo on every run. Its SHA lands in stainless/custom-code/*.json as base (and sometimes integrated), so the tracking files come back dirty on every run even when the generated code is byte-identical.

Every seal commit since 2026-08-24 has files=0 and an identical tree:

python-staging:
707a1c501a  2026-09-07  tree=e47029ff80  parent=7b1a0b41b0  files=0  seal
9bd01165f0  2026-09-06  tree=e47029ff80  parent=7b1a0b41b0  files=0  seal
7b1a0b41b0  2026-09-04  tree=e47029ff80  parent=fd89d00f47  files=0  seal
fd89d00f47  2026-08-31  tree=e47029ff80  parent=97b45ac068  files=0  seal
97b45ac068  2026-08-24  tree=e47029ff80  parent=81870b095a  files=4  seal

Note 9bd01165 and 707a1c50 share a parent — they are siblings, not a chain. Each run builds a throwaway empty commit and abandons the previous one. TypeScript is the same: one tree, d7d81c1d43, unchanged since 2026-08-31.

Because allow_auto_merge is false on this repo, gh pr merge --auto fails and only emits a ::warning::. PR #6 therefore sat open from 2026-09-04, and the 6-hourly cron force-pushed a new head onto it four times a day — mailing every repo watcher each time.

Fix

Churn guard in the seal step. Before committing, resolve each changed base/integrated SHA to the tree it points at and skip the seal when no tree moved. It fails safe in every direction — a new or deleted file, a change to a non-SHA field, or a commit the API cannot resolve all count as a real change — so it can only ever suppress verified churn.

Cron cut from every 6h to daily. It is only a backstop for a missed repository_dispatch: seal-custom-code, which already fires eagerly when an SDK repo seals custom code.

Verification

Guard body run against live repo data:

Scenario Result
Real churn (main 7b1a0b41 → seal 707a1c50) skipped, no PR, worktree restored
base → commit with a genuinely different tree opens PR
Non-SHA field (branch) changed opens PR
Unresolvable SHA opens PR
New untracked tracking file opens PR
Churn in one file + real change in the other opens PR

On the real case:

...python...json: base 7b1a0b41... -> 707a1c50..., but tree e47029ff80... is unchanged — SHA churn.
...typescript...json: base 34cce754... -> ffa49458..., but tree d7d81c1d43... is unchanged — SHA churn.
...typescript...json: integrated 7fece6a5... -> 8bd8ca32..., but tree 9b5380dc9c... is unchanged — SHA churn.
Every tracking-file change is empty-seal SHA churn — discarding, no PR.

That third line is worth noting: even the Build SDK commits on staging main are content-free.

YAML parses and every run: block passes bash -n.

Merging policy

Seal PRs are deliberately not auto-merged. With the churn guard in place a seal PR only appears when custom code genuinely moved, which warrants a human look. The gh pr merge --auto attempt is dropped — it never worked here anyway, since allow_auto_merge is false on this repo, so it only ever emitted a warning. The step now surfaces the waiting PR by number instead:

::warning title=Seal PR awaiting review::Custom code genuinely changed — review and merge isaacus-dev/openapi#N.

allow_auto_merge stays off.

🤖 Generated with Claude Code

ladyofcode and others added 2 commits September 7, 2026 22:26
`stlc build` writes a fresh empty `seal` commit into each staging SDK repo
on every run. Its SHA lands in `stainless/custom-code/*.json` as `base`
(and sometimes `integrated`), so the tracking files came back dirty on
every run even though the generated code was byte-identical — every seal
commit since 2026-08-24 has `files=0` and the same tree (`e47029ff80` for
python, `d7d81c1d43` for typescript).

With auto-merge disabled on this repo, `gh pr merge --auto` fails and only
warns, so PR #6 sat open from 2026-09-04 and the 6-hourly cron force-pushed
a new head onto it four times a day, mailing every repo watcher each time.

Resolve each changed SHA to the tree it points at and skip the seal when no
tree actually moved. Anything unresolvable — a new or deleted file, a change
to a non-SHA field, a commit the API cannot return — is treated as a real
change, so the guard can only ever suppress verified churn.

Also cut the cron from every 6h to daily; it is only a backstop for a missed
`repository_dispatch: seal-custom-code`, which already fires eagerly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
With the churn guard in place a seal PR only appears when custom code
genuinely moved, so it warrants review rather than an automatic squash.
Drop the `gh pr merge --auto` attempt (which never worked here anyway —
`allow_auto_merge` is false on this repo, so it only ever emitted a
warning) and surface the waiting PR by number instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

✱ stlc build

python code · compare

Your SDK build was successful.

generate ✅bootstrap ✅format ✅lint ✅

136 files generated at a2cbade (pushed)

typescript code · compare

Your SDK build was successful.

generate ✅bootstrap ✅format ✅build ✅lint ✅

149 files generated at bd49e8a (pushed)

Diagnostics: ⚠️ 2 warning, 💡 1 note
LevelCodeMessageTargets
⚠️ warningPython/PublishingWithoutOIDCPublishing security issue: trusted publishing with OIDC is not enabled.
#/targets/python/publish/pypi
python
⚠️ warningTypeScript/PublishingWithoutOIDCPublishing security issue: trusted publishing with OIDC is not enabled.
#/targets/typescript/publish/npm
typescript
💡 noteReadmeExample/UnknownResponsePropertyResponse property `chunking_options` is not defined on the response for method `create`.
(resource) classifications.universal > (method) create
python
Build metadata
Buildbd_76JPXHrs-crisp-pouch
Timestamp2026-09-07T21:31:14.953Z
stlc20323f6
Spec hash155f43207a56
Config hashb715dd754785

This comment is auto-generated by stlc and is kept up to date as you push.
If you push new commits, re-run this workflow to update this comment.
Last updated: 2026-09-07 21:33:00 UTC

@ladyofcode
ladyofcode merged commit f606026 into main Sep 7, 2026
4 checks passed
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