Skip to content

Add an option for disabling the requirement to verify email before publishing #3048

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

Closed

Conversation

JWorthe
Copy link

@JWorthe JWorthe commented Nov 27, 2020

Needing to verify your email before publishing can be a pain while running crates.io locally during development.

This PR adds a new environment variable to the config flag, DISABLE_EMAIL_VERIFICATION_REQUIREMENT. If this is set, then you can publish a crate even if your email has not been verified.

I've also updated the "contributing" docs around "Publishing a crate to your local crates.io", both to mention the email verification that you need to do, and how to disable it with the new flag.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jtgeibel (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -150,6 +154,10 @@ pub(crate) fn domain_name() -> String {
dotenv::var("DOMAIN_NAME").unwrap_or_else(|_| "crates.io".into())
}

fn require_email_verification() -> bool {
dotenv::var("DISABLE_EMAIL_VERIFICATION_REQUIREMENT").is_err()
Copy link
Member

Choose a reason for hiding this comment

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

if one had DISABLE_EMAIL_VERIFICATION_REQUIREMENT=0, won't this give a surprising result

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it would be surprising, but I think consistency with the other fields in the config is more important. There are a few others that follow this same pattern in this config, where it's just checking set or unset. For example, MIRROR and HEROKU.

@bors
Copy link
Contributor

bors commented Dec 2, 2020

☔ The latest upstream changes (presumably #3062) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@JWorthe JWorthe force-pushed the email-verification-check branch from d57e641 to b90a62b Compare December 3, 2020 10:32
Copy link
Member

@carols10cents carols10cents left a comment

Choose a reason for hiding this comment

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

Could we not require any email instead?

app.config.domain_name,
))
})?
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I think what I would expect is that if DISABLE_EMAIL_VERIFICATION_REQUIREMENT is set, then we don't need to require the user to set any email.. that is, this else block shouldn't exist.

@bors
Copy link
Contributor

bors commented Mar 10, 2021

☔ The latest upstream changes (presumably #3391) made this pull request unmergeable. Please resolve the merge conflicts.

@JWorthe JWorthe closed this Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants