Treat pre-existing dependency issues as warnings (exit code 0)
All checks were successful
AI Code Review / ai-review (pull_request_target) Successful in 17s
CI via Tox / tox (pull_request) Successful in 1m40s

When we notice a pre-existing dependency issue, it seems strange
to exit non-zero, since the update being tested didn't break
anything new. Let's just treat it more like a warning. Let's exit
0 in this case as there's no 'warning' exit code; the pipelines
can use the JSON output to report an INFO or WARN result.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2026-06-13 10:04:50 +02:00
commit bd1af29d84
3 changed files with 9 additions and 10 deletions

View file

@ -316,14 +316,6 @@ def parse_display_exit(
else:
format_rc_errors(newrc, form="strip")
exitcode += 2
if preexisting:
if dojson:
jsonout["installability_preexisting"] = [list(err) for err in preexisting]
else:
print("")
print("Pre-existing dependency problems in the tested packages themselves:")
format_rc_errors(preexisting)
exitcode += 4
if fixederrors:
if dojson:
jsonout["fixederrors"] = [list(err) for err in fixederrors]
@ -331,6 +323,13 @@ def parse_display_exit(
print("")
print(f"Dependencies of other packages that would be FIXED by {iut}:")
format_rc_errors(fixederrors)
if preexisting:
if dojson:
jsonout["installability_preexisting"] = [list(err) for err in preexisting]
else:
print("")
print("Warning: pre-existing dependency problems in the tested packages themselves:")
format_rc_errors(preexisting)
if dojson:
json.dump(jsonout, sys.stdout, indent=4)
sys.stdout.write("\n")

View file

@ -421,7 +421,7 @@ class TestE2E:
sys.argv.insert(1, "--json")
with pytest.raises(SystemExit) as excinfo:
repos.main()
assert excinfo.value.code == 4
assert excinfo.value.code == 0
captured = capsys.readouterr()
if output == "human":
fname = "test_e2e_unfixed.txt"

View file

@ -1,4 +1,4 @@
Pre-existing dependency problems in the tested packages themselves:
Warning: pre-existing dependency problems in the tested packages themselves:
package: ddd-3.0-1.x86_64 from file://{REPOS}/unfixed
ccc = 3.0