Add REST API client functions for mirror management

What does this MR do and why?

Contributes to #595303

Problem

The mirror list table currently uses jQuery-based DOM manipulation that calls Rails controller endpoints via axios.put with form payloads. Migrating to a Vue component requires standalone API client modules that call the proper REST API endpoints for remote mirror CRUD and pull mirror sync/delete operations.

Solution

Add remote_mirrors_api.js with deleteRemoteMirror, syncRemoteMirror, and updateRemoteMirror functions that call the /projects/:id/remote_mirrors/:mirror_id REST API endpoints. Add CE/EE mirrors/api.js modules that re-export these functions plus pull mirror stubs (CE no-ops, EE calls /projects/:id/mirror/pull).

These modules are not yet imported by any production code and will be consumed by the Vue mirror table component in a follow-up MR.

References

  • Parent issue: #595303
  • This is step 1 of 4 in migrating the mirror list table from jQuery to Vue

Screenshots or screen recordings

No UI changes — this MR adds API client modules only.

How to set up and validate locally

  1. Verify the new files exist and have no lint errors:
    • app/assets/javascripts/api/remote_mirrors_api.js
    • app/assets/javascripts/mirrors/api.js
    • ee/app/assets/javascripts/mirrors/api.js
  2. Run the EE API spec: yarn jest ee/spec/frontend/api/pull_mirror_api_spec.js
  3. Confirm no existing tests are broken — these are new files with no callers yet.

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 Vasilii Iakliushin

Merge request reports

Loading