#1060371 git-buildpackage: feature request: gbp sync

#1060371#5
Date:
2024-01-10 07:06:05 UTC
From:
To:
Hi!

I frequently find myself doing manual work comparing if my local git
repository contents and tags are correct and in sync with the git
remotes and the Debian and Ubuntu archives.

I am worried about mistakes such as:

- A maintainer tagged and uploaded but forgot to push it to remote git
repositories

- Maintainer git tagged a version that failed to upload, and then
forgot to delete and re-tag after fix and new upload attempt, or I did
locally fix the tag to point to correct contents put forgot to force
push updated tag to git remotes

- Somebody else than the regular maintainer uploaded but didn't push
to git and git repository content is behind Debian/Ubuntu apt
repositories

- Somebody (e.g. Ubuntu sponsor) modified the package before upload,
and git repository diverges from apt repository


To automatically detect (and perhaps even fix) these situations I
propose git-buildpackage adds a feature 'gbp sync' which would roughly
have this logic:

1. Traverse past 8 or so debian/changelog entries, extract
Debian/Ubuntu release name and version and check if equivalent git
tags exist locally.

2. Compare to remotes and warn if any tags are missing locally, or
remotes have more tags than local, or tags point to different commits.

3. Check from equivalent apt repositories (including -security,
-updates, -proposed-updates) what versions they have and warn if apt
repositories have releases missing from the debian/changelog, or if
past local changelog entries seems to never have reached any apt
repository.

4. While doing the above, also download the . dsc files to a local
temporary directory. Using the checksums in the .dsc files verify that
the apt repository .debian.tar checksum matches what the locally
tagged git commit debian/ contents would produce. This verifies the
uploaded version actually is the same as in the gbp tag.

5. If everything matches, emit a success message. If not, tell users
what is out of sync and ask the user (maintainer) to manually fix and
validate fixes by rerunning 'gbp sync'.


This could also be a separate tool, but since git-buildpackage has
such an extensive test suite and mature code base, and the tool would
operate off the semantics of gbp.conf seems this could be an useful
extension to git-buildpackage.

- Otto

#1060371#10
Date:
2024-01-10 08:43:23 UTC
From:
To:
Hi,

…skipping binNMUs ?

I agree that this sort of validation/fix would make sense.

Somewhat related is /usr/share/doc/git-buildpackage/examples/gbp-upload
which helps to ensure that tags end up in the blessed repo when doing an
upload.

Cheers,
 -- Guido

#1060371#15
Date:
2024-01-10 15:00:39 UTC
From:
To:
...

The "spec" I drafted probably forgot some more cases as well, hence
good to have a issue open for a while to collect feedback/ideas to
further refine the logic and capture corner cases :)

..

Thanks for pointing it out, I hadn't read that and other scripts at
https://github.com/agx/git-buildpackage/tree/master/examples before.

Currently in my own workflow I gbp tag and push tags only after the
ftp-master confirmation email arrives and I know the upload was
accepted, so the gbp-upload script is a bit too simplistic for my use.
In general however I am hugely in favour of automatic recurring,
mechanical and error prone Debian packaging work steps like these so
DDs can focus their time on more complex cases. I hope I can
contribute something useful to git-buildpackage.

Thanks Guido for coming up with gbp in the first place! I have been
using it with all of my packages for almost 8+ years now.

#1060371#20
Date:
2024-03-30 20:26:56 UTC
From:
To:
Today I filed https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/342
("Detect missing tags: force maintainer to continue tagging upload
commits if it was done before") which would be easy to implement if
something like `gbp sync` already existed.

#1060371#25
Date:
2025-05-04 21:18:42 UTC
From:
To:
See also related:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931314
gbp: Doesn't check if the vcs is current before importing

https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/439
Check for upstream tarball checksum mismatch

https://salsa.debian.org/debian/debcraft/-/issues/19
Can debcraft/gbp detect I forgot to pull from Salsa?