-
Notifications
You must be signed in to change notification settings - Fork 192
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
Fake tagging for separate changelogs as well #7776
Fake tagging for separate changelogs as well #7776
Conversation
FILELIST="$(ls ${GIT_DIR}/${PKG_DIR}${PKG_NAME}.changes.* 2> /dev/null; true)" | ||
for FILE in $FILELIST; do | ||
if [ ${PREVIOUS_CHANGELOGS} -eq 0 -a ${EXTRA_CHANGELOGS} -eq 0 ]; then | ||
sed -i '1i\\' ${CHANGES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means: add an empty new line at the first line.
else | ||
PREVIOUS_CHANGELOGS=1 | ||
fi | ||
FILELIST="$(ls ${GIT_DIR}/${PKG_DIR}${PKG_NAME}.changes.* 2> /dev/null; true)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we send errors to /dev/null and we always return 0, so we don't break the script if no files are available.
If no separate changelogs are found, then the section is skipped.
LINENUMBER=1 | ||
while IFS= read -r LINE; do | ||
if [ "${LINE}" != "" ]; then | ||
sed -i "${LINENUMBER}i\\${LINE}" ${CHANGES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done this way so we add the lines from each changelog file in the right order.
EXTRA_CHANGELOGS=1 | ||
LINENUMBER=1 | ||
while IFS= read -r LINE; do | ||
if [ "${LINE}" != "" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some developers add empty lines by mistake. The changelog checker @cbbayburt is doing should be handling this, but for now we had this to avoid an error in the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, it LGTM :D
Merge authorized by @deneb-alpha |
What does this PR change?
Fake tagging for separate changelogs as well.
As otherwise if no changes are present in the main changelog, no fake tagging was performed, and therefore checking the changes on the package on a live instance for development was tricky.
CLI diff
If the package has no changes in any changelog file
It still builds as expected:
If the package has entries on the main changelog file and extra changelog files
To test it I added an entry
-blah
atspacewalk-java.changes
Then the entries from the extra changelog files get added on top:
If the package there are only entries on extra changelog files
Then the entries get added to the main changelog:
Documentation
No documentation needed: No doc, this is not for users, and we don't have it in any internal doc. It's just a goodie.
DONE
Test coverage
No tests: We don't have tests for this.
DONE
Links
Backport to SUSE Manager 4.3: https://github.com/SUSE/spacewalk/pull/22894
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: