Skip to content

fix(findings): 'cora findings list --severity' never matches; severity colouring is dead #586

Description

@ajianaz

Problem. Severities are stored lowercase in findings.severity (issue.severity.to_string() in review_store::record_review), but:

  1. the --severity filter upper-cases its argument (src/engine/review_store.rs ~L362-364: params.push(Box::new(s.to_uppercase())) against f.severity = ?), so cora findings list --severity major returns nothing for every value;
  2. the list renderer matches the stored value against "CRITICAL"/"MAJOR"/"MINOR" (src/commands/findings.rs ~L129-134), so the red/yellow/green colouring never applies.

Both go back to before #585; the refactor preserved them on purpose (pinned by a test with a comment) so it stayed behavior-preserving.

Fix. Compare case-insensitively (COLLATE NOCASE or lowercase the argument consistently with how severity is stored) and match the renderer on the stored form. Update the pinning test to assert the corrected behavior; add a test for filter + colouring.

Found by the #571 agent; see #585.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions