Repository navigation
Fix interactive export commands blocking on stdin - #16
Merged
Merged
Conversation
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.
Interactive resource exports block in
io.ReadAllwhen stdin is a terminal. Treat terminal stdin as an empty optional filter through a sharedexportinput.Readerhelper usinggolang.org/x/term; retain EOF-based reads and existing JSON validation for redirected files and pipes.Covers
dscpm packages(APT/DNF),dscpm aptRepositories(includingDscExtras.Apt/Repository), anddsclinux services/groups. These are all resource export handlers in the repository. The helper uses a small shared resources module with local replacements from the existing modules, and both CI workflows trigger on shared helper changes. Get/set/test input handling, JSON Lines output,_namebehavior, manifests, and schemas are unchanged.Adds subprocess tests for all four commands using an open pseudo-terminal without EOF,
/dev/null, empty regular files and pipes, matching/nonmatching piped JSON filters, and invalid JSON with exit code/error checks. Production code uses no timeouts or polling.Validation with Go 1.25.0 and DSC 3.3.0, in both resource modules:
DSCLINUX_REQUIRE_DSC=1 DSCPM_REQUIRE_DSC=1 go test -count=1 ./...— passed, including DSC export integration for all affected resource types and the legacy APT alias.go vet ./...— passed.go test -race ./...— passed.Opt-in disposable-container suites were not run because the Docker socket is inaccessible in this environment.