Skip to content

Defer CI catalog publish decision to release-cli

Furkan Ayhan requested to merge 442066-release-catalog-publish into master

What does this MR do and why?

We will be changing how catalog publishing works by moving the metadata processing and publishing to release-cli. In our ideal case, Releases::CreateService should not run Ci::Catalog::Resources::ReleaseService and this should be in a separate endpoint. And in the future, we'll also change the catalog publishing service because we don't want to calculate the metadata on the server side.

To this end, we are deferring the catalog publish decision to release-cli;

  • If release-cli sends legacy_catalog_publish true, then Releases::CreateService publishes the catalog resource.
  • Otherwise, it does not publish the catalog. It only creates the release.

In this MR, we are adding the new legacy_catalog_publish parameter to the /releases API endpoint. Then, we are using it in Releases::CreateService to decide publishing the catalog resource.

We are also starting to send the --catalog-publish CLI option to release-cli. This will notify the release-cli that "this release is a catalog resource so send legacy_catalog_publish as true if you want to publish this release". In the future, release-cli will still use this flag but then it will not send the legacy_catalog_publish parameter. Instead, it will call the catalog resource endpoint separately.

These changes are behind the FF ci_release_cli_catalog_publish_option (#443782). We'll use this FF to control this change to prevent breaking changes.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

1. When GitLab is old

1.A. When release-cli is old

  • GitLab does not send the --catalog-publish parameter to RCLI.
  • RCLI does not send the legacy_catalog_publish parameter to GitLab.
  • GitLab does publish the catalog.

Screenshot_2024-04-02_at_10.58.33

Screenshot_2024-04-02_at_10.58.58

1.B. When release-cli is new

  • GitLab does not send the --catalog-publish parameter to RCLI.
  • RCLI does not send the legacy_catalog_publish parameter to GitLab.
  • GitLab does publish the catalog.

Screenshot_2024-04-02_at_11.01.27

Screenshot_2024-04-02_at_11.01.46

2. When GitLab is new

2.A. When release-cli is old

2.A.X. When the FF is disabled
  • GitLab does not send the --catalog-publish parameter to RCLI.
  • RCLI does not send the legacy_catalog_publish parameter to GitLab.
  • GitLab does publish the catalog.

Screenshot_2024-04-02_at_11.05.51

Screenshot_2024-04-02_at_11.06.02

2.A.Y. When the FF is enabled

GitLab sends the --catalog-publish parameter to RCLI and gets an error

Screenshot_2024-04-02_at_11.09.35

2.B. When release-cli is new

2.B.X. When the FF is disabled
  • GitLab does not send the --catalog-publish parameter to RCLI.
  • RCLI does not send the legacy_catalog_publish parameter to GitLab.
  • GitLab does publish the catalog.

Screenshot_2024-04-02_at_11.07.06

Screenshot_2024-04-02_at_11.07.20

2.B.Y. When the FF is enabled
  • GitLab does send the --catalog-publish parameter to RCLI.
  • RCLI does send the legacy_catalog_publish parameter as true to GitLab.
  • GitLab does publish the catalog.

Screenshot_2024-04-02_at_11.08.36

Screenshot_2024-04-02_at_11.08.47

Edited by Furkan Ayhan

Merge request reports