Numerous Packages in Fedora fail git-fsck #11822
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
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#11822
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?
Describe the issue
Many packages (mostly Java) in Fedora dist-git fail to validate with
git-fsck. This prevents importing those packages' history into forges that run this check on push for security reasons. In particular, this is preventing us from importing those packages into CentOS Stream 10, which uses Gitlab as the host for its dist-git.The packages specifically needed for CentOS Stream 10 are:
The rest of the list is attached below. All of the affected packages have the same root issue: a packager many years ago had an extra
<character in their author/committer field, which causes a (harmless) validation error.What we propose:
rawhidebranch with a new branch/tag identifier so that it will remain in the repository.rawhidebranch will validate successfully. This means thatrawhidewill move HEAD and will need to be announced that anyone with a checkout will need to re-pull from it.This will resolve the issue for these sixteen packages, but it's also worth noting that Fedora will still need to deal with this issue on other branches at some point if we move away from Pagure. We probably also want to bring Pagure in line with Gitlab here and make it run this check on pushes to ensure we don't reintroduce similar issues.
When do you need this? (YYYY/MM/DD)
Immediately
When is this no longer needed or useful? (YYYY/MM/DD)
This should be a one-time event.
If we cannot complete your request, what is the impact?
We will be unable to import the affected packages directly to CentOS Stream 10 and will need to find another workaround, probably making trivial merges/cherry-picks from Fedora unusable.
Appendix
The complete list of Fedora packages that fail
git-fsckas of 2023-12-04.We should fix this if for nothing else because Pagure's remote pull request feature is effectively useless on these packages if you can't push to some other git server because it fails git-fsck.
I would want this to get FESCo approval and also get a lot of noise in the community before we do it... since all those repos checked out by maintainers would be useless/broken after we re-write history. ;(
Metadata Update from @phsmoura:
OK, with the time it would take to get approved by FESCo and then communicate it effectively to the community as a whole, I think we (CentOS Stream 10) need to proceed with our backup plan of just breaking the inheritance and importing these with revised history. I'll leave this ticket open because we do still need to come up with a longer-term solution.
Well, we still have a month, so a FESCo ticket about this now (to be discussed/voted on by Thursday) and then an announcement shortly after can give us the time we need.
Please be diligent here.
"Fedora rewrites dist-git history to make RHEL's choice of non-opensource gitlab.com work" would be a very bad headline for all of us. And it's a predictable headline on you_name_it.
The issue of fsck-protected pushes is too technical to make it even in the byline on those sites ...
There are good reasons for both the non-rewrite policy as well as the fsck-protection. They are in conflict here. If we were in control of both forges the obvious short-term solution would be to check the fsck warning carefully and then override it. We cannot do that because gitlab.com does not let us do that. And it's really disappointing, given git has
fsck.skipListspecifically for that purpose, with fine-grained control.I'm wondering, though - where does CentOS Stream 9 have its package sources, and why hasn't the problem surfaced there?
Does gitlab.com offer shallow clones? This would allow us to get the history from 2012 onwards (I checked bsf only), which should suffice for now - unwritten and fsck'able!
.mailmapdoes not helpfsck, btw (onlylog). Neither doesgit replace.CentOS Stream 9 also has it on gitlab.com, but it doesn't surface there because they didn't import Git history when they forked from Fedora Linux 34. They dropped all the history of the package and created new repos. However, this messes with attribution, especially for packages that use RPMAutoSpec. Back then, RPMAutoSpec was new and not broadly adopted, but now it is used in many core packages. Thus, the community pushed for preserving the Git history for packages when forking from Fedora the next time. That time is now.
For the record, I've imported the sixteen CentOS Stream 10 branches by running the following magic incantation over them:
All of the issues were the result of an extra pair of characters in the email field for a short period around 2008 (likely in CVS and pulled over when we switched to git):
< <akurtako@redhat.com>instead of<akurtako@redhat.com>If FESCo approves the fixup, I can pull these 16 branches (and their updated history) back over to Fedora easily. I went ahead with the CentOS Stream 10 import right away because they are blocking our switch over to using CS10 as its own buildroot (rather than relying on ELN for the buildroot).
For reference, the corresponding FESCo ticket is https://pagure.io/fesco/issue/3119
@mizdebsk wrote in #11822 (comment):
The result being:
FESCo approves the rewriting the history in those repositories using
git filter-repo, with the old branches saved to refs/archive/
namespace.
APPROVED (+4, 0, 0)
But I don't think this was ever implemented?
post-recharge ping
Can we move this forward?
So, who is this action on? @sgallagh or releng?
I guess releng since you can't force push...
perhaps we could make a one off script to do this and verify it then releng can run it?
Here's a new wrinkle we need to test (I haven't had a chance yet): whether the
refs/archivecontent can be pushed to Forgejo. I assume that there's a plan for us to sunset src.fedoraproject.org at some point in favor of dist-git on Forgejo?The filter-branch solution is acceptable for what we need out of the sync from Fedora to CentOS Stream, but we may just be delaying how we have to deal with it in Fedora.
What is needed to move this forward?
@sgallagh wrote in #11822 (comment):
I would think that would work fine... it's just a git repo ref?
Yes, we will be moving off src at some point, but timeline and setup is not set (at least that I know of)
Perhaps, but we can deal with it then...
@yselkowitz wrote in #11822 (comment):
Well, ideally, a script that has the invalid emails/whatever for each repo and can run the filter-branch?
if someone could make that I would be happy to run it.
@kevin wrote in #11822 (comment):
I'm not so sure. If Forgejo behaves like every other forge out there today, it will run
git fsckas part of it's pre-receive hook and reject the refs that fail it.As far as I know, that's all that is required. It was only ever this one specific email address that had the extra leading
<causing the parsing error.But we need to archive the current rawhide branch too, right?
Ah, I misunderstood. I thought there was a collection of emails... I can do that.
yes, we should archive them before making any changes.
I can look at doing this soon...
ok, so looking at this again today.
yeah, I guess fesco wanted the orig branches to be copied under archive. I'll have to look at how to do that. I guess thats 'all branches' ?
And... there's not any 'git filter' available on the pkgs01 machine and it's rhel8, so there's no epel8 package for it either.
I suppose we could do the work remotely and rsync it back. ;(
For the purposes of ELN (CS/RHEL bootstrapping), fixing the rawhide branch is sufficient.
Okay, this took a little more effort than I had expected to get right, but I've now got a script prepared at https://github.com/sgallagher/fedora-git-filter-repo-bademail that will take a list of packages and perform the necessary changes to clean up the git history, as well as retaining the prior set of commits under
refs/archive/bademail. Full details are in the README.md.This does not make changes directly to the dist-git repos. It copies them locally and makes a bunch of destructive changes and then outputs the bare repos which should be examined by the rel-eng engineer before copying them over to dist-git.
I'd appreciate greatly if I could get a couple sets of eyes on the logic as well. I've tried to be as careful as possible here, but I don't like any situation where git history gets rewritten.
Sorry for the delay here. Finally looked into this.
Thanks a ton! This is super clear and helpful. I really appreciate it. :)
I ran it here and looked...and... I still see 'git fsck' failing?
@kevin wrote in #11822 (comment):
Which repo did you run this in? The rewritten repo still contains the unwritten (including bad) commits for reference. The repo which has only the rewritten commits should fsck fine.
@kevin wrote in #11822 (comment):
Yes, the resulting repo will still fail git-fsck, because those commits are still present in the
refs/archive/bademailpath. That was very intentional, so we don't lose those commits that have been used to build packages.However, the actual branches under
refs/headswill all be clean. So if we want to push those to GitLab (in the case of CentOS Stream 11) or Forgejo at some point, we can exclude therefs/archive/bademailcontents.For an experiment, I just did this:
Which is entirely clean.
Effectively, what this patch does is "hide" the old commits in the
refs/archive/bademailpath so they don't show up ingit branchorgit refs liston a clone, but they remain in the repo if you need to reference them directly or you know where to look.Yeah, I thought that might be the case, but I could not find a way to see what branch/ref git-fsck found that commit object... I am sure there is a way, I just couldn't find it.
Anyhow, I guess that looks good to me, shall I save off the old repos and sync these in place?
Or I suppose we could push them to staging first and confirm there's no weird pagure problems with the repos?
@kevin wrote in #11822 (comment):
That's probably the safest approach, yeah.
ok. I have re-run the script then synced all those repos to src.stg.fedoraproject.org.
Can you do a check and see if they look correct to you?
@kevin wrote in #11822 (comment):
I don't have access to that server. Could you tar-zip up a couple random repos and attach them here for inspection?
You have the same access you have to the prod one? ;)
ie, https://src.stg.fedoraproject.org/rpms/whatever
You should be able to git clone from them, or even push to them if you have commits on that package.
Sorry. I misunderstood.
A spot check of several affected (and non-affected) packages looks correct to me.
In the future, if we move to Forgejo for dist-git, we will want to just archive these repos somewhere and then push only the
refs/headscontent into the new hosting site, so we don't carry the broken commits forward. If Forgejo does any sanity checking on push the way that GitLab does, we wouldn't be able to import these repos anyway.I think we are in good shape here until then. Thanks!
OK, so now that this is verified, can we get this taken care of for PROD as well? The CentOS Stream team is in the process of doing the initial import over for RHEL 11 (they'll continue to sync automatically until the Fedora 46 branch) and these packages are still failing that import.
EDIT: For clarity, we import by pulling and pushing the individual branch, not the entire repository, so as long as this fix is in place, the CS 11 import will be unblocked.
Yes, it's on my list. no need to remind me. ;)
I will try and go do it now and get it over with...
ok. Should be synced now. Can you check some and confirm? Then we can close this if all looks well (after 2 years).
Should we send an announcement about it so maintainers know what happened?
@kevin wrote in #11822 (comment):
I just pulled
antlrand it still appears to be the old repository. I don't see the new archive refs either. Are you sure it synced to the public space?Yeah, we probably should. I don't know if it needs to go to devel or devel-announce; maybe just to the maintainer lists?
Doesn't seem synced yet, is there some caching in place?
No, no caching, something didn't sync right it seems, trying to figure out what. Theres serveral hops here...
script on my machine -> rsync output/ dir to batcave01 -> rsync output/ dir to pkgs01 -> for loop to rsync each bare/ repo to the bare/git ones.
trying to see where I went wrong.
Might have been a permissions issue? Does it look any better now?
Still not afaics.
I am confused here.
The archive refs are there?
I mean I rsynced the exact dirs from output/bare/ over them... do I need to run with --delete? but I didn't in stg.
The archive refs are supposed to be there (for now). It's how we ensure that the repo has retained all of the commits that have been used to create builds up to this point.
When we eventually move to a new forge, we will want to ONLY carry forward the new refs (probably by pulling and pushing individual branches rather than cloning the entire repository or else by doing a
git filter-repoagain and purging the archive refs).That being said... something definitely went wrong here:
Those should absolutely not be the same commit.
Let me see if I can figure out what went wrong with my script, or if the issue is on your end...
I just ran my script against
antlr:I then cloned the bare repo and inspected it:
I also note that
git refs listdoes not showrefs/archive/bademail/*, as expected.I therefore have to conclude that the copy over to the final location was performed in error.
It's not right on my laptop. I am not sure why... digging...
I just ran the script. I wonder if something changed in rawhide that broke things...
ok. I think I got it. It was the rsync.
Can you all look now?
Confirmed, looks good now. Thanks!
Hurray!
I'd say probibly devel-announce for the mail. Let me send something...
https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/AHLF3U4AMAPNUCD46FFTSB56OTRS4MFJ/
Many thanks @sgallagh !