Draft: CI: aports version check: modernize with new rules
Current state:
- Please review the logic in the graph below. Does it cover all cases? ** EDIT 2022-11-11: Luca found pkgver=9999 case missing, added it
- Contains all commits from !3608 (merged) and still has a bug (see todos below), code review can be done later
Description:
Update the script once more with the goal that we no longer need to comment on pkgrel/pkgver bumps. Parse not only the version of the old and new package, but also the checksums and remote sources.
Replace the previous check of simply having $pkgver-r$pkgrel
higher
than the upstream APKBUILD with more detailed rules:
APKBUILD has remote sources? ------> Did sha512sums change?
| No | |
| Yes | No | Yes
v | v
Did the file name of a remote | * Increase pkgver
source change? ----. | * Set pkgrel=0
| | |
| Yes | No |
v v v
Is pkgver=9999? -----> * Don't change pkgver
(Forked from Alpine) Yes * Bump pkgrel by 1
|
| No
v
* Set the pkgver to the version
of the source tarball
* Set pkgrel=0
Besides the new rules, print a detailed error message below each package where the test failed that explains exactly what was expected and what the reasoning behind that is. Also add a hint that users can run this locally with 'pmbootstrap ci' now.
Use logging instead of print, so we get colored ERROR: and NOTE: statements from pmbootstrap code, this should make it easier to read.
TODO:
-
extend the graph: maintainer change (needs pkgrel bump as metadata changed), _pmb_recommends change (no pkgrel bump, pmbootstrap just reads the APKBUILD) -
implement these in the check
-
-
FIXME: to check whether a file is remote or not, a glob must be used since the filenames mentioned in sha512sums may be in a subdir -
put this in the wiki at https://postmarketos.org/howto-bump-pkgrel-pkgver once somebody reviewed the logic above -
also add Q&A about "can I bump pkgrel multiple times in one patchset/MR? -> no / if you REALLY want to then use ci:skip-build"
-
-
verify all code paths work as expected -
get !3608 (merged) on which this depends merged first -
make a pmbootstrap release, so 'pmbootstrap ci' mentioned on error is actually available to users (currently only in master branch)
Edited by Administrator