Skip to content

contrib/yq: add conformance suite - #765

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/yq-conformance
Mar 28, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/yq-conformance

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add a package-local yq conformance suite under contrib/yq using the shared conformance harness
  • add a pinned upstream mikefarah/yq v4.52.4 oracle via Nix, scripts/ensure-yq.sh, and internal/testutil helpers
  • widen make contrib-conformance-test so CI runs jq, awk, and yq contrib parity suites

Why

This mirrors the existing jq and awk contrib parity setup so yq’s oracle-backed conformance coverage lives with the contrib command and uses an oracle version that exactly matches the embedded yq library.

Impact

  • adds GBASH_RUN_YQ_CONFORMANCE and GBASH_CONFORMANCE_YQ
  • adds make ensure-yq
  • updates contrib docs to describe jq, awk, and yq parity coverage
  • fixes yq missing-file diagnostics so missing input and --from-file paths surface on stderr in the new suite

Validation

  • go test ./internal/testutil -run TestResolveNixYQ -count=1
  • go test ./contrib/yq -count=1
  • nix build .#yq --extra-experimental-features 'nix-command flakes'
  • make contrib-conformance-test
  • make lint

@ewhauser ewhauser changed the title [codex] contrib/yq: add conformance suite contrib/yq: add conformance suite Mar 28, 2026
@ewhauser
ewhauser marked this pull request as ready for review March 28, 2026 17:16
@ewhauser
ewhauser force-pushed the ewhauser/yq-conformance branch from ec03e47 to 033c2a7 Compare March 28, 2026 17:16
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

return exitCodef(inv, 2, "awk: %v", err)

P2 Badge Preserve existing exit codes when wrapping AWK load errors

Run now forces exit code 2 for errors from loadAWKProgram/loadAWKInputs, but those helpers can already return a *commands.ExitError from inv.FS.Open (for example, sandbox read-policy denials that carry code 126). Re-wrapping with a hard-coded 2 changes command semantics and makes policy failures indistinguishable from ordinary awk usage/file errors; this is a regression from the previous behavior where those exit codes were propagated unchanged.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ewhauser
ewhauser merged commit 2469538 into main Mar 28, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/yq-conformance branch March 28, 2026 17:32
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