-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add an option for disabling the requirement to verify email before publishing #3048
Conversation
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
☔ 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:
|
d57e641
to
b90a62b
Compare
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.
b90a62b
to
82b3aad
Compare
☔ The latest upstream changes (presumably #3391) made this pull request unmergeable. Please resolve the merge conflicts. |
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.