Skip to content

feat(datasource/dotnet-version): support custom registry URLs - #45454

Open
MLuc24 wants to merge 2 commits into
renovatebot:mainfrom
MLuc24:feat/dotnet-version-custom-registry
Open

feat(datasource/dotnet-version): support custom registry URLs#45454
MLuc24 wants to merge 2 commits into
renovatebot:mainfrom
MLuc24:feat/dotnet-version-custom-registry

Conversation

@MLuc24

@MLuc24 MLuc24 commented Aug 25, 2026

Copy link
Copy Markdown

Changes

DotnetVersionDatasource read its releases index from this.defaultRegistryUrls[0] instead of the registryUrl it was handed, so a configured registry was accepted by config and then ignored. It now uses the URL it is passed, and customRegistrySupport is true.

Two things came with that:

  • The cache key gains the registry URL. It was config.packageName alone, which was correct while every lookup hit the same index, but once a registry can be configured two of them would share one entry and one registry's releases could be served for another. It is now ${registryUrl}:${packageName}, matching what node-version and rust-version already do. This invalidates existing entries once.
  • The readme says what a custom registry means here. Unlike most datasources the default is a full file URL, not a host, so registryUrls is the URL of a mirrored releases-index.json. The channel files are then fetched from the URLs listed inside that index, so a mirror needs to point at its own copies — worth stating rather than leaving people to infer it.

The missing-registryUrl branch is unreachable in practice, since config fills it from defaultRegistryUrls; it carries the /* v8 ignore next */ comment the other datasources use for the same guard.

Context

Please select one of the following:

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

The code, the test and this description were written by Claude Opus 5 running in Claude Code, directed by @MLuc24. The shape follows the existing node-version and rust-version datasources rather than being invented: the guard idiom, the v8 ignore comment and the registry-scoped cache key are all copied from them. The new test was run against unpatched main first to confirm it fails there.

Use of AI in replying to PR comments

Who answers review comments:

  • @username will read and reply directly. Name the account.
  • An agent will draft replies and @MLuc24 will read them before they are posted. Name the account.
  • Nobody has explicitly committed to replying.

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

fetches the index from a configured registry mocks a mirror serving both the index and the channel file it points at, and asserts the releases come back. Because httpMock fails on any unmocked request, the test only passes if the mirror — and not the default host — was the one that got called.

On main, with only the test applied, it fails:

× fetches the index from a configured registry
AssertionError: expected undefined to be 'https://github.com/dotnet/sdk'
GET https://example.com/foo/bar/fail 404

With the change: Tests 10 passed (10).

Also run on the changed files: oxlint, biome check, prettier --check, and tsc --noEmit — all clean.

I did not run this against a real repository: it would need a self-hosted mirror of the .NET release metadata to exercise the path that actually changed.

MLuc24 added 2 commits August 25, 2026 22:05
The datasource read its releases index from `this.defaultRegistryUrls[0]`
rather than the `registryUrl` it was given, so a configured registry was
accepted and then ignored. It now uses the URL it is passed, and
`customRegistrySupport` is enabled.

The cache key gains the registry URL. It was keyed on the package name alone,
which was fine while every lookup hit the same index but would serve one
registry's releases for another once a registry can be configured.
Copilot AI lite review requested due to automatic review settings August 25, 2026 15:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions
github-actions Bot requested a review from viceice August 25, 2026 15:07
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.

datasource/dotnet-version: add customRegistrySupport

2 participants