Skip to content

remove Upgrades header - #613

Open
muald wants to merge 7 commits into
OpenVoxProject:mainfrom
muald:fix-remove-upgrades-header
Open

muald wants to merge 7 commits into
OpenVoxProject:mainfrom
muald:fix-remove-upgrades-header

Conversation

@muald

@muald muald commented Aug 16, 2026

Copy link
Copy Markdown

Short description

Remove the Upgrades header. The update process in Fedora 44 was blocked by this header.
#555 (comment)

The header was introduced 7 months ago.
https://github.com/rpm-software-management/dnf5/blob/main/dnf5/commands/check-upgrade/check-upgrade.cpp#L211

Checklist

I have:

  • [ x] read the CONTRIBUTING.md document
  • [ x] read and accepted the Developer Certificate of Origin document and added a Signed-off-by annotation to each of my commits
  • [ x] read and accepted the AI Policy document and added Generated-by or Assisted-by annotations to each of my commits created with the help of an AI agent
  • [ x] tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@muald
muald force-pushed the fix-remove-upgrades-header branch 4 times, most recently from caea9df to 8fbb446 Compare August 19, 2026 09:00
@muald

muald commented Aug 20, 2026

Copy link
Copy Markdown
Author

Can one of the reviewers with write access review this pull request, please?

@muald
muald force-pushed the fix-remove-upgrades-header branch 2 times, most recently from fd0aa52 to 169c76e Compare August 31, 2026 08:43
Signed-off-by: Markus Urbanczyk <markus.urbanczyk@evosoft.com>
@muald
muald force-pushed the fix-remove-upgrades-header branch from 169c76e to 482f506 Compare August 31, 2026 12:21
# Strip off all content that contains Obsoleting, Security: or Update
body = str.partition(/^(Obsoleting|Security:|Update)/).first

body = body.gsub(/^Upgrades.*?$/m, '')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body = body.gsub(/^Upgrades.*?$/m, '')
body = body.gsub(/^Upgrades.*?$/m, '')

I would keep the empty newline after the body modifications.

Suggested change
body = body.gsub(/^Upgrades.*?$/m, '')
body.gsub!(/^Upgrades.*?$/m, '')

@OpenVoxProject do you prefer the in-place gsub call?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muald I just learnt that in Ruby RegExp the anchors ^ and $ match in m mode actually at the line boundaries and not at the string boundaries (according to the back of my head this used to be different... in Python). This means, due to the $ anchor the match will definitely anchor at the end of the first line. As we want the whole first line gone, we then probably don't need the non-greedy ?.

But we definitely need the m mode otherwise $ would anchor at the end of the whole body string.

We do leave an empty newline after the substitution.

Alternatively, without m mode, we could also do this:

Suggested change
body = body.gsub(/^Upgrades.*?$/m, '')
# https://regex101.com/r/LiVD53/2/substitution
body.gsub!(/^Upgrades.*\R/, '')

This would remove only the whole first line of the body, if it starts with Upgrades.

@bastelfreak what do you think?

@nsballmann nsballmann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muald I would probably go with the suggestion from #613 (comment) as this IMHO is the cleanest way of removing the line.

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.

2 participants