Adds mavenUpstreamRegistry top-level GraphQL query
What does this MR do and why?
Adds mavenUpstreamRegistry top-level GraphQL query to look up Maven upstream registry by its ID.
Adds registries field to maven_upstream_type
This will be used in Show associated registries before Maven upstrea... (#556828 - closed) to show associated registry names.
EE: true
References
- Related issue: GraphQL query & mutations for virtual registry ... (#525932)
- Related MR: Adds mavenVirtualRegistry top-level GraphQL query (!199389 - merged)
Screenshots or screen recordings
N/A
How to set up and validate locally
- Run the following in the rails console
Feature.enable(:virtual_registry_maven)
g = Group.find(1) // must be a root group
r = VirtualRegistries::Packages::Maven::Registry.create(group: g, name: 'app-test')
# create an upstream, note: if you get validation error for local URL you need to comment out url validations in ee/app/models/virtual_registries/packages/maven/upstream.rb
u = VirtualRegistries::Packages::Maven::Upstream.create!(group: g, url: 'http://local.test/maven/', name: 'Upstream')
# create a registry_upstream join table row
VirtualRegistries::Packages::Maven::RegistryUpstream.create!(group: g, registry: r, upstream: u)
- Run the example query
query {
mavenUpstreamRegistry(id: "gid://gitlab/VirtualRegistries::Packages::Maven::Upstream/<u.id>") {
id
name
description
url
username
cacheValidityHours
metadataCacheValidityHours
registries(first: 20) {
nodes {
id
name
description
updatedAt
}
}
registryUpstreams {
id
position
}
}
}
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #556828 (closed)
Edited by Rahul Chanila