fix(review): preserve fallback classification for invalid/absent inline finding categories#4385
Merged
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4385 +/- ##
=======================================
Coverage 93.95% 93.95%
=======================================
Files 400 400
Lines 36817 36817
Branches 13451 13452 +1
=======================================
Hits 34592 34592
Misses 1569 1569
Partials 656 656
🚀 New features to boost your workflow:
|
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.
Motivation
category(defaulting tomaintainability), which prevented deterministic path/body fallback from classifying security-like findings assecuritywhen the model omitted or mis-emitted the field.Description
parseInlineFindingCategorynow returnsFindingCategory | undefinedand returnsundefinedwhen the model value is absent or invalid so downstream fallback can run. (src/review/inline-finding-category-parse.ts)categoryinto parsed inline findings when the model value is a valid enum; use conditional spreading to omit the field when absent. (src/services/ai-review.ts)security. (test/unit/inline-finding-category-parse.test.ts,test/unit/ai-review.test.ts)src/review/inline-finding-category-parse.ts,src/services/ai-review.ts,test/unit/inline-finding-category-parse.test.ts,test/unit/ai-review.test.ts.Testing
npm run typecheckand it succeeded.npx vitest run test/unit/inline-finding-category-parse.test.ts test/unit/ai-review.test.ts test/unit/inline-comments-select.test.ts --pool=forksand all tests passed (suite completed successfully).npm audit --audit-level=moderatebut the registry audit endpoint returned403 Forbiddenin this environment, so the audit could not be completed here.Codex Task