Skip to content

Improve Release Notes Generation in CI Pipeline

Note

MR description was created with AI input.

This MR enhances the release notes generation process in our CI pipeline, particularly fixing issues when running in fork scenarios. The changes ensure proper version detection by improving Git tag handling and making the pipeline more robust.

Key Improvements

  1. Better tag handling for forks: Added logic to fetch upstream tags when running in a fork's pipeline, ensuring correct version determination.

  2. Robust version detection: Switched from manually parsing Git tags to using git describe --tags --match 'v*', providing more reliable versioning.

  3. Increased Git depth: Set GIT_DEPTH: 400 to ensure tag history is accessible, fixing the "No tags can describe" error that was silently failing before.

  4. Cross-project API integration: When running in a merge request pipeline, the changes now properly generate release notes using the target project's API.

  5. Code cleanup: Removed debugging code (set -x/set +x) and improved logging for better maintainability.

Why This Matters

Without these changes, contributors working in forks experienced silent failures during release notes generation that were difficult to debug. The error occurred because:

  1. Shallow clones (depth 20) didn't include the commit history needed for tag access
  2. Tags may be missing in the source repo and weren't being fetched from the upstream repository
  3. The API calls were targeting the fork project instead of the upstream project when running on the fork; if the fork doesn't have any tags, which call will fail with HTTP 422 "Unprocessable Entity"

These issues combined to make contributing more difficult than necessary, especially for new contributors who might not understand the underlying Git mechanics.

Technical Implementation

The solution implements proper tag fetching with adequate depth, more robust version detection using native Git commands, and ensures API calls target the correct project regardless of where the pipeline runs.

Edited by Florian Forster

Merge request reports

Loading