Skip to content

Commit 27272dd

Browse files
committed
only warn about unexpected responses from gh CLI
1 parent 3e89ed0 commit 27272dd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Export `UV_PROJECT_ENVIRONMENT` when `--uv-venv` is set so that `uv sync` targets the correct virtual environment instead of ignoring it.
13+
- Only warn when we get an unexpected response from the GitHub CLI.
1314

1415
## [v3.5.1](https://github.com/allenai/beaker-gantry/releases/tag/v3.5.1) - 2026-03-02
1516

gantry/commands/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def main(quiet: bool = False, check_for_upgrades: bool | None = None, log_level:
104104
format="%(message)s",
105105
handlers=[utils.RichHandler()],
106106
)
107+
logging.captureWarnings(True)
107108

108109
# Handle SIGTERM just like KeyboardInterrupt
109110
signal.signal(signal.SIGTERM, handle_sigterm)

gantry/git_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,7 @@ def from_env(cls, ref: str | None = None, branch: str | None = None) -> GitRepoS
313313
f"Unexpected response from the GitHub API while validating git ref '{git_ref}' on remote:\n"
314314
f"{res.stdout}\n{res.stderr}"
315315
)
316-
if is_running_in_gantry_batch_job():
317-
warnings.warn(msg, RuntimeWarning)
318-
else:
319-
raise RuntimeError(msg)
316+
warnings.warn(msg, RuntimeWarning)
320317

321318
# Resolve branch.
322319
branch_name: str | None = branch

0 commit comments

Comments
 (0)