Implement auto deployments for the Container Registry
## Context
Currently, many of our non-GitLab projects are manually deployed. This leads to slower release and cycle times. Please see https://gitlab.com/gitlab-org/ci-cd/package-stage/package/-/issues/48#current-manual-deployment-process for a summary of the current manual deployment process for the Container Registry.
The plan detailed below no longer seems to be completely relevant to the direction we are heading, please see https://gitlab.com/groups/gitlab-org/-/epics/7998#note_1619347161 for the latest plan/direction of this epic
~~To enable automated deployments, we have prepared a high-level plan in collaboration with~~ ~"team::Delivery" ~~and~~ ~"group::distribution" ~~(https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2124). This epic is meant to aggregate all implementation tasks required to put that plan into practice. Later on, it is expected that there will be a related epic under `gitlab-com/gl-infra` to track the related~~ ~infrastructure ~~tasks~~.
## ~~Plan~~
<details><summary>Old Plan (Kept for contextual reasons)</summary>
| Task | Type | Depends on | Description | Target | Team(s) | Issue(s)/Epic(s) |
| ---- | --------------------------- | ---------- | ------------------------------------------------------------ | ----------------------------- | ----------------------------- | --- |
| `A` | Automation | | New CI job in `gitlab-org/container-registry` to programatically create version bump MR in `gitlab-org/build/CNG` for every new git tag.<br />The MR description should include the relevant changelog excerpt (delta between current version in CNG and tag version). | GitLab.com;<br />Self-managed | Package | https://gitlab.com/gitlab-org/container-registry/-/issues/673 |
| `B` | Test;<br />Automation | `A` | - Extend tests in `gitlab-org/build/CNG` to cover the database automation functionality;<br />- Automatically trigger test suite for version bump MRs. | GitLab.com;<br />Self-managed | Distribution<br />Package (?) | https://gitlab.com/gitlab-org/container-registry/-/issues/676
| `C` | Automation | `B` | Once `B` proves to be stable, automatically set MWPS for `gitlab-org/build/CNG` version bump MRs. | GitLab.com;<br />Self-managed | Distribution;<br />Package |
| `D` | Automation | `C` | Repeat `A`, `B` and `C` but for `gitlab-org/omnibus-gitlab` and `gitlab-org/charts` version bumps? | Self-managed | Distribution;<br />Package |
| `E` | Automation | | [Implement methodology for post-deployment database migrations](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/3926) | GitLab.com | Distribution;<br />Package |
| `F` | Development;<br />Test | | Setup environment in Cloud Sandbox (HackyStack). This will allow the development team to share a "realistic" environment in GCP for advanced testing that can't be covered with integration and/or QA tests, and for `G`. | GitLab.com;<br />Self-managed | Package | https://gitlab.com/gitlab-org/container-registry/-/issues/674 |
| `G` | Test | `F` | Run all *integration* tests (not the QA/end-to-end tests) as part of the `gitlab-org/container-registry` CI pipeline. Currently we're not running the GCS and CDN tests that are part of the registry codebase because they require a GCP infrastructure to run against. We can rely on the setup from `E` for this (open to better solutions). | GitLab.com;<br />Self-managed | Package | https://gitlab.com/gitlab-org/container-registry/-/issues/712
| `H` | Test | | ~~Expand QA test coverage for the Container Registry~~ | GitLab.com;<br />Self-managed | Package;<br />Quality | https://gitlab.com/gitlab-org/container-registry/-/issues/589 |
| `I` | Development;<br />Operation | | - Design and implement feature flags solution. Ideally, this should be applicable to all Go applications at GitLab (using the registry as PoC);<br />- Integrate feature flags solution with `chatops`. | GitLab.com | Package;<br />Delivery;<br />Others | https://gitlab.com/gitlab-org/container-registry/-/issues/567 |
| `J` | Automation | `C` `I` | Automatically create new tag in `gitlab-org/container-registry` for the latest green pipeline on `master`. | GitLab.com | Delivery |
| `L` | Automation | `J` | Adapt CI job from `A` so that it responds to events from `I` only. | GitLab.com;<br />Self-managed | Package |
| `M` | Automation | `L` | Adjust wait job that polls for new images to be available, so that it can monitor and detect new registry images in `gitlab-org/build/CNG`. | GitLab.com | Delivery? |
| `N` | Automation | `M` | Adjust `gitlab-com/gl-infra/k8s-workloads/gitlab-com` to pick the latest auto deploy image tag for the registry and kick off the deployment. | GitLab.com | Delivery |
</details>
epic