Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email )
Change subject: OBS: don't downgrade version in debian/changelog
......................................................................
Patch Set 1:
(1 comment)
File scripts/obs/lib/debian.py:
https://gerrit.osmocom.org/c/osmo-ci/+/34395/comment/94bc88d0_629d636f
PS1, Line 101: if packaging.version.parse(version_changelog.split("-")[0]) > \
> isn0t this going to crash if you didn't successfuly import packaging. […]
This function only gets used after lib.check_required_programs() gets called, which ensures that the packaging python module is there.
The try...except logic is to make the startup work on our jenkins:
1. ./update_obs_project.py --docker … runs outside of docker
2. it imports scripts/obs/lib/debian.py and other scripts outside of docker, here it would fail without try...except
3. it runs the script inside a docker container
4. there the import works, does not go into the except code path
5. lib.check_required_programs() runs, ensures that the python library is there
6. changelog_add_entry_if_needed() runs
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I550ed10a60c863626d870e35034028f0bd066211
Gerrit-Change-Number: 34395
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 12 Sep 2023 15:40:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email )
Change subject: OBS: don't downgrade version in debian/changelog
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File scripts/obs/lib/debian.py:
https://gerrit.osmocom.org/c/osmo-ci/+/34395/comment/cfa283cd_0de6c980
PS1, Line 101: if packaging.version.parse(version_changelog.split("-")[0]) > \
isn0t this going to crash if you didn't successfuly import packaging.version? You probably need to add an exception handling here?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I550ed10a60c863626d870e35034028f0bd066211
Gerrit-Change-Number: 34395
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 12 Sep 2023 15:36:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email )
Change subject: OBS: don't downgrade version in debian/changelog
......................................................................
OBS: don't downgrade version in debian/changelog
Fix the bug that the version in debian/changelog could get lowered if a
release was made and the release git tag was not pushed yet.
Fixes: OS#6173
Change-Id: I550ed10a60c863626d870e35034028f0bd066211
---
M scripts/obs/data/build_srcpkg.Dockerfile
M scripts/obs/lib/config.py
M scripts/obs/lib/debian.py
3 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/95/34395/1
diff --git a/scripts/obs/data/build_srcpkg.Dockerfile b/scripts/obs/data/build_srcpkg.Dockerfile
index 75482bc..5475a94 100644
--- a/scripts/obs/data/build_srcpkg.Dockerfile
+++ b/scripts/obs/data/build_srcpkg.Dockerfile
@@ -18,6 +18,7 @@
libxml2-utils \
meson \
osc \
+ python3-packaging \
python3-setuptools \
rebar3 \
sed \
diff --git a/scripts/obs/lib/config.py b/scripts/obs/lib/config.py
index 038122b..3a3e9ad 100644
--- a/scripts/obs/lib/config.py
+++ b/scripts/obs/lib/config.py
@@ -25,6 +25,7 @@
]
required_python_modules = [
+ "packaging",
"setuptools",
]
diff --git a/scripts/obs/lib/debian.py b/scripts/obs/lib/debian.py
index 8a82e16..2995185 100644
--- a/scripts/obs/lib/debian.py
+++ b/scripts/obs/lib/debian.py
@@ -7,6 +7,13 @@
import lib
import lib.git
+# Imports that may not be available during startup, ignore it here and rely on
+# lib.check_required_programs() checking this later on (possibly after the
+# script executed itself in docker if using --docker).
+try:
+ import packaging.version
+except ImportError:
+ pass
def control_add_depend(project, pkgname, version):
""" :param pkgname: of the meta-package to depend on (e.g. osmocom-nightly)
@@ -89,6 +96,16 @@
""" Adjust the changelog if the version in the changelog is different from
the given version. """
version_changelog = get_last_version_from_changelog(project)
+
+ # Don't use a lower number (OS#6173)
+ if packaging.version.parse(version_changelog.split("-")[0]) > \
+ packaging.version.parse(version.split("-")[0]):
+ print(f"{project}: WARNING: version from changelog"
+ f" ({version_changelog}) is higher than version based on git tag"
+ f" ({version}), using version from changelog (git tag not pushed"
+ " yet?)")
+ return
+
if version_changelog == version:
return
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/34395?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I550ed10a60c863626d870e35034028f0bd066211
Gerrit-Change-Number: 34395
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange