Skip to content

Fix interactive export commands blocking on stdin - #16

Merged
Bpoe merged 1 commit into
mainfrom
fix/interactive-export-stdin
Oct 27, 2026
Merged

Bpoe merged 1 commit into
mainfrom
fix/interactive-export-stdin

Conversation

@Bpoe

@Bpoe Bpoe commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Interactive resource exports block in io.ReadAll when stdin is a terminal. Treat terminal stdin as an empty optional filter through a shared exportinput.Reader helper using golang.org/x/term; retain EOF-based reads and existing JSON validation for redirected files and pipes.

Covers dscpm packages (APT/DNF), dscpm aptRepositories (including DscExtras.Apt/Repository), and dsclinux 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, _name behavior, 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.
  • Formatting and diff whitespace checks — passed.

Opt-in disposable-container suites were not run because the Docker socket is inaccessible in this environment.

@Bpoe
Bpoe merged commit b7d9d75 into main Oct 27, 2026
28 checks passed
@Bpoe
Bpoe deleted the fix/interactive-export-stdin branch October 27, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant