-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 print _TOKEN suggestion when not applicable #12644
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cargo should not suggest the _TOKEN environment variable when the cargo:token provider isn't available
arlosi
added
the
A-credential-provider
Area: credential provider for storing and retreiving credentials
label
Sep 8, 2023
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
rustbot
added
A-registries
Area: registries
A-registry-authentication
Area: registry authentication and authorization (authn authz)
A-sparse-registry
Area: http sparse registries
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 8, 2023
weihanglo
approved these changes
Sep 8, 2023
Thanks! @bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 8, 2023
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 9, 2023
Update cargo 14 commits in d14c85f4e6e7671673b1a1bc87231ff7164761e1..2fc85d15a542bfb610aff7682073412cf635352f 2023-09-05 22:28:10 +0000 to 2023-09-09 01:49:46 +0000 - feat: Stabilize lints (rust-lang/cargo#12648) - Ues strip_prefix for cleaner code (rust-lang/cargo#12631) - fix: don't print _TOKEN suggestion when not applicable (rust-lang/cargo#12644) - Bump cargo-credential-1password to v0.4.0 (rust-lang/cargo#12641) - refactor: put `Source` trait under `cargo::sources` (rust-lang/cargo#12527) - Error out if `cargo clean --doc` is mixed with `-p`. (rust-lang/cargo#12637) - Add wrappers around std::fs::metadata (rust-lang/cargo#12636) - Add with_stdout_unordered. (rust-lang/cargo#12635) - Fix example for creating a git project test. (rust-lang/cargo#12632) - Read/write the encoded `cargo update --precise` in the same place (rust-lang/cargo#12629) - docs(guide): Apply feedback on CI (rust-lang/cargo#12630) - fix: improve warning for both token & credential-provider (rust-lang/cargo#12626) - Skip clean up `profile.release.package."*"` (rust-lang/cargo#12624) - Add MSRV validation GitHub Action for cargo-credential (rust-lang/cargo#12623)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-credential-provider
Area: credential provider for storing and retreiving credentials
A-registries
Area: registries
A-registry-authentication
Area: registry authentication and authorization (authn authz)
A-sparse-registry
Area: http sparse registries
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
When a registry token cannot be found, or a token is invalid, cargo displays an error recommending either
cargo login
or the appropriate environment variable.For example:
With
-Z credential-process
, ifcargo:token
is not inregistry.global-credential-providers
orregistries.<NAME>.credential-provider
the suggested environment variable will not work.Fixes #12642 by not including the
_TOKEN
environment variable ifcargo:token
is not enabled as a credential provider.How should we test and review this PR?
Two tests
not_found
andall_not_found
cover this case by having a registry-specific and global credential providers respectively that returnnot-found
.Other tests that emit this error are not affected, since they still have the
cargo:token
provider available.