Skip to content

fix: properly flag if running on Linux or Mac OSs#2051

Merged
another-rex merged 2 commits into
google:mainfrom
ackama:determine-os-correctly
Jul 16, 2025
Merged

fix: properly flag if running on Linux or Mac OSs#2051
another-rex merged 2 commits into
google:mainfrom
ackama:determine-os-correctly

Conversation

@G-Rath
Copy link
Copy Markdown
Collaborator

@G-Rath G-Rath commented Jul 10, 2025

The OSUnix value is only meant to be used by plugins to indicate they're fine working with either Linux or macOS, but the OS still needs to be one of those values when scanning.

This is not an issue currently because we're just using extractors, but there are a few detectors that require a Unix-like OS

Comment thread pkg/osvscanner/scan.go
case "linux":
return plugin.OSLinux
default:
return plugin.OSAny
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm pretty sure its safe to return this rather than error, though (assuming we don't actually want to error) it could be nice if scalibr had a plugin.OSUnknown either as a new value or an alias for this one, since that's what we want to represent here

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.

Hmm, can this log a warning that OS "xyz" is not officially supported.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 66.08%. Comparing base (6e5607b) to head (f314ff9).

Files with missing lines Patch % Lines
pkg/osvscanner/scan.go 73.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2051      +/-   ##
==========================================
- Coverage   66.09%   66.08%   -0.01%     
==========================================
  Files         172      172              
  Lines       16214    16225      +11     
==========================================
+ Hits        10716    10723       +7     
- Misses       4848     4852       +4     
  Partials      650      650              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@G-Rath
Copy link
Copy Markdown
Collaborator Author

G-Rath commented Jul 10, 2025

@another-rex I found this while trying to come up with tests for the detectors - afa06df shows that this is broken.

I've opened this so I don't forget, but I think it's probably best if we first get the snapshot failures on #2021 sorted before we dig into everything else including this

@G-Rath G-Rath marked this pull request as ready for review July 15, 2025 03:53
@G-Rath G-Rath force-pushed the determine-os-correctly branch from dfe2d55 to f314ff9 Compare July 16, 2025 04:25
@another-rex
Copy link
Copy Markdown
Collaborator

Talked with other Scalibr folks, I think we're happy to add a OSUnknown in scalibr that just only matches OSAny.

@another-rex another-rex merged commit 6515dc0 into google:main Jul 16, 2025
16 checks passed
@another-rex another-rex deleted the determine-os-correctly branch July 16, 2025 06:24
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.

3 participants