Drop generation of debian/watch for GitHub projects and use Archive instead#300
Drop generation of debian/watch for GitHub projects and use Archive instead#300ottok wants to merge 1 commit intoDebian:masterfrom
Conversation
|
I think this makes uscan misbehave when upstream does not tag releases. I built this branch locally and tried |
|
does this change break tracker.d.o detection of new upstream versions? |
|
@coldtobi: This is a standard feature in uscan now and hence everything uscan does should continue to work, inluding upstream new version detection. @guilherme-puida: Thanks for testing! Indeed the uscan v5 code path here is not working, I will test more this use case. |
|
After some more thought, I think I disagree that the watch file is redundant. It needs to exist when:
Wouldn't it be better to still generate |
|
Actually the v5 template does not support checking neither signed tags nor detached signatures, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118381 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118383 There are 3 options:
I am maybe leaning on option 3 now.. |
|
IMO your option 2. looks nice, but using So I would simply keep the generated watch files as they are, but update them to version 5 and switch to Github templates, and maybe simplify them a bit, for example using IIRC currently the watch file is only generated for Github upstream right? |
Yes, the |
|
In a package where I track git HEAD I have now: In another package I noticed the uversion-mangle has to be defined, the template alone isn't enough: |
|
I switched the implementation to create a Context: |
When `dh-make-golang` generates source packages for new packages, it should use the new uscan v5 by default. Update the template syntax to use v5 and simplify a bit to the extent new features in v5 allows. While it would be possible to not generate any `debian/watch` file at all, as in devscripts since 2.25.19 uscan automatically discovers GitHub upstream tarballs when `debian/upstream/metadata` contains the `Archive: GitHub` and `Repository` fields, there is often cases where maintainers need to tweak the uscan settings and thus having an explicit watch file feels overall as a more uniform and handier default setup for now.
| // If upstream release was repacked, use suffix '+ds1' to continue the Go | ||
| // team's historical convention despite uscan man page stating '+dfsg' as | ||
| // primary option. |
There was a problem hiding this comment.
I think this comment is a little bit misleading: +ds and +dfsg serve different purposes and I don't think +dfsg is stated as a "primary option" anywhere.
There was a problem hiding this comment.
Here is the reasoning according to debian-watch(5):
+dfsgis used when some non-free files are removed
+dsis used when some files are removed for another reason (useless,...).
+repackis used when source was re-downloaded without version number change
| fmt.Fprint(f, `" \`+"\n") | ||
| fmt.Fprintf(f, ` https://%s/%s/%s/tags .*/v?(\d\S*)\.tar\.gz debian`+"\n", host, owner, repo) | ||
| log.Printf("Setting debian/watch to fetch the GitHub release tarball") | ||
| fmt.Fprint(f, "Version: 5\n") |
| fmt.Fprint(f, "#Pgp-Mode: gittag\n") | ||
|
|
||
| // Anticipate that upstream would eventually switch to tagged releases | ||
| fmt.Fprint(f, "\n") |
There was a problem hiding this comment.
This breaks current uscan (2.26.6) AFAICT. With a d/watch file like this:
Version: 5
Mode: git
Source: https://github.com/tscholl2/siec.git
Matching-Pattern: HEAD
# Enable verifying git tags are signed if upstream uses them:
#Pgp-Mode: gittag
# Use the following when upstream starts to tag releases:
#
#Template: GitHub
#Dist: https://github.com/tscholl2/siec
This is the output of uscan --report-status
uscan info: Scan watch files in .
uscan info: Check debian/watch and debian/changelog in .
uscan info: package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61-1" (as seen in debian/changelog)
uscan info: package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61" (no epoch/revision)
uscan info: ./debian/changelog sets package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61"
uscan info: Process watch file at: debian/watch
package = golang-github-tscholl2-siec
version = 0.0~git20240310.c2c6f61
pkg_dir = .
uscan warn: The following paragraph isn't well formatted, skipping it: << ==EOF==
# Use the following when upstream starts to tag releases:
#
#Template: GitHub
#Dist: https://github.com/tscholl2/siec
==EOF==
uscan info: Scan finished
If we remove the empty line it works fine:
uscan info: Scan watch files in .
uscan info: Check debian/watch and debian/changelog in .
uscan info: package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61-1" (as seen in debian/changelog)
uscan info: package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61" (no epoch/revision)
uscan info: ./debian/changelog sets package="golang-github-tscholl2-siec" version="0.0~git20240310.c2c6f61"
uscan info: Process watch file at: debian/watch
package = golang-github-tscholl2-siec
version = 0.0~git20240310.c2c6f61
pkg_dir = .
uscan info: Parsing mode: git
uscan info: Last orig.tar.* tarball version (from debian/changelog): 0.0~git20240310.c2c6f61
uscan info: Last orig.tar.* tarball version (dversionmangled): 0.0~git20240310.c2c6f61
Cloning into bare repository '../golang-github-tscholl2-siec-temporary.6087.git'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 37 (delta 5), reused 13 (delta 2), pack-reused 0 (from 0)
Receiving objects: 100% (37/37), 66.94 KiB | 979.00 KiB/s, done.
Resolving deltas: 100% (5/5), done.
uscan info: uscan parser results:
$base = https://github.com/tscholl2/siec.git
$filepattern = HEAD
$newfile = HEAD
$mangled_newversion = 0.0~git20240310.c2c6f61
$newversion = 0.0~git20240310.c2c6f61
$lastversion = 0.0~git20240310.c2c6f61
uscan info: Upstream URL(+tag) to download is identified as https://github.com/tscholl2/siec.git HEAD
uscan info: Filename (filenamemangled) for downloaded file: golang-github-tscholl2-siec-0.0~git20240310.c2c6f61.tar.xz
uscan info: Newest version of golang-github-tscholl2-siec on remote site is 0.0~git20240310.c2c6f61, local version is 0.0~git20240310.c2c6f61
uscan info: => Package is up to date from:
=> https://github.com/tscholl2/siec.git HEAD
uscan info: Removing git repo (../golang-github-tscholl2-siec-temporary.6087.git)
uscan info: Scan finished
In devscripts since 2.25.19 uscan automatically discovers GitHub upstream tarballs when debian/upstream/metadata contains the
Archive: GitHubandRepositoryfields. Since dh-make-golang already writes this file and only supports GitHub-hosted projects, the watch file is now redundant.Removing it avoids maintenance overhead and confusion for new maintainers who might otherwise believe the file is required.
This also prevents Lintian from nagging about watch file format v4.