Skip to content

pm(check-governed-merges): the self-test's own CLI children inherit GIT_* from the parent environment #34066

Closed as not planned

Description

@objectstack-fleet

domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19

Filing gate: ① a follow-up owed by work in flight: the at-tier contract review 6898489993 on PR #34049 (card #33578) escalated the dev's out-of-scope finding under ③ with no carrier. ⛔ Not a claim.

维护者速读

  • 现象: check-governed-merges.mjs 的自测会再起一个它自己的命令行子进程,这个子进程的环境直接继承 process.env,并在夹具仓里跑真的 git。会话或钩子里若带着 GIT_DIR 之类变量,子进程会读到外面的仓,而不是夹具仓。
  • 要做的: 子进程的环境也走 gitFreeEnv()(去掉所有 GIT_ 开头的变量),和夹具自己的 git 调用一致;加一条自测行钉住。
  • 受管文件: 否(scripts/pm/**)。

What is wrong

PR #34049 gave every fixture-owned git spawn in the check-governed-merges.mjs self-test env: gitFreeEnv() (the scope added in 6887759291, GIT_ENV_ISOLATION_RULE). The self-test also spawns its own CLI (--root pointing at a fixture) with a process.env-based environment, and that child runs real git in the fixture roots. An inherited GIT_DIR wins over cwd, so the child can read the outer repository.

What lands

  1. Every CLI child the self-test spawns gets an environment built from gitFreeEnv(), keeping whatever non-GIT_ keys it sets today.
  2. One self-test row: with GIT_DIR set to a decoy in the parent environment, the child's reading of the fixture is unchanged. An ablation (drop the strip) turns it red.

scripts/pm/check-governed-merges.mjs (self-test region only); skip-changeset; Clause-②: no. Serial after PR #33975 (same file). Dedupe: is:issue gitFreeEnv CLI child → none. New.

Activity

  1. added
    tooling
    pm:queue
    finding
    domain:skills
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Ruled: not planned · maintainer 2026-11-20T01:2xZ, verbatim: 「以上都关」 (on triage's list of ten no-user-effect p3 cards, under his standard: close what users cannot feel).

    2026-11-20T01:06Z · Closed as not planned. The self-test's child process inheriting GIT_* has caused no wrong reading; it is test hygiene with no user effect.

  3. removed
    pm:queue
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:fleetdomain:skillsfindingpriority:p3tooling

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions