fix(config): propagate --jq to nested pup calls via PUP_FILTER env#631
Merged
Merged
Conversation
d4ed0bd to
65b586e
Compare
jack-edmonds-dd
approved these changes
Jul 2, 2026
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.
Problem
--jqis silently ignored when an extension delegates its HTTP call to a nestedpupprocess, even though-o/--outputworks in the exact same chain. When an extension subcommand shells out through a helper to a nestedpup apicall,-o tablepropagates and takes effect but--jqdoes not:Before this fix — the jq projection is dropped; every column comes back (data anonymized):
After this fix — the jq projection is applied before formatting:
Root cause
Config::from_envresolvesoutput_formatwith an env fallback (DD_OUTPUT/PUP_OUTPUT), which is why a nestedpupprocess inherits--output.jqhad no equivalent fallback — it was hardcoded toNoneand only ever set from the literal--jqCLI flag.PUP_FILTERis already injected into every extension's environment (src/extensions/exec.rs) for exactly this purpose, but nothing read it back.Fix
One line in
src/config.rs— givejqthe same env fallbackoutput_formatalready has:Precedence is preserved: an explicit
--jqflag still overrides the env (main.rsapplies it afterConfig::from_env). Top-levelpupbehavior is unchanged whenPUP_FILTERis unset; a manually-exportedPUP_FILTERis now honored, matching the existing unguardedPUP_OUTPUTbehavior.Testing
config::tests::test_pup_env_inherited_by_childto coverPUP_FILTER(assertsNonewhen unset,Some(expr)when set).cargo fmt --check,cargo clippy -- -D warnings,cargo build --releaseall clean.PATH.Docs
Added
PUP_FILTERto the env-var table indocs/EXTENSIONS.mdand extended the "read back by a childpupprocess" note.