packit / packit-service

Packit provided as a service
https://packit.dev
MIT License
37 stars 48 forks source link

Standard tool/workflow/pipeline for auto-landing Fedora dist-git PRs #1723

Open martinpitt opened 2 years ago

martinpitt commented 2 years ago

Thanks to the current packit tooling and service, downstream release automation has come a long way. There's just one remaining item: Fedora dist-git PRs for new releases have to be watched and landed manually. This is still a regression from what we used to have in Cockpit (in exchange, we get gating tests before landing, which is good!).

To be clear: I do want to keep having Fedora PRs instead of direct dist-git pushes. They are a great place to document the update, collect/discuss gating results, etc, and packit service should better not have an almighty Fedora token that is able to push to all dist-gits. What I'm looking for is some standardized tool/workflow/pipeline that project authors can use to automate this step without too much fuss.

The osbuild team has come up with https://github.com/osbuild/fedora-bot , which provides the necessary glue for checking for open PRs, waiting for the tests to succeed, and landing them. It needs a token from the developer which is privileged to land that package (and we should keep that trait). However, it is hilariously expensive. It should probably be changed to start a polling loop when a tag is pushed, wait for the PR to succeed, and land it. That may run for an hour or two, but at least it doesn't start hundreds of VMs in the two weeks when no release happens. :grin:

Perhaps there is even some way with doing that in an event-based way? UMB or so? I figure pagure doesn't make this easy, and we may need to wait for migration to GitLab to happen.

In Cockpit we also use fedora-bot, but not through a workflow -- we just call it manually. This is also not optimal, as there are only two people in the team who are Fedora packagers, and one of them (me) is not even formally in the team right now :grin:

Has this been discussed anywhere already? Can we provide some tool, standard github action, or at least some documentation in packit how to achieve that in a sane way?

CC @ochosi

martinpitt commented 2 years ago

NB: This does not necessarily have to live under the packit project -- now that I think about it', it's much more of a generic Fedora project than packit specifically. But since you are so keen on automating the Fedora releases, you may at least have some good input on this. :wink:

TomasTomecek commented 1 year ago

Martin, thank you for opening this! We have discussed it within our team, I think that Franta will provide a more detailed update :) if I recall correctly 😁

I have also submitted (not just) this for the next OSCI focus group: I'd love to discuss our strategy around automation so we all can coordinate.

lachmanfrantisek commented 1 year ago

Here are the promised details as a result of the team discussion:

tldr: We don't want to do this as Packit but we can help.

Tomáš is right, it would be nice to meet and discuss this.

martinpitt commented 1 year ago

We, as Packit, can do that but don't want to be the gatekeeper and have all the responsibility for the content coming to Fedora.

Fully agreed. That's exactly what I spelled out in the description -- this is about coming up with an agreement and tools to do this, but the responsibility should stay with the development teams -- i.e. they would each create their own Fedora pagure bot token to "press the button".

E.g. There is a set of PRs for all the Fedora versions with the same diff and approving just one might be enough.

TBH, this feels too special-case-y and complicated to me. The set of conditions for auto-merging should be applied to each PR individually.

We can inform people about the dist-git PR or do anything else around that PR to save some time/clicks.

That already happens, dist-git package maintainers get an email about opened/closed PRs.

we already listen on fedora-messaging to be notified about dist-git events

That is indeed the sole blocker here. fedora-bot exists, it's easy enough to set up and use, but right now there is no suitable event provider/trigger to run it, other than dumb polling. I.e. if there is any outcome/agreement/solution about this problem, then please let it be this. (I don't have anything in mind, I don't know how pagure can be listened to/automated). Hence my gut feeling that this might have to wait for Fedora moving to Gitlab -- with pipelines this would be totally straightforward.

lbarcziova commented 1 year ago

Output from Packit 2023/Q1 planning meeting:

TomasTomecek commented 1 year ago

Sooner or later, we should start a discussion in Fedora community about this.

lsm5 commented 1 year ago

got sent here by @nforro . I / container-tools team would love to have this feature as well. Haven't yet played with fedora-bot but I can give it a try. But would be really cool to have it done in packit itself.

RE: responsibility, if this can be done via the package admin explicitly adding fas:packit to the package as a committer, so it's finally on the package admin, I'm totally fine with that.

RE: having a human do at least 1 step, how about the bodhi creation having autopush to stable disabled on both karma and number of days? A human has to monitor bodhi gating tests anyway, they can also monitor karma and stable push.

lachmanfrantisek commented 1 year ago

After a team discussion, we didn't pick this as a top Packit team priority for the next quarter and preferred epics with bigger user benefits. (Sadly, we have limited resources...) If anyone wants to help us with this (e.g. start the discussion in the Fedora community), we will be really glad. We are open to any collaboration and have already successfully implemented/started multiple affords thanks to people outside of the Packit team.