Repository navigation
Never ask for a signing passphrase on Factory-internal commits - #169
Conversation
With a host commit.gpgsign, the projection commit, lane commits and test fixture commits opened pinentry: it froze lanes and took over the operator's terminal. These commits are inputs, never published, so signing is off for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Confidence Score: 4/5
Summary
Disables GPG signing on projection, lane-repo and test-fixture commits so a host commit.gpgsign no longer opens pinentry. Verified main fails and head passes under a simulated signing host; low risk.
Important Files Changed
| File | Overview |
|---|---|
| harness/projection.sh | Projection commit adds -c commit.gpgsign=false; correct and sufficient |
| harness/tmux_lane.sh | Lane repo gets local commit/tag.gpgsign=false; comment claims lane commits never published |
| tests/conftest.py | Process-wide GIT_CONFIG_COUNT override; clobbers any pre-existing GIT_CONFIG_* entries |
Reviewed 2488390...42aaf94 · ↻ Re-run review · View in Adapt
| git -C "$REPOSITORY" config user.name "Factory ${ROLE}" | ||
| git -C "$REPOSITORY" config user.email "factory-${ROLE}@local" | ||
| # A host's commit.gpgsign would open a passphrase prompt that freezes the lane (and, from | ||
| # a test or a terminal, the operator's screen). Lane commits are inputs, never published. |
There was a problem hiding this comment.
Coder lane task commits do become the PR head (run_record.py publish_pr/check_builder), so 'never published' is wrong; fix the comment and note hosts needing signed commits now get unsigned Factory PRs.
|
|
||
| # Fixture commits must never ask for a signing passphrase: with a host commit.gpgsign, pinentry | ||
| # takes over the operator's terminal. Command-level config outranks ~/.gitconfig. | ||
| os.environ.update(GIT_CONFIG_COUNT="2", |
There was a problem hiding this comment.
Overwriting GIT_CONFIG_COUNT/KEY_0/KEY_1 silently drops any GIT_CONFIG_* the invoking environment set; read the existing count and append the two entries after it.
|
|
||
| ( cd "$DEST" && git init --quiet -b "lane/$ROLE" && git add -A && \ | ||
| git -c user.name=harness -c user.email=harness@local \ | ||
| git -c user.name=harness -c user.email=harness@local -c commit.gpgsign=false \ |
There was a problem hiding this comment.
No test exercises either fix on a non-signing CI host; add one with GIT_CONFIG_GLOBAL pointing at commit.gpgsign=true plus gpg.program=/bin/false asserting projection succeeds and the lane config is false.
… a signing-host test - Lane commits can become a Factory PR's head: the comment says so, and that a host requiring signed commits should sign when publishing. - conftest appends its two entries after any GIT_CONFIG_* already set. - tests/test_no_signing_prompts.py runs projection.sh under a global config with commit.gpgsign=true and gpg.program=false; it fails on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in eb6cdf1:
@adaptcom review |
The Validator's integration commits and merges happen in the run clone that run-checkout.sh start creates. It got no signing override and the seat keeps the operator's HOME, so on a host with commit.gpgsign=true pinentry opened in an unwatched seat window and the Validator froze, as lanes did. start now applies the same repository-local override the PR applies to lane repositories (commit.gpgsign and tag.gpgsign false) right after the clone, with a comment stating why. CHANGELOG: the projected PR source carries no changelog line for this change to extend, so a ### Fixed line is added that covers lanes, projections and the run clone: Factory's own commits, run clone included, are unsigned. When porting, merge it with the PR's own line if the real head has one. Checks: bash -n; start against a HOME with commit.gpgsign/tag.gpgsign true and gpg.program=false: commit, annotated tag and --no-ff merge in the run clone succeed, a control commit in the target still fails to sign. FactoryRun: review-chiron-prs Built-By: Factory v0.8.31
…ated signing host 1. tests/test_harness_scripts.py run(): the fresh environment kept the real HOME and no GIT_CONFIG_*, so fixture commits read the host's ~/.gitconfig (observed: 5 gpg calls). run() now points GIT_CONFIG_GLOBAL at a scratch file holding only a fixture identity, with GIT_CONFIG_NOSYSTEM=1; a test of signing-host behaviour still passes its own GIT_CONFIG_GLOBAL through env_extra. Chose the scratch file over passing the session's GIT_CONFIG_* through: pass-through would force gpgsign=false into every launched script and mask exactly the signing-host behaviour item 3 tests. The receipt fixture _git_repo_with_base now asserts each git step, so a failed commit fails there instead of later as an empty base SHA. Limitation: a run()-driven test that relied on other host git settings (e.g. init.defaultBranch) would now see git defaults; none is known. 2. internal/setup/nix_test.go: GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM=1, as run_checkout_test.go does. 3. tests/test_no_signing_prompts.py: replaced the tmux_lane.sh text read (green while the line is dead code) with a real launch (Lanes fixture) on a scratch signing host (commit/tag.gpgsign=true, gpg.program=/bin/false). A commit and an annotated tag in the launched lane repository, using that host config and no GIT_CONFIG_* overrides, succeed. Control: an ordinary repository on the same host cannot commit. 4. internal/setup/run_checkout_test.go: the clone `run-checkout.sh start` makes on that signing host takes the Validator's commit. Fixture setup commits opt out with -c commit.gpgsign=false; a control commit without it must fail. FactoryRun: review-chiron-prs Built-By: Factory v0.8.31
|
Verified live: in a real run with this change, both lane repos ( Caveat for the description (non-blocking): lanes launched before this ships keep their old repo config. A resumed pre-upgrade lane on a signing host can still hit pinentry. Only new launches are covered. Worth changing (non-blocking): Note: seats start under |
|
Thanks for testing this live, Shane. Replies to your review, checked at
|
With
commit.gpgsign=truein the host's git config, Factory's own commits opened pinentry. That froze lanes and, from tests, took over the operator's terminal and broke the session.The commits involved:
harness/projection.sh: the projection commitharness/tmux_lane.sh: lane repos; Coder and Tester commits use the global configSigning is now turned off for them. Lane commits can become a Factory PR's head, so a host that requires signed commits now gets unsigned Factory commits and should sign when publishing:
-c commit.gpgsign=falseon the projection commit, localcommit.gpgsign/tag.gpgsign falsein each lane repo, and command-level config intests/conftest.py.Lanes and run clones created before this ships keep their old repository config. They only stop asking once they are launched again (a new round) or recreated.
Tests:
test_coder_projection_excludes_declared_paths_and_historyfailed withgpg: signing failedon a signing host and now passes. The receipt-parsing failures intest_harness_scripts.pyalso fail onmain.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.