Use registry config for plugin repos and default module fallback#7180
Draft
jorgee wants to merge 3 commits into
Draft
Use registry config for plugin repos and default module fallback#7180jorgee wants to merge 3 commits into
jorgee wants to merge 3 commits into
Conversation
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Align module registry resolution with the plugin behaviour: the default Nextflow registry is always queried first, then the registries configured in the `registry` scope. Document the `registry` config scope and update the module/plugin registry guides accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: jorgee <jorge.ejarque@seqera.io>
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.
Related to #6771
Problem
indexUrl/NXF_PLUGINS_REGISTRY_URL). There was no way to declareadditional plugin registries.
registryconfig block defined a custom URL, the defaultNextflow registry was dropped from the resolution list entirely — the
user-defined list fully replaced it.
These two behaviours were inconsistent. This PR aligns them: the default
Nextflow registry is always queried first as the baseline, and the
registryconfig scope contributes additional registries that are queriedafterwards, in the order they are listed.
Summary
Wires the
registryconfig scope into plugin resolution and makes moduleresolution always query the default registry first.
Plugins (
nf-commons)PluginUpdater.addRegistryRepos(RegistryConfig)appends anHttpPluginRepositoryfor each URL in theregistryscope, after the primaryrepo (derived from
indexUrl/NXF_PLUGINS_REGISTRY_URL) and before thetest repos. URLs already present are skipped so the default isn't queried
twice; repo ids are generated as
registry-Nwith collision guard.PluginsFacade.load(config)extracts theregistryblock and callsaddRegistryReposon the existing updater (no updater recreation).HttpPluginRepository.refresh()is now null-safe — required becauseUpdateManager.addRepository()callsrefresh()immediately, beforeprefetch()has populated the metadata map.Modules (
nextflow)RegistryClientFactory.forConfig()always prepends the default registry(deduplicated), so it is queried first and a user-defined
registry.urlnolonger excludes the public registry. This matches the plugin ordering
(default primary, then configured registries). A
@TestOnly setDefaultRegistry()hook lets tests point the default away from the realregistry. Publishing is unaffected — it targets
registry.urlexplicitly.RegistryConfigitself is intentionally left unchanged — it stays a faithfulrepresentation of the user's config block. The default is injected only at the
module consumer (
RegistryClientFactory), so the plugin path keeps honoringNXF_PLUGINS_REGISTRY_URLopt-out.Test plan
./gradlew :nf-commons:test— incl. newPluginUpdaterTestcases:append from config, dedup against existing repo, offline no-op, null config no-op
./gradlew :nextflow:test— incl. newRegistryClientFactoryTestcases:default queried first, no duplicate when already configured
nextflow+nf-commonssuites pass locallyTODO:
Implementation note
We also considered routing the plugin calls through
RegistryClient— it takesa list of URLs and performs the calls until one replies successfully. This works
well for modules, but it doesn't fit pf4j's
PluginUpdaterand how plugins aremanaged, where it expects to manage them separately.
Moreover, there is a chicken-and-egg problem between plugin loading and config resolution:
PluginUpdateris initialized before the config is resolved, because some SCMand filesystem extensions are themselves provided by plugins and are required at
that stage. At that point only the default plugin registry is available. Later,
at load time — once the config is resolved — the remaining registries from the
registryscope are added, and plugins are resolved using all the definedregistries.