Skip to content

Address review comments and add unit tests for internal/query - #3473

Merged
airlock-confluentinc[bot] merged 1 commit into
flink-sync-snapshot-queryfrom
flink-sync-snapshot-query-review-fixes
Aug 24, 2026
Merged

Address review comments and add unit tests for internal/query#3473
airlock-confluentinc[bot] merged 1 commit into
flink-sync-snapshot-queryfrom
flink-sync-snapshot-query-review-fixes

Conversation

@yiyutian1

Copy link
Copy Markdown
Member

Addresses outstanding review feedback on #3466 and the failing SonarQube quality gate (new-code coverage 39.4% < required 80%).

Review comments addressed

  • Backtick-formatted the flag names in three error/suggestion strings (--max-rows, --raw, -o json/-o yaml, --timeout) that were using double quotes, per this repo's output-formatting convention.
  • Fixed two comments citing unified-stream-manager as precedent for the Hidden-until-targeted feature-flag gating pattern — that package doesn't exist in this repo. Pointed at the actual precedent instead (internal/network/command_access_point_private_link_ingress_endpoint.go).
  • Corrected the README's stale "no token refresh" limitation — Options.RefreshToken already exists in this PR. Reworded to note the refresh is best-effort/not retry-aware, and that in practice it rarely matters since the default 10-minute --timeout is on the same order as the dataplane token's own lifetime.

CI fix

internal/query/command.go shipped with zero unit tests, which was the main driver of the failing coverage gate. Added internal/query/command_test.go covering:

  • buildQueryProperties
  • printQueryResult (table and serialized/raw output, empty results, operation column)
  • refreshGatewayToken (valid token, expired token, refresh failure)
  • stopStatement (success and failure)
  • handleQueryError (all branches: unbounded, canceled, deadline exceeded, 404 vs other results-fetch errors, generic fallback)
  • New (command construction/flag registration)

Coverage for the package goes from 0% to 51.6%. go vet, golangci-lint run, and make lint-cli are clean.

🤖 Generated with Claude Code

- Backtick-format flag names in error/suggestion strings for consistency
  with the rest of the repo's output conventions.
- Fix the Hidden-gating comment's precedent: unified-stream-manager
  doesn't exist in this repo; point at the private link ingress endpoint
  command instead, which is the actual precedent for this pattern.
- Correct the README's stale "no token refresh" limitation now that
  Options.RefreshToken exists, and note that the default 10-minute
  timeout is on the same order as the dataplane token's lifetime so it
  rarely matters in practice.
- Add internal/query/command_test.go covering buildQueryProperties,
  printQueryResult, refreshGatewayToken, stopStatement and
  handleQueryError, raising this package's coverage from 0% to address
  the SonarQube new-code coverage gate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@yiyutian1
Yiyu Tian (yiyutian1) requested a review from a team as a code owner August 24, 2026 18:17
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@airlock-confluentinc
airlock-confluentinc Bot merged commit 24468a1 into flink-sync-snapshot-query Aug 24, 2026
2 of 3 checks passed
@airlock-confluentinc
airlock-confluentinc Bot deleted the flink-sync-snapshot-query-review-fixes branch August 24, 2026 18:19
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