renovate/lib/modules/manager/cargo
Risu 397ab49ef3
docs(managers): add missing url and displayName (#32621)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2024-12-01 08:47:27 +00:00
..
__fixtures__ feat(manager/cargo): Changes to support cargo repository source replacement (#28759) 2024-05-01 04:39:16 +00:00
__snapshots__ refactor(manager/cargo): use `zod` to parse manifest/config (#31260) 2024-10-29 06:19:33 +00:00
artifacts.spec.ts fix(cargo): Revert "fix(cargo): Only use `cargo update --precise` in case of lockfile updates" (#31332) 2024-09-11 11:56:17 +00:00
artifacts.ts fix(cargo): Revert "fix(cargo): Only use `cargo update --precise` in case of lockfile updates" (#31332) 2024-09-11 11:56:17 +00:00
extract.spec.ts feat(manager/cargo): support reading package version from workspace (local only) (#32533) 2024-11-14 09:54:13 +00:00
extract.ts feat(manager/cargo): support reading package version from workspace (local only) (#32533) 2024-11-14 09:54:13 +00:00
index.ts docs(managers): add missing url and displayName (#32621) 2024-12-01 08:47:27 +00:00
locked-version.spec.ts feat(cargo): support range=update-lockfile (#25983) 2023-12-05 16:25:31 +00:00
locked-version.ts chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
range.spec.ts fix(cargo): default auto to update-lockfile (#28826) 2024-05-04 12:23:07 +00:00
range.ts fix(cargo): default auto to update-lockfile (#28826) 2024-05-04 12:23:07 +00:00
readme.md fix(cargo): default auto to update-lockfile (#28826) 2024-05-04 12:23:07 +00:00
schema.ts feat(manager/cargo): support reading package version from workspace (local only) (#32533) 2024-11-14 09:54:13 +00:00
types.ts refactor(manager/cargo): use `zod` to parse manifest/config (#31260) 2024-10-29 06:19:33 +00:00
update-locked.spec.ts chore: fix typos in test descriptions (#29011) 2024-05-12 07:00:23 +00:00
update-locked.ts feat(cargo): support range=update-lockfile (#25983) 2023-12-05 16:25:31 +00:00
update.spec.ts feat(manager/cargo): add support for `bumpVersion` option (#26884) 2024-01-29 09:00:54 +00:00
update.ts chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
utils.ts feat(manager/cargo): support for cargo repository source replacement (#23956) 2023-08-25 09:41:15 +00:00

readme.md

Extracts dependencies from Cargo.toml files, and also updates Cargo.lock files too if found.

When using the default rangeStrategy=auto:

  • If a "less than" instruction is found (e.g. <2) then rangeStrategy=widen will be selected,
  • Otherwise, rangeStrategy=update-lockfile will be selected.

The update-lockfile default means that most upgrades will update Cargo.lock files without the need to change the value in Cargo.toml.

Private Modules Authentication

Before running the cargo commands to update the cargo.lock, Renovate exports git insteadOf directives in environment variables.

Renovate uses this logic before it updates any "artifacts":

The token from the hostRules entry matching hostType=github and matchHost=api.github.com is added as the default authentication for github.com. For those running against github.com, this token will be the default platform token.

Next, all hostRules with both a token or username/password and matchHost will be fetched, except for any github.com one from above.

Rules from this list are converted to environment variable directives if they match any of these characteristics:

  • No hostType is defined, or
  • hostType is cargo, or
  • hostType is a platform (github, gitlab, azure, etc.)