Defer CI catalog publish decision to release-cli
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`. We'll use this FF to control this change to prevent breaking changes.
显示
- .rubocop_todo/rspec/feature_category.yml 0 个添加, 2 个删除.rubocop_todo/rspec/feature_category.yml
- app/services/releases/create_service.rb 7 个添加, 1 个删除app/services/releases/create_service.rb
- config/feature_flags/ops/ci_release_cli_catalog_publish_option.yml 9 个添加, 0 个删除...ature_flags/ops/ci_release_cli_catalog_publish_option.yml
- lib/api/releases.rb 7 个添加, 0 个删除lib/api/releases.rb
- lib/gitlab/ci/build/releaser.rb 11 个添加, 3 个删除lib/gitlab/ci/build/releaser.rb
- lib/gitlab/ci/build/step.rb 2 个添加, 3 个删除lib/gitlab/ci/build/step.rb
- spec/lib/gitlab/ci/build/releaser_spec.rb 37 个添加, 4 个删除spec/lib/gitlab/ci/build/releaser_spec.rb
- spec/lib/gitlab/ci/build/step_spec.rb 13 个添加, 1 个删除spec/lib/gitlab/ci/build/step_spec.rb
- spec/requests/api/releases_spec.rb 81 个添加, 0 个删除spec/requests/api/releases_spec.rb
- spec/services/releases/create_service_spec.rb 70 个添加, 6 个删除spec/services/releases/create_service_spec.rb
加载中
想要评论请 注册 或 登录