Answer prose round 1: 0 🔴, 3 🟡 (0 misread); the docstrings claim head-pinning only where a call takes head, and the wait comments name the forge each covers
This commit is contained in:
@@ -1 +0,0 @@
|
||||
"""The forge a checkout's origin is on, GitHub or Gitea, and the calls to it that several tools make: `commands.py` tells the two apart and runs their CLIs, `pulls.py` finds a pull request and waits for its checks."""
|
||||
|
||||
@@ -5,10 +5,10 @@ import typing
|
||||
|
||||
from failure import Failure
|
||||
|
||||
# The CLI that talks to a forge: gh for a github.com origin, tea for any other.
|
||||
# The CLI of the forge that origin is on, as forge_of picks it.
|
||||
Forge = typing.Literal["gh", "tea"]
|
||||
|
||||
# Runs a command in the clone: what it printed, or a Failure with its reason.
|
||||
# Runs a command in the checkout: what it printed, or a Failure with its reason.
|
||||
Run = typing.Callable[[list[str]], str | Failure]
|
||||
|
||||
|
||||
|
||||
+3
-6
@@ -1,7 +1,4 @@
|
||||
"""Finding a pull request from origin's own branch, and waiting for its checks.
|
||||
|
||||
Each call is pinned to head, a commit on that branch: it takes only a pull request from origin itself whose head is that commit. So a fork's pull request from a branch of the same name is never taken.
|
||||
"""
|
||||
"""Finding a pull request from origin's own branch, and waiting for the checks on its head commit."""
|
||||
import fnmatch
|
||||
import time
|
||||
import typing
|
||||
@@ -9,9 +6,9 @@ import typing
|
||||
from failure import Failure
|
||||
from forge.commands import Forge, gitea, Run
|
||||
|
||||
# How long checks_passed waits between two reads of the head commit's status on Gitea.
|
||||
# How long checks_passed waits between two reads: of the head commit's status on Gitea, or of gh's watch while it reports no checks.
|
||||
POLL_SECONDS = 10
|
||||
# How long checks_passed waits for the checks before it gives up; CI took about 3 minutes in 2026-11.
|
||||
# How long checks_passed waits on Gitea for the checks before it gives up; CI took about 3 minutes in 2026-11. gh's watch waits as long as the checks run.
|
||||
WAIT_SECONDS = 30 * 60
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from forge.pulls import checks_passed, open_pull, POLL_SECONDS, required_checks, WAIT_SECONDS
|
||||
from forge.commands import forge_of, gitea
|
||||
from forge.commands import forge_of
|
||||
|
||||
|
||||
class ForgeOf(unittest.TestCase):
|
||||
@@ -17,7 +16,7 @@ class ForgeOf(unittest.TestCase):
|
||||
self.assertEqual(forge_of("https://gitea.larvit.se/o/r.git"), "tea")
|
||||
|
||||
|
||||
# An answer longer than the 200 characters a failure quotes of it, in a shape no call reads.
|
||||
# An answer no call can read, longer than the 200 characters of it that a failure quotes.
|
||||
LONG = "[" + ", ".join(["1"] * 100) + "]"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user