Skip to content

fix(ci): skip OpenAPI updates that leave generated output unchanged - #874

Open
cjol wants to merge 2 commits into
mainfrom
cjol/skip-noop-openapi-updates
Open

cjol wants to merge 2 commits into
mainfrom
cjol/skip-noop-openapi-updates

Conversation

@cjol

@cjol cjol commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Problem

The Update OpenAPI workflow opens a PR for every new cloudflare/api-schemas revision, even when pnpm generate changes nothing. Those PRs only move the pin and add a cf: minor changeset, so merging one would ship an empty minor release. #865 and #847 were both closed by hand for this reason.

Fix

After pnpm generate, scripts/update-openapi.ts lists the changed files. If the only changes are the packages/cli/package.json pin and the new changeset, it skips pnpm check, the commit, the push and the PR. It doesn't touch any PR that's already open.

Trade-off

The pin stays on the older revision until a schema change actually affects cf.

🤖 Generated with Claude Code

The updater opened PRs that only moved the pin and added a minor
changeset, which would ship an empty release. After generation, skip the
commit, push and PR when nothing else changed, and close any open managed
updater PR with an explanatory comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cjol
cjol requested a review from a team as a code owner December 1, 2026 17:19
@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@874

commit: 0ed31f9

@clanky-the-clanker clanky-the-clanker Bot 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.

Superseded by the review of 0ed31f9a.

This review, of 3fb0129c

💬 Approved with comments — The no-op detection and the close-with-comment path look correct and have tests. The only finding is an INFO: the docs overstate when an open updater PR gets closed.

Findings: 2 info (2 are inline comments on the diff)

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #874.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## INFO (2)

### [Documentation] README says any open updater PR is closed, but PRs with human edits or extra commits are left unchanged.
- **File:** scripts/README.md:21

### [Documentation] architecture.md says any open updater PR is closed; only an unedited, single-commit updater PR is closed.
- **File:** docs/architecture.md:997

📝 Documentation: 💬 2 info

The docs overstate when an open updater PR is closed.

Recommendation: 💬 Optional Nits

  • [INFO] README says any open updater PR is closed, but PRs with human edits or extra commits are left unchanged. (scripts/README.md:21)
  • [INFO] architecture.md says any open updater PR is closed; only an unedited, single-commit updater PR is closed. (docs/architecture.md:997)
View full review

scripts/README.md and docs/architecture.md both say that an unchanged revision closes any open updater PR. scripts/update-openapi.ts returns earlier, without touching the PR, when the PR is not a single updater-generated commit, so human-edited PRs are left open.


✅ All other checks passed

🔒 Security: ✅ LGTM

No security concerns in the updater changes.


📖 AGENTS.md: ✅ LGTM

No repository convention issues found.


📋 Code Quality: ✅ LGTM

changesGeneratedOutput uses git ls-files --modified --others --exclude-standard, and closePullRequest posts the optional comment before closing the PR. Both behave correctly, and both have focused tests. The close path runs only after the --check early return, and only behind the guard that leaves any PR that isn't a single updater commit alone.


⚡ Performance: ✅ LGTM

No performance concerns.


Reviewed commit: 3fb0129c

Comment thread scripts/README.md Resolved
Comment thread docs/architecture.md Resolved
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 236.6 ms 4.3 ms 226.2 ms 242.6 ms
base 235.5 ms 4.1 ms 228.8 ms 245.1 ms

Δ (PR vs base): ↑ +1.1 ms (+0.5%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

Only skip opening a PR when the generated output is unchanged; don't
close or comment on an existing updater PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@clanky-the-clanker clanky-the-clanker Bot 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.

✅ Approved — The no-op skip is placed correctly, has tests, and the docs match the code. No findings.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No security concerns in the updater changes.


📋 Code Quality: ✅ LGTM

The no-op check runs after pnpm generate and before pnpm check, the commit, the push and the PR. The --check early return and the paths for open PRs are unchanged.


📝 Documentation: ✅ LGTM

scripts/README.md and docs/architecture.md now say that a revision which leaves the generated output unchanged is skipped. This matches the code, which no longer closes open updater PRs.


Reviewed commit: 0ed31f9a

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

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