ci: add changelog metadata tracking for automated releases
What does this MR do and why?
This MR adds metadata tracking to CHANGELOG.md to record the commit SHA and timestamp used during changelog generation. This enables better traceability and helps verify which changes are included in each release.
Related to #183
Implementation
- Created
scripts/changelog-metadata.sh- a unified script that handles both updating and extracting changelog metadata - Updated
.gitlab-ci.ymlto call the script during therelease_create_mrjob - Updated
cliff.tomlto include a metadata placeholder in the footer template - Added documentation in
doc/process.mdexplaining the metadata feature
Metadata Format
The metadata is stored at the end of CHANGELOG.md as a single-line JSON comment:
<!-- changelog_metadata: {"generated_at":1765294058,"generated_at_iso":"2025-12-09T15:27:38Z","commit_sha":"abc123def456789"} -->
Fields:
-
commit_sha: Full commit SHA from which the changelog was generated -
generated_at: Unix timestamp when the changelog was generated -
generated_at_iso: ISO 8601 formatted timestamp (UTC)
Usage
# Extract all metadata (pretty-printed JSON)
./scripts/changelog-metadata.sh get
# Extract specific field
./scripts/changelog-metadata.sh get CHANGELOG.md commit_sha
# Update metadata (CI usage)
./scripts/changelog-metadata.sh update CHANGELOG.md "$CI_COMMIT_SHA"
Testing
- Script passes
shellcheckvalidation - Comprehensive error handling tested
- Metadata will be automatically populated on the next automated weekly release