Skip to content

[wrangler] Disable flagship OAuth scopes not yet valid in backend#13453

Merged
jamesopstad merged 2 commits intomainfrom
pbacondarwin/disable-flagship-oauth-scopes
Apr 13, 2026
Merged

[wrangler] Disable flagship OAuth scopes not yet valid in backend#13453
jamesopstad merged 2 commits intomainfrom
pbacondarwin/disable-flagship-oauth-scopes

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Apr 13, 2026

The flagship:read and flagship:write OAuth scopes are not yet recognized by the Cloudflare backend. This temporarily comments them out from the default scopes requested during wrangler login to prevent issues.

They can be re-enabled once the backend supports them.


  • Tests

    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: this only comments out two scope entries that are not yet functional
  • Public documentation

    • Cloudflare docs PR(s):
    • Documentation not necessary because: no user-facing docs change needed

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 13, 2026

🦋 Changeset detected

Latest commit: 52bd1e5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 13, 2026
@workers-devprod workers-devprod requested review from a team and NuroDev and removed request for a team April 13, 2026 13:26
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 13, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@emily-shen
Copy link
Copy Markdown
Contributor

there will be test snapshots to update though i think

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

✅ All changesets look good

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

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

The scopes are correctly removed from DefaultScopes, but the inline test snapshots in three test files still reference flagship:read and flagship:write. These tests will fail because the generated OAuth URL will no longer contain those scopes.

Affected files:

  • packages/wrangler/src/__tests__/user.test.ts — 6 snapshot URLs containing flagship%3Aread%20flagship%3Awrite
  • packages/wrangler/src/__tests__/whoami.test.ts — 6 scope list entries containing flagship:read / flagship:write
  • packages/wrangler/src/__tests__/deploy/core.test.ts — 2 snapshot URLs containing flagship%3Aread%20flagship%3Awrite

You'll need to update these inline snapshots (easiest via pnpm --filter wrangler test:ci -u or by manually removing the flagship scope fragments).

"flagship:read": "See Flagship feature flags and apps",
"flagship:write": "See and change Flagship feature flags and apps",
// "flagship:read": "See Flagship feature flags and apps",
// "flagship:write": "See and change Flagship feature flags and apps",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commenting these out is fine as a quick disable, but the inline snapshots in user.test.ts (6 occurrences), whoami.test.ts (6 occurrences), and deploy/core.test.ts (2 occurrences) all still contain flagship:read / flagship:write in their expected output. This will cause test failures.

Please update the snapshots to remove the flagship scope references (e.g. run pnpm --filter wrangler test:ci -u).

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 13, 2026
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Apr 13, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR comments out the flagship:read and flagship:write OAuth scopes from the default login scopes since the Cloudflare backend doesn't recognize them yet.

Issue found:

  1. Test snapshots not updated (will cause CI failures) — There are 14 inline snapshot references to flagship:read/flagship:write across three test files (user.test.ts, whoami.test.ts, deploy/core.test.ts) that still expect these scopes in the OAuth URL / scope list output. Since the scopes are now removed from DefaultScopes, the actual output will no longer include them, and these tests will fail.

I've posted the review with details on PR #13453.

github run

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13453

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13453

miniflare

npm i https://pkg.pr.new/miniflare@13453

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13453

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13453

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13453

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13453

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13453

wrangler

npm i https://pkg.pr.new/wrangler@13453

commit: 52bd1e5

@jamesopstad jamesopstad merged commit 6b11b07 into main Apr 13, 2026
49 checks passed
@jamesopstad jamesopstad deleted the pbacondarwin/disable-flagship-oauth-scopes branch April 13, 2026 13:56
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants