Answer stability round 1: 0 🔴, 4 🟡 (0 misread); a chunk window is handed the two XDG variables, rule-hook's checks are tested under them, and three tests stop passing the developer's
CI / tests (pull_request) Successful in 5m16s
CI / tests (pull_request) Successful in 5m16s
This commit is contained in:
@@ -6,7 +6,7 @@ import pathlib
|
||||
import typing
|
||||
|
||||
from do_epic.epic_record import CAP
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, HANDED, loop_chunks, project_lock, starting
|
||||
from chunk_driver.claims import CHUNK_FLAG, epic_chunks, handed, loop_chunks, project_lock, starting
|
||||
from do_epic.backend.protocol import EpicIssue
|
||||
from failure import Failure
|
||||
from do_epic.split import finished, is_split, SPLIT_LABEL
|
||||
@@ -225,10 +225,10 @@ def start_chunks(epic: Epic, issues: list[EpicIssue], finishing: bool, own: str
|
||||
def start_chunk(epic: Epic, chunk: Chunk, own: str | None, windows: list[tmux.Listed], run: tmux.Tmux) -> list[tmux.Listed] | Waits | Failure:
|
||||
"""Starts chunk's window beside windows, the epic's session's, and returns the session's windows afterwards; a Waits with the reason where its repo takes no chunk now, and a Failure where tmux started none, or where the repo's lock cannot be taken. It holds that lock from the check to the start. A chunk without a repo starts in the epic's folder. So does a parked chunk, since it takes no room in its repo."""
|
||||
session = tmux.session_name(tmux.EPIC, epic.key)
|
||||
handed = {**{name: value for name, value in epic.env.items() if name.startswith(HANDED)}, PARKS: "1"}
|
||||
env = {**handed(epic.env), PARKS: "1"}
|
||||
command = [str(epic.launcher), CHUNK_FLAG, chunk.issue, epic.key]
|
||||
if chunk.repo is None:
|
||||
return tmux.start_chunk(tmux.Window(session, chunk.issue, ""), str(epic.folder), handed, command, windows, False, run)
|
||||
return tmux.start_chunk(tmux.Window(session, chunk.issue, ""), str(epic.folder), env, command, windows, False, run)
|
||||
located = epic.locate(chunk.repo)
|
||||
if isinstance(located, Failure):
|
||||
return Waits(chunk.issue, located.reason)
|
||||
@@ -238,7 +238,7 @@ def start_chunk(epic: Epic, chunk: Chunk, own: str | None, windows: list[tmux.Li
|
||||
return unlocked
|
||||
if reason := refusal(chunk.repo, room_in(str(checkout), limit, (session, own), epic.paths.home, run)):
|
||||
return Waits(chunk.issue, reason)
|
||||
return tmux.start_chunk(tmux.Window(session, chunk.issue, ""), str(checkout), handed, command, windows, False, run)
|
||||
return tmux.start_chunk(tmux.Window(session, chunk.issue, ""), str(checkout), env, command, windows, False, run)
|
||||
|
||||
|
||||
def room_in(checkout: str, limit: int, leaving: tuple[str, str | None], home: pathlib.Path, run: tmux.Tmux) -> RepoRoom:
|
||||
|
||||
Reference in New Issue
Block a user