Skip to content
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: Rust private registry authentication documentation #32393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

i10416
Copy link
Contributor

@i10416 i10416 commented Nov 7, 2024

Changes

Documentation for Rust private crate authentication

This won't change renovate behavior.

Context

  • hostType should be either platform or datasource. For Rust crate, datasource is not cargo, but crate
  • registryUrls in packageRules for private crate registry require sparse+ prefix.

hostType is another way to filter rules and can be either a platform such as github and bitbucket-server, or it can be a datasource such as docker and rubygems.
https://docs.renovatebot.com/configuration-options/

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

- hostType should be either platform or datasource. For Rust crate, datasource is not `cargo`, but `crate`
- registryUrls in packageRules for private crate registry require `sparse+` prefix.
@i10416 i10416 changed the title Update rust.md fix: Rust private registry authentication documentation Nov 7, 2024
{
matchPackageNames: ["<your package name>"],
registryUrls: [
"sparse+https://<your domain>-012345678901.d.codeartifact.<aws region>.amazonaws.com/cargo/<your repository>/"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm really surprised if this works

Copy link
Contributor Author

@i10416 i10416 Nov 13, 2024

Choose a reason for hiding this comment

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

Thank you for review and sorry for the late response.

Without sparse+ prefix, renovate fails to fetch dependencies trying to run git clone against AWS CodeArtifact, which is not git repository but crates.io compatible registry.
With sparse+, the error from git clone disappears.

Without sparse+ prefix, I guess the program falls into this clause, which causes renovate to invoke git clone.

if (registry.flavor !== 'crates.io' && !registry.isSparse) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, as I haven't looked into renovate codebase that deep, I may be wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case please provide a reproduction repo using this format so we can test. It can be a dummy codeartifact URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants