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: don't attempt to login during a --dryRun #1037

Merged
merged 4 commits into from
May 17, 2022
Merged

Conversation

rozenmd
Copy link
Contributor

@rozenmd rozenmd commented May 17, 2022

Closes #1023

//TODO:

  • Update tests to ensure dry-run works even without an account

@changeset-bot
Copy link

changeset-bot bot commented May 17, 2022

🦋 Changeset detected

Latest commit: 70ee2ab

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2022

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2338904953/npm-package-wrangler-1037

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1037/npm-package-wrangler-1037

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2338904953/npm-package-wrangler-1037 dev path/to/script.js

@@ -1256,7 +1256,7 @@ export async function main(argv: string[]): Promise<void> {
);
}

const accountId = await requireAuth(config);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@threepointone Is it an issue that during --dry-run, accountId won't be set even if you're logged in? We're not like generating a manifest with accountIds/paths that rely on accountId being set?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well we want zero requests during dry run, so maybe it's good that we enforce it doubly here. We'll want to generate a manifest, but we probably won't include account id in it (yet).

@rozenmd rozenmd marked this pull request as ready for review May 17, 2022 10:24
Copy link
Contributor

@threepointone threepointone 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!

@petebacondarwin
Copy link
Contributor

FWIW I think there is potential for there to be two kinds of "dry-run". One is what we are implementing here, which is where we promise never to make any network requests at all. The other is where we promise not to do any network requests that are not readonly. The latter could be useful since we could literally "dry-run" every aspect of the logic, including doing verifications that require API interactions, such as listing off which assets would need uploading.

@rozenmd rozenmd merged commit 963e9e0 into main May 17, 2022
@rozenmd rozenmd deleted the dont-login-during-dryrun branch May 17, 2022 13:26
@github-actions github-actions bot mentioned this pull request May 17, 2022
JacobMGEvans pushed a commit that referenced this pull request May 17, 2022
* fix: don't attempt to login during a --dryRun

* Create wild-seas-breathe.md

* chore: update test to explicitly set CLOUDFLARE_ACCOUNT_ID to an empty string
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.

🐛 BUG: Running wrangler with --dry-run shouldn't try log me in
3 participants