fix(renovate): declare the cargo credential provider for the private registry#165
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Suite de #164. Le registre est désormais résolu (
Updating 'kellnr' indexdans les logs, plus aucunregistry index was not found), maiscargo updateéchoue maintenant plus loin, sur une erreur distincte :Cause
api/.cargo/config.tomldes repos consommateurs contient deux morceaux :Renovate invoque cargo depuis la racine du repo, où ce fichier n'est pas découvert : cargo cherche
.cargo/config.tomlen remontant depuis le cwd, pas depuis--manifest-path. Les deux moitiés doivent donc être répliquées ; #164 n'en a répliqué qu'une.Le piège est que
global-credential-providersne fait que redire le défaut de cargo — mais s'appuyer sur le défaut n'équivaut pas à le déclarer (src/cargo/util/auth/mod.rs) :Pour un registre
auth-required, cargo exige que le provider soit déclaré explicitement, et échoue sinon — même avec un token parfaitement valide. C'est un garde-fou délibéré, pas un bug.Correctif
Ajout de
CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS: "cargo:token"àcustomEnvVariables.Vérifié dans le code plutôt que dans la doc (qui ne précise pas le format des tableaux via env) :
get_env_listdanssrc/cargo/util/context/mod.rsfaitenv_val.split_whitespace(), donc"cargo:token"donne bien["cargo:token"]. Le mapping clé → variable (registry.global-credential-providers→CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS) suit la règle documentée : majuscules, points et tirets en underscores.Validé en local : YAML parsé, JSON valide après interpolation du secret, valeurs identiques à
api/.cargo/config.toml.À confirmer après merge
Aucun check CI ne couvre ceci. Critère de succès sur un run réel : plus aucune
artifactErrorscargo. Si le token lui-même pose problème, l'erreur suivante sera un 401/403 — l'auth n'ayant encore jamais abouti jusqu'ici.