Skip to content

[VW-0] allow null for nullable fields on vulnerability input#96

Merged
0xcad merged 1 commit intomainfrom
vw-0-nullable-vuln-fields
Mar 20, 2026
Merged

[VW-0] allow null for nullable fields on vulnerability input#96
0xcad merged 1 commit intomainfrom
vw-0-nullable-vuln-fields

Conversation

@0xcad
Copy link
Collaborator

@0xcad 0xcad commented Mar 20, 2026

Currently the schema doesn't accept null, even if these fields are nullable, they can only be undefined.

Doing this specifically on vulnerability inputs for now, to support the Helm integration, but it should be repeated elsewhere (VW-213)

Summary by CodeRabbit

  • Refactor
    • Updated validation for vulnerability data fields to allow explicit null values in addition to omission. This affects how certain fields (CVE ID, description, narrative, impact, CVSS score, CVSS vector, exploit URI, upstream API, and device artifact ID) are processed during submission.

@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
viper Ignored Ignored Mar 20, 2026 1:48pm
viper-demo Ignored Ignored Mar 20, 2026 1:48pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 933f2b6c-2678-49a2-9dcb-07bf427aba09

📥 Commits

Reviewing files that changed from the base of the PR and between 38f0ae8 and 36ff4dd.

📒 Files selected for processing (1)
  • src/features/vulnerabilities/types.ts

📝 Walkthrough

Walkthrough

Nine fields in vulnerabilityInputSchema were updated to use nullish() instead of optional(), allowing fields to be omitted or explicitly set to null rather than only being omit-able. Field validation constraints remain unchanged when non-null values are provided.

Changes

Cohort / File(s) Summary
Vulnerability Schema Updates
src/features/vulnerabilities/types.ts
Changed 9 schema fields (cveId, description, narrative, impact, cvssScore, cvssVector, exploitUri, upstreamApi, deviceArtifactId) from optional() to nullish(), enabling explicit null values alongside omission in validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting optional fields to nullish fields to allow explicit null values in the vulnerability input schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vw-0-nullable-vuln-fields
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@0xcad 0xcad merged commit b8ac874 into main Mar 20, 2026
10 checks passed
@0xcad 0xcad deleted the vw-0-nullable-vuln-fields branch March 20, 2026 14:43
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.

1 participant