Stop trying when codecov replies with Too many uploads to this commit

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-12-04 16:40:44 +00:00
parent 90a3cbed44
commit e242ae3bf2
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -1214,8 +1214,22 @@ def upload_coverage(ctx: Context, reports_path: pathlib.Path, commit_sha: str =
"--flags",
flags,
check=False,
capture=True,
)
stdout = ret.stdout.strip().decode()
stderr = ret.stderr.strip().decode()
if ret.returncode == 0:
ctx.console_stdout.print(stdout)
ctx.console.print(stderr)
break
if (
"Too many uploads to this commit" in stdout
or "Too many uploads to this commit" in stderr
):
# Let's just stop trying
ctx.console_stdout.print(stdout)
ctx.console.print(stderr)
break
if current_attempt >= max_attempts: