feat(datasource/dotnet-version): support custom registry URLs - #45454
Open
MLuc24 wants to merge 2 commits into
Open
feat(datasource/dotnet-version): support custom registry URLs#45454MLuc24 wants to merge 2 commits into
MLuc24 wants to merge 2 commits into
Conversation
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.
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.
Changes
DotnetVersionDatasourceread its releases index fromthis.defaultRegistryUrls[0]instead of theregistryUrlit was handed, so a configured registry was accepted by config and then ignored. It now uses the URL it is passed, andcustomRegistrySupportistrue.Two things came with that:
config.packageNamealone, 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 whatnode-versionandrust-versionalready do. This invalidates existing entries once.registryUrlsis the URL of a mirroredreleases-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-
registryUrlbranch is unreachable in practice, since config fills it fromdefaultRegistryUrls; 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?
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-versionandrust-versiondatasources rather than being invented: the guard idiom, thev8 ignorecomment and the registry-scoped cache key are all copied from them. The new test was run against unpatchedmainfirst to confirm it fails there.Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
fetches the index from a configured registrymocks a mirror serving both the index and the channel file it points at, and asserts the releases come back. BecausehttpMockfails 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:With the change:
Tests 10 passed (10).Also run on the changed files:
oxlint,biome check,prettier --check, andtsc --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.