Add an admin API for package metadata sync checkpoints
What does this MR do and why?
Adds GET /admin/package_metadata/checkpoints, which lists the last synced sequence, chunk, time and full-load marker (full_sync_target_sequence) for each Package Metadata Database dataset and registry type. Offline admins can't otherwise see what last imported, or whether a v3 or CVE enrichment full load is still running, short of reading logs or querying the database.
It answers an administrator 403 unless a sync worker can run: dependency scanning, license scanning or the dependency firewall is available. Whether the last import succeeded is left out because pm_checkpoints doesn't record it. @cwidstrom, this adds an API surface for Composition Analysis.
The route requires the read_package_metadata_checkpoint permission, defined at the instance boundary and offered to administrators, so a granular token can carry it.
References
Relates to #394747
Screenshots or screen recordings
None; there is no UI.
How to set up and validate locally
Call GET /api/v4/admin/package_metadata/checkpoints as an administrator.
MR acceptance checklist
- The request spec covers each licensed feature, each access level and the ordering.
An AI coding assistant wrote this change. The assistant also checked each claim against the code at db9e9d58 and ran RuboCop, the request spec, Vale and markdownlint on the changed files on a test VM. At b15bc8ef it ran RuboCop, the request spec and rake gitlab:permissions:validate again there.