Skip to content

Isolate release-test Git subprocesses from user config and bound execution #1477

Closed

Description

@JAORMX

Problem

TestSDKTypescriptRelease_Scenario11_TagVersionParity can hang during ordinary local task test runs because its temporary-repository Git subprocesses inherit the developer's global Git configuration and environment.

This is fixture setup, not an actual release: the test creates a disposable repository and local tags, and pushes nothing. The integration coverage is useful; the subprocess isolation is defective.

Observed failure

During image-capability regression verification, the test stalled until the package's 10-minute timeout. Investigation found the process chain:

server.test → git tag → nvim …/.git/TAG_EDITMSG

The developer's global settings included tag.gpgsign = true and core.editor = nvim. Fixture tag creation therefore attempted an interactive signed/annotated tag instead of the intended noninteractive fixture operation. Stalled editor subprocesses remained after timed-out runs.

Process-local noninteractive Git overrides allowed verification to complete; no user-global configuration changes should be required to run this test.

Relevant code

internal/adapter/server/sdk_typescript_scenario11_test.go:

  • exerciseSDKScenario11IdentityGate creates the repository with t.TempDir() (around line 172).
  • Its runGit helper uses exec.Command("git", args...) and sets only cmd.Dir, inheriting ambient configuration/environment and providing no per-command deadline (around lines 173–181).
  • Fixture setup commits and creates tags (around lines 198–203).
  • The identity-script subprocess also uses unbounded exec.Command and explicitly inherits os.Environ() (around lines 214–227).

Expected behavior / acceptance criteria

  • The fixture and identity-script subprocesses are isolated from user/system Git configuration and relevant inherited Git environment overrides, while retaining the toolchain environment they actually need.
  • Fixture commits/tags are noninteractive, unsigned, and cannot execute developer-configured hooks or editors. Do not change the developer's real Git configuration, keys, or repository.
  • Bound subprocess execution and clean up spawned processes on timeout/cancellation so a failed test does not leave editors or signing helpers behind.
  • Add regression coverage with hostile ambient Git configuration (signing enabled and an editor/hook sentinel) proving that the fixture neither invokes those helpers nor hangs.
  • Preserve the existing behavioral coverage of the real release identity script: matching tag/package version succeeds; mismatched versions and unmerged commits are rejected.
  • Ordinary task test succeeds without callers supplying Git-specific workarounds.

Scope

Fix the test fixture and subprocess harness, not production release signing policy. Reuse existing repository test helpers where appropriate; do not replace the behavioral integration test with string assertions alone.

Activity

  1. self-assigned this
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions