8000 stubsabot: Add a warning to the PR message if stubtest is skipped for a distribution by AlexWaygood · Pull Request #8681 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

stubsabot: Add a warning to the PR message if stubtest is skipped for a distribution #8681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions scripts/stubsabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import subprocess
import sys
import tarfile
import textwrap
import urllib.parse
import zipfile
from dataclasses import dataclass
Expand Down Expand Up @@ -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)


Expand Down
0