Repository navigation
v0s: skip unused findings pages across GraphQL scopes - #671
Merged
Merged
Conversation
Share the field-selection decision across Query, Team, TeamEnvironment, Application and Job, including affectedWorkloads. Preserve required row and facet fetches, current selection and cursor validation without changing the GraphQL contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the extension of selection-based findings-page loading across all five GraphQL scopes.
No open issues 🎉
What changed in this PR
Extends #667’s findings-page optimization across all five GraphQL scopes—Query, Team, TeamEnvironment, Application and Job—without changing the GraphQL contract.
Changes:
- Uses one shared selection helper to skip parent findings pages when only independent fields are requested.
- Adds executable GraphQL tests for scoped selections, aliases, directives, nested findings, validation and inventory filtering.
- Updates documentation with loading rules, rollout measurements and remaining cutover coordination.
| File | Description |
|---|---|
internal/graph/v0s.resolvers.go |
Applies selection-based page loading across all five scopes. |
internal/graph/v0s.resolvers_test.go |
Expands regression coverage for skipped and required findings pages. |
internal/graph/helpers.go |
Centralizes the findings-page dependency check outside generated resolvers. |
docs/v0s_console_migration.md |
Documents page dependencies, measurement guidance and cutover responsibilities. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete #667 without changing the GraphQL contract. One shared field-selection helper now serves Query, Team, TeamEnvironment, Application and Job vulnerabilityFindings.
Console overview queries no longer need a redundant findings page. Global/team CVE details lose only the parent findings call: requested per-workload finding pages remain. The test with one app and one job expects exactly those two calls. CLI summaries requesting facets deliberately keep their findings calls. Parent first:1 was already optional; no CLI or Console migration is needed.
Verification
Executable GraphQL tests cover independent fields and combinations across all five scopes, mixed rows/facets without double loading, aliases, named/inline fragments, variable skip/include, nested app/job findings, invalid parent arguments/bindings, scoped inventory, obsolete images and explicit empty selections.
Passed locally:
Standard mise run test hits the known local macOS go-m1cpu CGO initializer crash; the complete suite passes with CGO disabled.
Related feedback already resolved / remaining
Rollout and measurement
API-only change, no new flag, client/server upgrade or cursor restart. Compare identical global/team overview and CVE detail queries before/after rollout using existing GraphQL timing and ListFindings/ListVulnerabilities counts and cumulative duration. Independent parent selections should contribute zero finding calls; detail queries retain their requested workload pages and facets remain page-dependent. Account for background traffic: aggregate deltas are not traces, and fewer RPCs alone do not prove lower latency.
No new tracing/metrics, SQL changes, larger workload batches, cursor infrastructure, merge or deployment.