pregate: a missing pytest is PREGATE_LANE_FAILED (blames the diff), not PREGATE_ENVIRONMENT

オープン 初心者向け
#3,598 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@vilano93 がすでに取り組んでいます。

2026年10月30日 から。

  • #3639 @vilano93 による — オープン
  • #3741 @garrytan による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, typescript
領域
testing, tooling

調査の方向性

lib/pregate/checks/lanes.ts の detectRunner の pytest 分岐を読み、planRuns の pnpm/yarn、cargo、dart/flutter に対する PATH チェックと比較してください。Python は利用できるが pytest がない状態を再現し、その後、lane が PREGATE_LANE_FAILED ではなく PREGATE_ENVIRONMENT (missing-binary) を報告し、インストールするかリモートで実行するよう案内することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

S3

What happened

On a machine without pytest, gstack-pregate's lanes check blames the diff for it. A selected Python test runs as python3 -m pytest {files}. That exits 1 with No module named pytest, and the lane reports PREGATE_LANE_FAILED with "fix the in-branch failure". The test itself is fine: it is a unittest test, and python3 -m unittest passes it.

$ python3 -m unittest tests/test_alpha.py
OK
$ python3 -m pytest --version
/opt/homebrew/opt/[email protected]/bin/python3.15: No module named pytest

# upstream main, 1.91.311.0 (94165fff3)
$ gstack-pregate run --stage tests --only lanes --base origin/main --allow-repo-commands
...
    lanes: fix: read ~/.gstack/projects/repro-pytest/pregate/runs/…/lanes/lanes.log, fix the in-branch failure, rerun gstack-pregate --stage tests
PREGATE: fail tree=075ba803dd3a head=7ae1d5e297a9 checks=1
gstack-pregate: lanes: local lane exited 1 (? failed of ? ran; 1 files; pipefail); … (PREGATE_LANE_FAILED)

Expected: the same verdict a missing pnpm, cargo, dart or flutter gets: PREGATE_ENVIRONMENT (missing-binary), "install pytest on this machine and rerun, or run the lane remotely; the diff is not at fault". The machine is missing a tool; the diff did nothing wrong.

classifyCommandEnvironment can't catch this at run time: the command's binary is python3, which is on PATH, and No module named pytest is not a not-found line. planRuns already checks PATH before a run for pnpm/yarn (packageRunner), cargo (cargoRunner) and dart/flutter (dartRunner). The pytest branch of detectRunner (lib/pregate/checks/lanes.ts) does no such check.

Steps to reproduce

  1. A machine where python3 -m pytest fails with No module named pytest.
  2. A repo with no package.json and one committed test, tests/test_alpha.py:
    import unittest
    
    class T(unittest.TestCase):
        def test_a(self):
            self.assertEqual(1 + 1, 2)
    
  3. On a branch, change tests/test_alpha.py, then run gstack-pregate run --stage tests --only lanes --base origin/main --allow-repo-commands.

Found while fixing mixed .mjs + .py root selections, which today get no runner at all (PR follows). Once each language gets its own runner, the Python part hits this on such a machine. This issue is pre-existing and separate from that PR.

Readiness report

gstack doctor 1.91.275.0
ok              install root    ~/.claude/skills/gstack: claude global current (1.91.275.0)
ok              rescue refs     none in ~/.claude/skills/gstack
ok              state root      ~/.gstack durable=yes (selected by default)
ok              bun             1.4.3 at /opt/homebrew/bin/bun (floor 1.3.3, tested 1.4.2)
ok              hooks           9 hook(s) parse
ok              codex           codex-cli 0.164.0; self-locate ok; model gpt-6.1-sol (source: ~/.codex/config.toml model)
ok              codex probe     cached MODEL_OK, 17h ago (not re-run; --live probes now)
not configured  artifacts sync  off; cross-machine artifacts sync is unavailable
ok              browse bundle   browse/dist built
ok              binaries        find-browse, design, pdf, gstack-global-discover launch (4 of 4)
ok              cso             native helper 1.91.275.0 (f8d0ab033914)
ok              claude code     2.1.312 (Claude Code) at ~/.local/bin/claude
ok              session journal largest of 60: 36.3 MiB
ok              guard log       30 decisions (4 denied)
warn            CLAUDE.md       the gstack section in ~/.claude/CLAUDE.md lists 39 skills; …
13 ok, 1 warn, 1 not configured, 0 fail

The repro above was also run against upstream main (1.91.311.0), with the same result.

Environment

  • Host (Claude Code, Codex, Cursor, ...) and its version: Claude Code 2.1.312
  • OS: macOS 26.6.2, Python 3.15 (Homebrew), no pytest installed
主要言語
TypeScript
スター
138k
フォーク
20.5k
平均マージ
9時間 4分
マージ済み PR(30日)
364

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

garrytan/gstack のほかの issue

garrytan/gstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。