Skip to content

Add gojq resource-exhaustion cancellation coverage - #15563

Merged
lpcox merged 3 commits into
mainfrom
copilot/go-fan-gojq-review
Oct 27, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/go-fan-gojq-review

Conversation

Copilot AI commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The gojq review identified missing coverage for pathological filters interrupted during execution. Existing timeout handling needs no production changes or dependency upgrade.

  • Resource-heavy filters: Add table-driven cases for billion-element range reduction and infinite tail recursion under caller deadlines and cancellation.
  • Timeout contract: Cover the five-second default timeout, wrapped context error identity, and preservation of the caller’s context.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Review gojq module for compliance and best practices Add gojq resource-exhaustion cancellation coverage Oct 26, 2026
Copilot AI requested a review from lpcox October 26, 2026 11:11
@lpcox
lpcox marked this pull request as ready for review October 26, 2026 13:37
Copilot AI max review requested due to automatic review settings October 26, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new error assertions conflict with the enabled testifylint require-error rule and would fail CI.

1 open issue
What changed in this PR

Adds regression coverage for gojq resource-exhaustion cancellation in the middleware, addressing #15557 without changing production code or dependencies.

Changes:

  • Tests billion-element range reduction and infinite recursion under caller deadlines and cancellation.
  • Covers the default timeout, wrapped context-error identity, and preservation of the caller’s context.
File Description
internal/​middleware/​jqschema_cancellation_test.go Adds table-driven cancellation and timeout contract tests.

Review effort: Max

@lpcox

lpcox commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Updated the cancellation test to use require for the error assertions and verified it with the full completion checks. Commit: cb071c3.

@lpcox
lpcox merged commit 0f733b7 into main Oct 27, 2026
28 checks passed
@lpcox
lpcox deleted the copilot/go-fan-gojq-review branch October 27, 2026 01:36
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.

[go-fan] Go Module Review: github.com/itchyny/gojq

3 participants