fix(cli): isolate subprocess tests from host OPENSHELL_ env vars - #2523
Queued
rhuss wants to merge 1 commit into
Queued
fix(cli): isolate subprocess tests from host OPENSHELL_ env vars#2523rhuss wants to merge 1 commit into
rhuss wants to merge 1 commit into
Conversation
rhuss
requested review from
a team,
derekwaynecarr,
maxamillion and
mrunalp
as code owners
July 28, 2026 16:00
elezar
reviewed
Jul 28, 2026
The subprocess-based integration tests inherit the full parent environment. If the developer has OPENSHELL_GATEWAY_INSECURE=true set in their shell, it leaks into the spawned CLI process and causes it to connect with .with_no_client_auth(), skipping the mTLS client certificate. The test server requires mTLS, so it responds with CertificateRequired and the test fails. Strip OPENSHELL_GATEWAY_INSECURE, OPENSHELL_GATEWAY, OPENSHELL_GATEWAY_ENDPOINT, and OPENSHELL_WORKSPACE from the subprocess environment. The test already sets --gateway and --gateway-endpoint explicitly via CLI args, so these env vars should not influence the subprocess behavior. Reported-by: Seth Jennings Signed-off-by: Roland Huß <rhuss@redhat.com>
rhuss
force-pushed
the
fix/cli-subprocess-test-env-isolation
branch
from
July 28, 2026 16:34
d93fc33 to
d71c2ac
Compare
|
Label |
Member
|
/ok-to-test d71c2ac |
|
Label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The subprocess integration tests inherit the full parent environment. If the developer has
OPENSHELL_GATEWAY_INSECURE=trueset in their shell, the spawned CLI process connects with.with_no_client_auth(), skipping the mTLS client certificate. The test server requires mTLS and responds withCertificateRequired.Related Issue
Follow-up to #2504. Root cause identified by @sjenning.
Changes
OPENSHELL_GATEWAY_INSECURE,OPENSHELL_GATEWAY,OPENSHELL_GATEWAY_ENDPOINT, andOPENSHELL_WORKSPACEfrom the subprocess environment viaenv_remove()--gatewayand--gateway-endpointexplicitly via CLI args, so these env vars should not influence subprocess behaviorTesting
mise run pre-commitpassesOPENSHELL_GATEWAY_INSECURE=truebefore fix, passes afterChecklist