Skip to content

fix(kafka): align revoke grant arguments - #774

Merged
christeredvartsen merged 2 commits into
mainfrom
feat/kafka-revoke-grant
Sep 10, 2026
Merged

christeredvartsen merged 2 commits into
mainfrom
feat/kafka-revoke-grant

Conversation

@christeredvartsen

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

📝 Changelog preview

Below is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog.

v5.49.1 - 2026-09-10

Full Changelog: v5.49.0...v5.49.1

🐛 Bug Fixes

  • (kafka) Align revoke grant arguments (1b83936)
  • (kafka) Scope revoke access completion (dc35225)

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

Autocomplete currently fetches team-wide topic grants even when completing the final access argument, which can be significantly more data than needed and may degrade shell completion performance.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR aligns the revoke-grant command’s positional arguments to username topic access, and updates Kafka grant autocomplete and GraphQL client code to support the new flow.

Changes:

  • Reordered revoke-grant arguments and moved access validation into the command’s ValidateFunc.
  • Added a team/environment-scoped GraphQL query and helper to fetch Kafka topic ACL grants across topics (used by autocomplete).
  • Updated schema.graphql and regenerated the GraphQL client types/operations.
File summaries
File Description
schema.graphql Adds Kafka topic update activity log enum/type definitions to the schema.
internal/naisapi/gql/generated.go Regenerates genqlient output to include the new GetTeamKafkaTopicGrants query and types.
internal/kafka/kafka.go Adds TopicGrant and GetTeamKafkaTopicGrants helper to list grants across team topics in an environment.
internal/kafka/command/revoke_grant.go Reorders args to username topic access, adds access validation, and updates autocomplete to match.
internal/kafka/command/list_grants_test.go Updates the revoke-grant command arg-order expectation.
internal/kafka/command/flag/flag.go Changes KafkaTopicGrantAccess.Validate() to a value receiver and simplifies empty/invalid checks.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/kafka/command/revoke_grant.go Outdated
Comment on lines 65 to 68
grants, err := kafka.GetTeamKafkaTopicGrants(ctx, flags.Team, flags.Environment)
if err != nil {
return nil, "Unable to fetch Kafka topic grants."
return nil, "Unable to fetch Kafka grants."
}
@christeredvartsen
christeredvartsen enabled auto-merge (squash) September 10, 2026 12:24
@christeredvartsen
christeredvartsen merged commit 786f893 into main Sep 10, 2026
22 checks passed
@christeredvartsen
christeredvartsen deleted the feat/kafka-revoke-grant branch September 10, 2026 12:28
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.

2 participants