Draft: Add Maven upstreams create and update services

🐦‍⬛ Context

In Maven virtual registries: local upstreams backe... (#566217) • David Fernandez • 18.7 • At risk, we're working towards support local upstreams in the Maven virtual registries.

You can look at more details in !207117 (merged).

We started the changes on the API endpoints but they were too large (see !215982).

This MR is an extraction of some parts of that MR:

  • the create/update services for Maven upstreams to centralize common logic, for example, user authorization.
  • the related specs.
  • update all call sites (Rest API endpoint / GraphQL) to use the new services instead of a duplicated logic.

🤔 What does this MR do and why?

  • introduce the create and update maven upstream services.
  • add the related specs.
  • update the Rest API endpoints and graphql mutations to use these new services.

Note that the services are ready to handle local upstreams but that part will not be used yet as the Rest API endpoints and graphql parts inputs have not been updated = external clients can't create local upstreams (yet).

📖 References

📺 Screenshots or screen recordings

No UI changes.

🧑‍🔬 How to set up and validate locally

Requirements:

  • An EE license
  • A top level group
  • A Personal access token with api scope for a maintainer of that top level group.

The parent object of maven upstreams is a maven virtual registry. Let's create that in a rails console:

top_level_group = Group.find(<top_level_group.id>)
FactoryBot.create(:)

🏎️ 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.

Edited by David Fernandez

Merge request reports

Loading