Skip to content
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

fix: respect CLOUDLFARE_ACCOUNT_ID with wrangler pages project #6927

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

emily-shen
Copy link
Contributor

@emily-shen emily-shen commented Oct 8, 2024

What this PR solves / how to test

Fixes #4947
Previously pages project commands were always using cached accound id values, regardless of what was passed in as an env variable.

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: unit tests should be adequate
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Changeset included
    • Changeset not necessary because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix

@emily-shen emily-shen requested review from a team as code owners October 8, 2024 13:15
Copy link

changeset-bot bot commented Oct 8, 2024

🦋 Changeset detected

Latest commit: 3eaf77e

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

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers Patch

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

@emily-shen emily-shen changed the title let account id env override pages cache fix: respect CLOUDLFARE_ACCOUNT_ID with wrangler pages project Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-wrangler-6927

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6927/npm-package-wrangler-6927

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-wrangler-6927 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-create-cloudflare-6927 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-cloudflare-kv-asset-handler-6927
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-miniflare-6927
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-cloudflare-pages-shared-6927
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-cloudflare-vitest-pool-workers-6927
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-cloudflare-workers-editor-shared-6927
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11275721038/npm-package-cloudflare-workers-shared-6927

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.80.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240925.1
workerd 1.20240925.0 1.20240925.0
workerd --version 1.20240925.0 2024-09-25

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@emily-shen emily-shen force-pushed the emily/fix-pages-env-account-id branch from 6461d3a to 9485b51 Compare October 9, 2024 08:59
Copy link
Contributor

@andyjessop andyjessop left a comment

Choose a reason for hiding this comment

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

Looks good! Just one minor comment.

packages/wrangler/src/pages/projects.tsx Show resolved Hide resolved
@emily-shen emily-shen merged commit 2af75ed into main Oct 10, 2024
20 checks passed
@emily-shen emily-shen deleted the emily/fix-pages-env-account-id branch October 10, 2024 14:26
@jdanyow
Copy link

jdanyow commented Oct 10, 2024

@emily-shen this may have broken something, after upgrading I always see this message even though I do have account_id specified in my wrangler.toml file.

✘ [ERROR] More than one account available but unable to select one in non-interactive mode.

  Please set the appropriate `account_id` in your `wrangler.toml` file.
  Available accounts are (`<name>`: `<account_id>`):
     ...redacted...

When I downgrade to 3.79.0 the error goes away.

@emily-shen
Copy link
Contributor Author

emily-shen commented Oct 10, 2024

oh no! does 3.80.2 also fix it? In the meantime, you can pass in the desired account id via CLOUDFLARE_ACCOUNT_ID - sorry about the inconvenience!

@emily-shen
Copy link
Contributor Author

Actually account_id isn't available for pages projects, which suggests you have a Workers project, so I don't think this PR is the cause. Can you share what command you're running so I can help debug? thanks!

@jdanyow
Copy link

jdanyow commented Oct 11, 2024

my bad, you're right, it was this commit:

3fa846ec2

I'm currently on 3.79.0... if I upgrade wrangler to 0.0.0-3fa846ec2 I start seeing the error.

I'm running the following command:

wrangler dev --remote --config wrangler-site.toml --env local --test-scheduled --var GIT_HASH:$(git rev-parse HEAD) --var RELEASE_DATE:$(date -Iseconds)

And my wrangler-site.toml has an account_id configured.

@jdanyow
Copy link

jdanyow commented Oct 11, 2024

apologies for the false alarm - tracking my issue in #6947

@emily-shen
Copy link
Contributor Author

No worries, thanks for tracking down the issue! We'll look into it asap :)

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.

🐛 BUG: wrangler pages project create does not respect CLOUDFLARE_ACCOUNT_ID
3 participants