Handle altool failures with returncode 0#478
Conversation
| Find the last JSON from given STDOUT which matches Altool result schema | ||
| """ | ||
|
|
||
| json_patt = re.compile(r"^\s*\{.*\}\s*$", re.MULTILINE | re.DOTALL) |
There was a problem hiding this comment.
I am not sure about the need of this regex.
It seems like json.loads and AltoolResult.create are enough validation. do you add it just as a quick check to improve performance or are there any hidden thing I am not seeing?
There was a problem hiding this comment.
This is a good point. json.loads will do validation on its own anyway, rendering the regex check useless.
And running some benchmarks revealed that with "good" cases where the JSON result is right in the end of the log there is no speedup, however in case of a big enough log (~2000 lines) which contains no valid result, then there is a slowdown when using regex check.
fran-tirapu
left a comment
There was a problem hiding this comment.
🚀
Nice job adding mocks to test all possible scenarios with legacy and current versions of the tool.
The problem
This pull request addresses an issue where the
app-store-connect publishcommand could incorrectly report a successful completion despite the App Store Connect publishing action failing.A recent version of the
altool(bundled with Xcode 26), exhibits unreliable behavior: it may return a successful exit code (0) even when the submission or publishing action has failed on the App Store Connect side. See also PR #476.This behavior bypasses our existing error handling, leading to an issue where a successful publishing is reported although publishing actually had failed.
Fix
To improve error reporting this PR implements a new error detection mechanism:
altoolreturn code.The changes proposed here include crucial updates to handle output from recent
altoolversions:altoolversions.Updated actions
app-store-connect publish