fix(keyvalue): skip nil results in CertifyBad and CertifyGood full-scan queries#3117
Open
infernus01 wants to merge 1 commit into
Open
fix(keyvalue): skip nil results in CertifyBad and CertifyGood full-scan queries#3117infernus01 wants to merge 1 commit into
infernus01 wants to merge 1 commit into
Conversation
mihaimaruseac
approved these changes
Jul 15, 2026
Contributor
|
Thanks for the contribution @infernus01. These changes look good and can be merged. |
…an queries Signed-off-by: infernus01 <sbmbhardwaj01@gmail.com>
infernus01
force-pushed
the
fix/keyvalue-certifybad-nil-results
branch
from
July 18, 2026 15:16
f601595 to
60d19e2
Compare
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.
Description of the PR
CertifyBad()andCertifyGood()functionselsebranch) — when no artifact or source filter matches, the code scans all entries and appends results fromCBIfMatch/CGIfMatchwithout checking for nilfoundOnepath (theifbranch) already has the nil guard — this PR adds the same guard to theelsebranch in both filesProblem
When you query
CertifyBadorCertifyGoodwith a package filter (not artifact or source), the backend can't do a targeted lookup — the comment in the code says "Cant really search for an exact Pkg, as these can be linked to either names or versions, and version could be empty." So it falls through to a full scan of all entries.During that scan,
CBIfMatch/CGIfMatchreturns(nil, nil)for entries that don't match the filter. But the code appends these nil values to the output slice anyway. The GraphQL layer then tries to serialize an array containing nil elements, which violates the schema ([CertifyBad!]!— the!inside the brackets means elements must be non-null), and the client gets:PR Checklist
-sflag togit commit.make generatehas been runmake generatehas been runmake generatehas been runcollectsubprotobuf has been changed,make protohas been run