#573 Fix Releng#12311: Dynamically exclude Rawhide branch from fedpkg branching
Merged by onosek. Opened by jnsamyak.
jnsamyak/fedpkg releng_12311  into  master

Download 573.patch

Description:

This PR updates the query_bodhi function to dynamically exclude the Rawhide branch from the list of Fedora branches, ensuring that Rawhide is handled correctly without being hard coded.

Changes Made:

  • Modified query_bodhi to fetch the active Fedora releases from Bodhi.
  • Extracted the version associated with the rawhide branch to dynamically construct the Rawhide branch name (e.g., f42).
  • Excluded the dynamically constructed Rawhide branch (f{version}) from being yielded, preventing redundant or incorrect handling as a stable release.

(Rawhide is the rolling development branch of Fedora and requires separate treatment from stable releases and may issues were being faced regarding this such as: https://pagure.io/releng/fedora-scm-requests/issue/66666)

Releng Issue: https://pagure.io/releng/issue/12311
Fedpkg Issue: https://pagure.io/fedpkg/issue/566

Open for review, and this is my first fedpkg PR so more eyes are welcome!

Signed-off-by: Samyak Jain samyak.jn11@gmail.com

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

rebased onto 7559b4cdb93d5a92c6b14b28b09cabebcc5965f9

This space is there on purpose to separate stdlib and third party imports

Not sure if I'm not missing anything, but would it be possible to move here the logic of the previous loop?
Like:

for release in rv_json['releases']:
    branch = release['branch']
    if branch == 'rawhide':
        branch = f"f{release['version']}"

Hi @jnsamyak,
I am sorry for the delay. I appreciate you started quite a complex PR (as your first contribution to the project on top of that). I reviewed your changes except for unittests (which look cool at first sight) and I have a few notes:

  • imports - yes, spacing is intentional. isort is a useful tool that keeps imports in order. Of course, some fedpkg's files need maintenance in this, but you don't have to take care of it.
  • I think @lenkaseg is right - I don't see the situation we need the first run and find what is the branch name of the rawhide branch and rawhide could be directly changed to fXX.
  • But I also found one scenario that was affected by this change: #546. Your change deletes 'rawhide' from results of get_stream_branches. But some repositories rely on the 'rawhide' presence among results - this feature is quite rare though, I know about 'grub2' repo with its 'package.cfg' in the 'rawhide' branch.
    I am wondering how not to break anything. Deal with this directly in get_stream_branches? Or maybe implementing all necessary changes just in the get_release_branches method? On the other hand, we would have two places that queries Bodhi. What do you think?

Commit ffe82116 fixes this pull-request

Pull-Request has been merged by onosek

Metadata