Skip to content

fix: handle unavailable open vulnerability score (IN-1241) - #2113

Open
gaspergrom wants to merge 2 commits into
mainfrom
fix/IN-1241-open-vuln-unavailable-state
Open

fix: handle unavailable open vulnerability score (IN-1241)#2113
gaspergrom wants to merge 2 commits into
mainfrom
fix/IN-1241-open-vuln-unavailable-state

Conversation

@gaspergrom

@gaspergrom gaspergrom commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • getOpenVulnRow() now treats the open-vulnerabilities signal as blocked (status: 'no-data') when either signals.openVulnScore is null OR signals.openVulnAvailable is falsy, matching the pattern already used by sibling signal functions (getResponsivenessRow(), getBusFactorRow(), getOrgDiversityRow()).
  • Added openVulnAvailable: boolean | null to HealthBreakdownResults — a repo that has never completed a vulnerability scan was previously scored a false-positive "clean" 10.
  • Updated the security category's "unavailable" description builder to include open-vulnerability data in its list of named-available signals, since it's no longer unconditionally treated as covered.
  • Added Vitest coverage for: score null, never-scanned (openVulnAvailable: false), and scanned-and-clean (openVulnAvailable: true).

Cross-repo dependency

This PR reads a new openVulnAvailable field from the project_insights_health_breakdown Tinybird endpoint. That field is added by crowd.dev#4509 (adds an openVulnAvailable coverage flag through the full health_score_v2_security pipe chain, based on the vulnerability_scans datasource).

Deploy order: the crowd.dev Tinybird pipe change must be deployed to staging and production before this PR is deployed — until then, the field is simply absent from the API response and getOpenVulnRow falls back to its existing null-score check, so this PR is safe to merge independently but should not go live ahead of the pipe deploy.

Both the Tinybird deploy and end-to-end QA verification are intentionally deferred to a follow-up session.

getOpenVulnRow rendered a false 'no open vulnerabilities' positive
when openVulnScore was null (Gerrit repos, excluded repos, or repos
with no vuln data), instead of the blocked/no-data state used by
sibling signal rows.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings August 25, 2026 22:05

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.

Pull request overview

Handles unavailable open-vulnerability scores without displaying false positive results.

Changes:

  • Returns no-data when openVulnScore is null.
  • Adds a Vitest regression test for the null-score case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
frontend/config/health-breakdown-templates.ts Handles unavailable vulnerability scores.
frontend/config/health-breakdown-templates.test.ts Tests the unavailable-score behavior.

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

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI review requested due to automatic review settings August 25, 2026 22:20

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

frontend/config/health-breakdown-templates.test.ts:4

  • Use the repository's required TypeScript license-header format. The frontend checklist specifies two leading // lines, which is also the format used by the existing test suite (for example, frontend/setup/caching.test.ts:1-2).

This issue also appears on line 14 of the same file.

/*
Copyright (c) 2026 The Linux Foundation and each contributor.
SPDX-License-Identifier: MIT
*/

frontend/config/health-breakdown-templates.test.ts:14

  • This case does not exercise the null-score condition because !openVulnAvailable is already true and short-circuits the new || expression. Set availability to true so the test would fail if the explicit openVulnScore === null guard were removed.
      openVulnAvailable: null,

// --- Security signals ---

export const getOpenVulnRow = (signals: HealthBreakdownResults): SignalRow => {
if (!signals.openVulnAvailable || signals.openVulnScore === null) {
}
if (category === 'security') {
const availableSignals: string[] = [];
if (signals?.openVulnAvailable) availableSignals.push('open vulnerability data');
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