stubsabot: warn if stubtest won't test an update (#8681)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Alex Waygood
2022-09-04 21:56:58 +01:00
committed by GitHub
parent 8e4b89a707
commit eb6431c4cc

View File

@@ -12,6 +12,7 @@ import re
import subprocess
import sys
import tarfile
import textwrap
import urllib.parse
import zipfile
from dataclasses import dataclass
@@ -320,12 +321,27 @@ async def suggest_typeshed_update(update: Update, session: aiohttp.ClientSession
return
body = "\n".join(f"{k}: {v}" for k, v in update.links.items())
body += """
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
"""
stubtest_will_run = not meta.get("stubtest", {}).get("skip", False)
if stubtest_will_run:
body += textwrap.dedent(
"""
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
Note that you will need to close and re-open the PR in order to trigger CI
"""
)
else:
body += textwrap.dedent(
f"""
:warning: Review this PR manually, as stubtest is skipped in CI for {update.distribution}! :warning:
"""
)
await create_or_update_pull_request(title=title, body=body, branch_name=branch_name, session=session)