Skip to content

CM-68446: Render unmaintained package detections in SCA output - #523

Open
AradTraub wants to merge 13 commits into
cycodehq:mainfrom
AradTraub:CM-68446-unmaintained-package-cli-scan
Open

CM-68446: Render unmaintained package detections in SCA output#523
AradTraub wants to merge 13 commits into
cycodehq:mainfrom
AradTraub:CM-68446-unmaintained-package-cli-scan

Conversation

@AradTraub

@AradTraub AradTraub commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Renders unmaintained-package findings (OpenSSF Scorecard score <= 2) in local SCA scan output. Until now they arrived with an unrecognised policy id and fell through to a table titled "Unknown" with vulnerability-shaped columns.

  • Dedicated Unmaintained Packages table with an OSSF Score column in place of CVE / Upgrade / License.
  • Detail card gains the score and a link to the scorecard report.
  • Package health is read from the nested ossf detection detail (ossf.score, ossf.scorecard_report_url); the flat ossf_scorecard_score field no longer exists.

No new CLI flag. Whether the policy runs is decided entirely by the tenant's policy state, resolved server-side in dependency-collector — the CLI neither sends nor needs a scan parameter for it. An earlier revision of this branch added a --sca-scan unmaintained-packages value; it was reverted once the gate moved to the policy, so this PR is rendering only.

Testing

  • ruff check + ruff format --check clean.
  • pytest: 999 passed, 1 skipped, including new tests for the printer's title, its exact column set and order, and the score fallback when no scorecard is present.
  • Verified end to end against a local backend: a CLI SCA scan on a tenant with the policy enabled prints the Unmaintained Packages table with a score of 1.5.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

table.add_cell(LICENSE_COLUMN, detection_details.get('license'))

ossf_score = get_ossf_score(detection_details)
table.add_cell(OSSF_SCORE_COLUMN, 'N/A' if ossf_score is None else str(ossf_score))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the overall ossf score or the maintained check's score?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall score.

Comment thread cycode/cli/apps/scan/scan_parameters.py Outdated
'report': ctx.obj.get('report'),
'package_vulnerabilities': ctx.obj.get('package-vulnerabilities'),
'license_compliance': ctx.obj.get('license-compliance'),
'maintainability': ctx.obj.get('unmaintained-packages'),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall might be worth checking:
What happens if the policy is off and the user specified they want to scan unmaintained-packages specifically?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they will get 0 detections. as the policy is close and this the maintainability will be align, there will be no detection found as the rest of the detection will be filtered out and maintainability will skipped due to the fact that the policy is close

@AradTraub AradTraub closed this Aug 25, 2026
@AradTraub AradTraub changed the title CM-68446: Add the unmaintained-packages SCA scan option CM-68446: Render unmaintained package detections in SCA output Aug 25, 2026
@AradTraub AradTraub reopened this Aug 27, 2026
AradTraub and others added 2 commits August 27, 2026 12:03
The text printer fell through to the license branch for unmaintained
package detections, printing a License row instead of the score.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The unmaintained policy decides on the scorecard's Maintained check, so showing
the aggregate as the only number was misleading: a package flagged as
unmaintained could display a healthy-looking 4.1. The Maintained score now leads
and the aggregate stays as context.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AradTraub
AradTraub force-pushed the CM-68446-unmaintained-package-cli-scan branch from 1e259ba to 2284682 Compare August 27, 2026 11:21
Comment on lines +133 to +134
maintained_score = get_maintained_score(detection_details)
table.add_cell(MAINTAINED_SCORE_COLUMN, 'N/A' if maintained_score is None else str(maintained_score))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this being policy gate (score is irrelevant for other policies

Comment on lines +101 to +107
if detection.detection_type_id == consts.UNMAINTAINED_PACKAGE_POLICY_ID:
maintained_score = get_maintained_score(detection_details)
ossf_score = get_ossf_score(detection_details)
details_table.add_row('Maintained score', 'N/A' if maintained_score is None else str(maintained_score))
details_table.add_row('OSSF Scorecard score', 'N/A' if ossf_score is None else str(ossf_score))
details_table.add_row('Scorecard report', get_ossf_report_url(detection_details) or 'N/A')
elif not detection.has_alert:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this actually be conditional?

Comment on lines +88 to +98
if detection.detection_type_id == consts.UNMAINTAINED_PACKAGE_POLICY_ID:
maintained_score = get_maintained_score(detection.detection_details)
ossf_score = get_ossf_score(detection.detection_details)
maintained = 'N/A' if maintained_score is None else maintained_score
score = 'N/A' if ossf_score is None else ossf_score
report_url = get_ossf_report_url(detection.detection_details) or 'N/A'

summary_lines.append(f'Maintained score: [cyan]{maintained}[/]\n')
summary_lines.append(f'OSSF Scorecard score: [cyan]{score}[/]\n')
summary_lines.append(f'Scorecard report: [cyan]{report_url}[/]\n')
elif detection.has_alert:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this actually be conditional?

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