Improve PR Sync Logic for Changelog Generator #1617
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve PR Sync Logic for Changelog Generator
Summary
This PR enhances the changelog generation system to properly preserve and associate PR numbers with version tags during cache merges. The changes improve the accuracy of changelog entries by ensuring that PR numbers are correctly maintained when versions are cached and retrieved.
Files Changed
Code Changes
cmd/generate_changelog/internal/changelog/generator.go
The most significant changes are in the
fetchPRs()method:This code adds a check to determine if any versions have PR numbers that aren't present in the cached PR data, and forces a sync if missing PRs are detected.
CHANGELOG.md
Added a new version entry documenting the improvements made to the changelog system itself, including proper attribution of changes to PR #1616.
Reason for Changes
The changes address an issue where PR numbers associated with version tags were not being properly preserved during cache operations. Previously, when versions were cached and later retrieved, the PR number associations could be lost, leading to incomplete or inaccurate changelog entries.
Impact of Changes
Test Plan
The changes should be tested by:
Additional Notes
missingPRsflag ensures that the system is more robust in handling incomplete cached dataPotential Issues to Monitor: