Skip to content

ci: fix failure with check_changed_aports when testing new aport

clayton craft requested to merge craftyguy/ci_fix into master

Apparently some callers of get_package_version expect it to return None if a package wasn't found... e.g. when CI is testing a branch that introduces a new aport and it's trying to get the upstream version for it, which doesn't exist.

This leads to a spectacular crash in CI:

  upstream = get_package_version(args, package, commit, False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/clayton/src/pmaports/./.ci/lib/check_changed_aports_versions.py", line 47, in get_package_version
    return parsed["pkgver"] + "-r" + parsed["pkgrel"]
           ~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

When I refactored this method in 07812a91 I goofed up and changed this behavior, so let's restore it to fix the crash.

cc @minlexx

Merge request reports