Skip to content

feat(vulnerability): enhance CVEWorkloadsFilter with viewer membership support - #594

Closed
ybelMekk wants to merge 3 commits into
mainfrom
feat/cve-team-filter
Closed

ybelMekk wants to merge 3 commits into
mainfrom
feat/cve-team-filter

Conversation

@ybelMekk

@ybelMekk ybelMekk commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Legger til CVEWorkloadsFilter.viewerIsMember for å filtrere berørte workloads til team brukeren er medlem av. Kombinert med teamSlugs returneres bare brukerens team blant de oppgitte.

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 count-only workload shortcut ignores viewerIsMember, returning global counts even for viewers with no teams instead of applying membership filtering.

1 open issue
1 file not reviewed
  • internal/graph/gengql/vulnerability.generated.go: Generated file
What changed in this PR

Adds viewer-membership filtering to CVE workload queries, allowing developers to limit affected workloads to their teams.

Changes:

  • Adds the optional viewerIsMember filter to the GraphQL schema and Go model.
  • Intersects viewer teams with supplied team slugs and returns an empty connection when no teams match.
  • Updates generated GraphQL code and adds domain-level filtering tests.
File Description
internal/​vulnerability/​queries.go Resolves viewer team scope and handles empty matches.
internal/​vulnerability/​models.go Adds the membership filter field.
internal/​vulnerability/​cve_workloads_test.go Tests membership filtering, intersections, and empty results.
internal/​graph/​schema/​vulnerability.graphqls Exposes and documents viewerIsMember.
internal/​graph/​gengql/​vulnerability.generated.go Decodes the new filter input.
internal/​graph/​gengql/​root_.generated.go Updates the embedded GraphQL schema.

Review effort: Balanced

Comment thread internal/vulnerability/queries.go Resolved

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 membership filter can return team workloads to non-members through unrelated team-scoped roles and rejects valid explicit-null input.

2 open issues
1 resolved since last review
1 file not reviewed
  • internal/graph/gengql/vulnerability.generated.go: Generated file

Review effort: Balanced

Comment thread internal/vulnerability/queries.go Resolved
Comment thread internal/vulnerability/models.go Resolved

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.

🟢 Approved

The viewer-membership filtering change has no active review issues.

No open issues 🎉

2 resolved since last review
1 file not reviewed
  • internal/graph/gengql/vulnerability.generated.go: Generated file

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants