Closed FrostyX closed 8 months ago
This obsoletes PR #475.
What do you think @xsuchy?
@lachmanfrantisek, @lbarcziova, there is a hardcoded version of this in the Packit code. @xsuchy suggested creating a separate python package for resolving the aliases. We could use this implementation, what do you think?
It can be better (like implement rest of the aliases) but this is HUGE improvement. +1 for merging and improve later in next PR :)
@FrostyX the linked variable is used only as a feedback value, otherwise we use Bodhi for resolving the aliases here. But having this code in a separate package for the benefit of reusing it by multiple projects makes sense to me!
otherwise we use Bodhi for resolving the aliases here.
Thank you, I will take a look if it is applicable for Tito
having this code in a separate package for the benefit of reusing it by multiple projects makes sense to me!
Perfect! I will ping you so we can figure out the details (e.g. where it should live) and I will try to kick off the project.
@lbarcziova I took your get_aliases
and modified it a bit. It doesn't return e.g.
{
'fedora-all': ['fedora-38', 'fedora-39', 'fedora-rawhide']
...
}
but rather
{
'fedora-all': [
Distro({'name': 'F38', 'long_name': 'Fedora 38', 'version': '38', ...}),
Distro({'name': 'F39', 'long_name': 'Fedora 39', 'version': '39', ...}),
Distro({'name': 'Rawhide', 'long_name': 'Fedora Rawhide', 'version': 'rawhide', ...})
...
]
}
The reason is that in Tito I want to use something like
aliases = get_distro_aliases()
branches = [x.branch for x in aliases["fedora-all"]
and in Packit you will want
aliases = get_distro_aliases()
branches = [x.namever for x in aliases["fedora-all"]
Also, you will maybe be able to replace (some parts of) your get_branches
function.
What do you think of the code now? If it was moved to a separate package outside of Tito, would you use it?
@FrostyX I like the object-like approach. It would be really handy for us as well -- sometimes, we need the namever
(for chroots), and sometimes branches (e.g. when working with dit-git).
I updated this PR to use fedora-distro-aliases ... so I marked this PR as blocked
until the package is in Fedora.
But it is ready for a review. I am only planning to squash the commits before merging.
First package release using Tito with this patch: https://github.com/fedora-copr/resalloc-ibm-cloud/commit/5ceece9613192befcb97ad3148d099bd99df42d0
Fix #430