Skip to content

Add support for publishing GitLab CI components to catalog #883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 8, 2025

This PR implements support for GitLab CI components by adding a publishToCatalog configuration option that enables publishing to the GitLab catalog after creating a release.

Background

GitLab CI components are reusable pieces of CI/CD configuration that can be shared through the GitLab catalog. When releasing a CI component project, an additional API call to /projects/:id/catalog/publish is required after the standard release creation to properly publish the component to the catalog.

Changes

New Configuration Option

Added publishToCatalog boolean option that defaults to false for backward compatibility:

{
  "plugins": [
    ["@semantic-release/gitlab", {
      "publishToCatalog": true
    }]
  ]
}

Enhanced Publishing Flow

When publishToCatalog is enabled, the plugin now:

  1. Creates the GitLab release as usual
  2. Makes an additional POST request to /projects/:id/catalog/publish
  3. Logs success/failure of catalog publishing separately

Error Handling

  • Catalog publishing failures are properly reported with detailed error messages
  • The catalog API call only happens after successful release creation
  • Both operations maintain independent error handling

Validation

Added proper validation to ensure publishToCatalog is a boolean value when provided.

Usage

For standard GitLab projects, no changes are needed - the option defaults to false.

For GitLab CI component projects:

{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/gitlab", {
      "publishToCatalog": true
    }]
  ]
}

This will create both a GitLab release and publish the component to the GitLab catalog.

Testing

  • Added comprehensive tests for both success and error scenarios
  • Added validation tests for the new configuration option
  • All existing functionality remains unchanged (137 tests passing)
  • Maintains high code coverage (97.37%)

Fixes #822

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.gitlab.com
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] implement @semantic-release/gitlab/issues/822 Add support for publishing GitLab CI components to catalog Aug 8, 2025
@Copilot Copilot AI requested a review from fgreinacher August 8, 2025 13:42
Copilot finished work on behalf of fgreinacher August 8, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support releasing GitLab CI components
2 participants