Merge ~racb/git-ubuntu:fix-build-version-comparison into git-ubuntu:master

Proposed by Robie Basak
Status: Merged
Merged at revision: d13680cf5787e4cf6939c60ce71fd089a4c66d0a
Proposed branch: ~racb/git-ubuntu:fix-build-version-comparison
Merge into: git-ubuntu:master
Diff against target: 21 lines (+2/-1)
1 file modified
gitubuntu/build.py (+2/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Bryce Harrington Approve
Review via email: mp+397998@code.launchpad.net

Commit message

Make Jenkins happy

Description of the change

I couldn't reproduce Bryce's original issue (https://bugs.launchpad.net/usd-importer/+bug/1868631/comments/3) but here's the fix for the obvious bug he pointed out.

Since there are no tests, I wonder if Bryce could reproduce the failure and verify that this fixes it correctly, without introducing any new issues?

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

(this isn't strictly bug 1868631 but a different root cause so I'm not closing that bug from here)

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:133c4f1e0a624b04b272bc4dbd648465f8ff9875
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/8/
Executed test runs:
    SUCCESS: VM Setup
    FAILED: Build

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/8//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Bryce Harrington (bryce) wrote :

I can reproduce the original issue, but jenkins seems not responding for some reason so couldn't test against the snap.

However I dummied up a test to verify the proposed fix should work:

from gitubuntu.versioning import Version

if __name__ == '__main__':
    spi_upstream_version = '6.4.15'
    changelog_version = '6.4.5-1ubuntu1'

    if spi_upstream_version < changelog_version:
        print("spi_upstream_version < changelog_version")
        print(" %s < %s" %(spi_upstream_version, changelog_version))
    else:
        print("spi_upstream_version >= changelog_version")
        print(" %s >= %s" %(spi_upstream_version, changelog_version))

    if Version(spi_upstream_version) < Version(changelog_version):
        print("Version(spi_upstream_version) < Version(changelog_version)")
        print(" Version(%s) < Version(%s)" %(spi_upstream_version, changelog_version))
    else:
        print("Version(spi_upstream_version) >= Version(changelog_version)")
        print(" Version(%s) >= Version(%s)" %(spi_upstream_version, changelog_version))

with output as:

fetchmail-fix-c2035-hirsute+21.04:~/src/GitUbuntu/usd-importer$ ./bin/test-fix
spi_upstream_version < changelog_version
  6.4.15 < 6.4.5-1ubuntu1
Version(spi_upstream_version) >= Version(changelog_version)
  Version(6.4.15) >= Version(6.4.5-1ubuntu1)

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:d13680cf5787e4cf6939c60ce71fd089a4c66d0a
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/22/
Executed test runs:
    SUCCESS: VM Setup
    SUCCESS: Build
    SUCCESS: VM Reset
    SUCCESS: Unit Tests
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/22//rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitubuntu/build.py b/gitubuntu/build.py
2index 4606a6c..8b006a8 100644
3--- a/gitubuntu/build.py
4+++ b/gitubuntu/build.py
5@@ -46,6 +46,7 @@ from gitubuntu.source_information import (
6 derive_codename_from_series,
7 )
8 from gitubuntu.test_util import get_test_changelog
9+from gitubuntu.versioning import Version
10 from debian.debfile import PART_EXTS
11 import petname
12 import pygit2
13@@ -340,7 +341,7 @@ def fetch_orig_from_launchpad(changelog, source, pullfile, retries,
14 spi.version,
15 changelog.upstream_version,
16 )
17- if spi.upstream_version < changelog.upstream_version:
18+ if Version(spi.upstream_version) < Version(changelog.upstream_version):
19 logging.info(
20 "New upstream version detected (%s) which is after the last "
21 "published upstream version (%s).",

Subscribers

People subscribed via source and target branches