Loading
Pass repository registry credentials to the update job
Stack, in merge order:
- updater !208
- orchestrator !67
- orchestrator !68
- orchestrator !62
- gitlab !256224 (merged)
- gitlab !264336 (merged) (this MR)
- gitlab !264337
- docs !256327
Merge notes
- Different repositories can merge in parallel. Within a repository, keep the order above.
- Tag an updater release after !208 and an orchestrator release after !62.
- Keep
dependency_management_registry_credentialsoff. Nothing is active in production until it is on and the proxy is enabled. - Merge the docs last, after !264336 (merged), the orchestrator release and enabling the proxy.
Second of three stacked merge requests for #624431 and #624433, on top of !256224 (merged). !264337 adds the rubygems and go kinds on top of this one.
Wires the repository config parser from !256224 (merged) into UpdateService behind the dependency_management_registry_credentials flag (rollout issue).
With the flag on:
- The CI/CD variables the registries reference go to
RunWorkloadServiceasci_variables_included:, an argument that existed and never received a value. - The registries go into the job JSON as
credentials, with the placeholders unresolved. - An invalid file fails the request before the source branch is created, so a typo costs no CI minute and leaves nothing behind. The reason is logged once per request with the project ID, since every remediation on the project fails the same way.
With the flag off, the file is not read at all. A new spec asserts the parser is never built in that case.
Why a flag
- Both images use floating tags (
orchestrator:0, andupdater:0through the orchestrator), so every release goes live straight away. The flag lets this merge as soon as it is reviewed, and lets one test project try the whole path on GitLab.com. - It must not be enabled anywhere before the proxy is on (#581992). The monolith never sets
DEPENDENCY_MANAGEMENT_PROXY_ENABLEDtoday, so nothing would authenticate, and areplaces-base: trueregistry would send public lookups to the private registry unauthenticated. Updates that work today would start failing.
Merging before the orchestrator change (gitlab-org/security-products/dependency-management/orchestrator!62) is safe. The orchestrator uses plain json.Unmarshal and ignores unknown fields.
How to verify
- Enable the flag for a project with auto-remediation on:
Feature.enable(:dependency_management_registry_credentials, project). - Commit the example file from !256224 (merged), add
DS_AUTO_REMEDIATION_REGISTRY_NPM_TOKENas an unprotected variable with a*environment scope, and trigger a remediation. The workload's variable inclusions list the name, and the job JSON in the job log carries thecredentialsarray with the placeholder still unresolved. - Change the placeholder to
${PRODUCTION_DEPLOY_TOKEN}. The request fails with a message naming the problem, and no pipeline is created. - Disable the flag. The same broken file no longer stops the remediation.
Edited by Albina Yusupova