Fix incorrectly created epel10 branch for bluechi package #12457
Labels
No labels
after freeze
automation
backlog
blocked
change-ack
change-nak
change-noreleng
changes
Closed As
Can't Fix
Closed As
Duplicate
Closed As
Fixed
Closed As
Fixed with Explanation
Closed As
Get back later
Closed As
Grooming
Closed As
Insufficient data
Closed As
Invalid
Closed As
It's all good
Closed As
taiga
Closed As
upstream
day-to-day
dev
docs
easyfix
epel
f26
f27
f28
f29
f30
f31
f32
f33
f34
f35
f36
f37
f38
f39
f40
f41
f42
f43
f44
f45
fedora
groomed
high-gain
high-trouble
in-progress
in-review
investigation
legal
low-gain
low-trouble
mass rebuild
medium-gain
medium-trouble
meeting
mini-initiative
new_artifact
ops
pdc_retirement
rawhide
RCA
review
script
sidetarget
sprint-0
sprint-1
sprint-2
sprint-3
sprint-4
sprint-5
unfrozen
waiting on external
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
release-process
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
7 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
releng/tickets#12457
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
I was working on building a new version for bluechi, and have accidentally incorrectly created an epel10 branch (checkout -b and push instead of fedpkg request-branch).
Now fedpkg request-branch returns "Requested branch "epel10" already exists. Skipping the operation.", and of course I can't delete the remote branch.
Can you help me with that?
Also, maybe it would make sense to fool-proof that and reject new branch pushes of that sort?
Thanks
The main thing you're missing from doing request-branch is getting the package in the allowlist for the tag. I've manually added it so that you can build.
You're right that this should be rejected, and it's configured to do so, but it doesn't seem to be working correctly.
https://pagure.io/fedora-infra/ansible/blob/main/f/roles/distgit/pagure/templates/pagure_shared.cfg#_98-106
@carlwgeorge
I have successfully run the build.
Thanks a lot!
Metadata Update from @phsmoura:
Ok, I was able to reproduce this with another package. locally I get this message list
Which is weird, since if you try to send a epel10-test branch, it get's correctly processed by ACL
After further inspection and @carlwgeorge 's help, we noticed where ACL fails to stop the branch from being created.
We were expecting for it to be stopped since EPEL branches are already being blocked by the UNSPECIFIED_BLACKLIST_RES [0], but before that, it checks if the branch is supported [1]. That check verifies that the release is created on bohdi and that the branch isn't retired [2]. The problem is that when it tries do check for retirement[3], the check fails because the branch doesn't exists (hence the ERROR message on the previous post) and marks the request as supported [4]. Since the requests is marked as supported will skip the UNSPECIFIED_BLACKLIST_RES check [5], so it ends up being accepted.
I was thinking that this could be fixed if we make that is_supported branch to return None if the branch doesn't exist. That way it will pass the supported verification, but will be evaluated against the unspecified blacklist check.
[0] https://pagure.io/fedora-infra/ansible/blob/main/f/roles/distgit/pagure/templates/pagure_shared.cfg#_98-106
[1] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_274
[2] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_84-141
[3] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_140
[4] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_78-82
[5] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_294
[6] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_274
[7] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_284
[8] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_296
The two possible issues with that:
we need the scm-requests-processor to be exempted, so it can... make the branches.
There's a 'don't do any commits for me' flag to scm-processor. Does that just push a empty branch? or does that do nothing and expect the user to push whatever they want to the branch?
There are already some exceptions in place, one is for users from the "relenggroup" group[0][1], the other is for operations marked as internal [2].
From what I checked, I don't think that the worker complies with any of the two, but I might be wrong.
It doesn't requests the branch if that flag is up [3], it just requests the repository, which should come with an empty rawhide branch.
[0] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_252-258
[1] https://pagure.io/fedora-infra/ansible/blob/main/f/roles/distgit/pagure/templates/pagure_shared.cfg#_78-79
[2] https://pagure.io/pagure-dist-git/blob/master/f/dist_git_auth.py#_192-197
[3] https://pagure.io/fedora-infra/toddlers/blob/main/f/toddlers/utils/pagure.py#_388
The scm-request-processor is just using admin token with
create_branchACL. That token is generated forreleng-botuser and that user is already inRelEnggroup.I think that in this case everything should be already OK.
When this happens, should we instruct packagers to retry with
fedpkg request-branch --no-git-branch?I think that might work.
note that we need to fix the message around that entire flow:
which I suppose is not wrong, but if the branch already exists you don't need to create it.
Sent a PR to pagure-dist-git to implement what I described
https://pagure.io/pagure-dist-git/pull-request/168
I think this comment from @pingou in another issue helps clarify things.
As I understand it, without PDC we are now relying on two data points:
Using just these two data points, we can't determine if there a branch that is active but hasn't been requested yet, which was the scenario that happened at the start of this ticket. There is no PDC to check for per-package+per-branch active status. I don't think this will be a problem for Fedora, where every non-retired package should have a branch for the current releases, but it is a problem for EPEL.
The question is, is this a problem that needs to be solved? As far as I can tell, the only thing missing when a packager pushes to the branch without a request is that the package doesn't get added to the allowlist for the koji build tag. This is straightforward to fix, as I did earlier in this issue. Hopefully it's a rare occurrence. I think packagers will realize if they don't follow the documented process then they'll be blocked creating a build until releng intervenes. Even if we did implement some kind of solution, it would probably be short lived with the upcoming migration to a new git forge.
Another thing that is missing is that pagure doesn't check if a package is allowed to have an EPEL branch. This check is only made when you request a branch... It's not this specific issue, but it's a consequence of the same problem.
But yeah, my proposal would disable users from pushing their own branch history. Even if it would stop branches for being created in cases where they shouldn't, now I'm seeing that it might be way to overkill and would trample workflows on which maintainers relay on :/.
My only worry is that, even if we delay this to be solved by the new gitforge, there will still exist the need to check on an external source of truth to see if EPEL branches can be created.
Me and @dherrera were chatting about this, and he found that forgejo has a feature called repository flags. If forgejo is selected to be the new Fedora distgit, perhaps we could use that to store which branches are authorized. Each repo would start with a flag like
valid_branches/rawhide, and then if a packager requests a new branch, a new flag such asvalid_branches/epel10could be added. We'd still have to figure out how to deny pushing to branches that don't have a corresponding flag, but it would be a starting point.