Page MenuHomePhabricator

scap3 upstream/debian versioning
Closed, ResolvedPublic

Description

[from https://phabricator.wikimedia.org/T127762#2054924]

also going forward we should make more obvious what's the process to bump versions, ATM setup.py version is never changed, IOW we're assuming scap3 will be only distributed via debian packages.

Event Timeline

From T127762#2053246

* 91cdbe4 - (HEAD -> master, origin/master, origin/HEAD) Add coverage for current link replacement (Mon Feb 22 17:13:56 2016 -0800) <Dan Duvall>
| * e786a9b - (tag: 3.0.2) Update changelog for bugfix package bump (Mon Feb 22 13:25:00 2016 -0800) <Tyler Cipriani>
|/  
* 2332ad0 - Treat linked dirs as link target as normal file (Mon Feb 22 12:49:16 2016 -0800) <Tyler Cipriani>
* 603ef0c - Only sudo when actually necessary (Mon Feb 22 11:54:54 2016 -0800) <Dan Duvall>
* a593285 - Compare cdb mtimes less granularly (Fri Feb 19 14:07:32 2016 -0800) <Tyler Cipriani>
* 2a2a5b5 - Default to the effective user in scap.Context (Mon Feb 15 10:50:56 2016 -0800) <Dan Duvall>
* 8289e30 - (tag: debian/3.0.1-1) I incorrectly tagged 3.0.1, updating changelog again (Mon Feb 15 09:12:47 2016 -0600) <Mukunda Modell>
* 31727c0 - updated changelog. (Mon Feb 15 06:03:47 2016 -0600) <Mukunda Modell>
* c3d4de8 - (tag: 3.0.1) Add refreshCdbJsonFiles to the scap.deb package (Fri Feb 12 12:10:42 2016 -0600) <Mukunda Modell>
* 2d4b633 - Socket has no fqdn method (Thu Feb 11 14:42:31 2016 -0800) <Tyler Cipriani>
* d836f57 - Canonicalize host names when excluding hosts (Thu Feb 11 12:52:29 2016 -0800) <Dan Duvall>
* 459247b - (tag: debian/3.0-1, tag: 3.0) Remove `git_repo_user` configuration (Fri Jan 29 10:35:23 2016 -0800) <Dan Duvall>

Yup 3.0.2 tag is a fork of master apparently.

Looking at scap, it lacks a configuration file for git-buildpackage debian/gbp.conf so it will end up using the master for the Debian branch but build the tarball from the tag. Note how there is a debian/3.0.1-1 which is potentially recognized by gbp out of the box. It has:

--git-debian-tag=DEBIAN_TAG
                    Format string for debian tags, default is
                    'debian/%(version)s'

@godog @20after4 filled a task to get the .deb package to be build automatically on merge by Jenkins and pushed to aptly: T127741

dduvall triaged this task as Medium priority.Mar 4 2016, 6:29 PM
dduvall moved this task from Needs triage to Debt on the Scap board.

see also D166 for default gbp options

Is there anything else that ought to be done here?

debian/changeloggit tag
3.2.0-1debian/3.2.0-1
3.1.0-13.1.0
3.0.3-13.0.3
3.0.2-1no tag
3.0.1-13.0.1 and debian/3.0.1-1
3.0.13.0.1
3.0-13.0 and debian/3.0-1

debian/gbp.conf has:

git-upstream-tag = '%(version)s'

The git- prefix causes it to not be recognized so:

diff --git a/debian/gbp.conf b/debian/gbp.conf
index ff82da4..0b88c64 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -1,2 +1,2 @@
 [buildpackage]
-git-upstream-tag = '%(version)s'
+upstream-tag = '%(version)s'

Potentially one could just merge debian and upstream versioning all together, i.e. without any tag prefix. With the following gbp.conf:

[buildpackage]
upstream-tag = '%(version)s'
debian-tag = '%(version)s'

This way for the next minor version one would bump debian/changelog to 3.3.0 and tag 3.3.0. From there:

  • if later commits are just about debian one would tag and bump changelog to 3.3.0-1
  • if code got introduced switch to 3.3.1

Alternatively

[buildpackage]
upstream-tag = '%(version)s'

Whenever one tag new code, a corresponding debian/ tag would have to be created most probably pointing to same commit or a commit that just bump the changelog. So potentially you would have:

  • (tag: debian/3.3.0-1) Debian package (changelog update)
  • (tag: 3.3.0) Bump setup.py for 3.3.0

If later changes just tweak debian/ , just create a debian/ tag:

  • (tag: debian/3.3.0-2) Fix up whatever in package
  • (tag: debian/3.3.0-1) Debian package (changelog update)
  • (tag: 3.3.0) Bump setup.py for 3.3.0

But most probably you would have new code introduced already which would need a new minor version. So the first possibility (unify upstream and debian tag) is probably easier.

thanks @hashar for the overview! I think I prefer the latter, namely keep debian packaging and upstream separate.
So upon a new version is released e.g. 3.2.1:

  • change version in setup.py and tag 3.2.1
  • dch -v 3.2.1-1 -m "New upstream version"
  • gbp buildpackage -us -uc
  • once happy with the result, gbp buildpackage --git-tag-only

thanks @hashar for the overview! I think I prefer the latter, namely keep debian packaging and upstream separate.

+1

thcipriani claimed this task.

thanks @hashar for the overview! I think I prefer the latter, namely keep debian packaging and upstream separate.
So upon a new version is released e.g. 3.2.1:

  • change version in setup.py and tag 3.2.1
  • dch -v 3.2.1-1 -m "New upstream version"
  • gbp buildpackage -us -uc
  • once happy with the result, gbp buildpackage --git-tag-only

Done!

Made some small tweaks to debian/gbp.conf for v.3.2.1 and everything seems to be working.

Thanks @hashar and @fgiunchedi!