Skip to content

Conversation

@G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Aug 27, 2025

Resolves #2014

@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.75%. Comparing base (3ce6933) to head (8b2a2ef).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2209      +/-   ##
==========================================
+ Coverage   67.68%   67.75%   +0.07%     
==========================================
  Files         169      169              
  Lines       16273    16290      +17     
==========================================
+ Hits        11014    11037      +23     
+ Misses       4582     4576       -6     
  Partials      677      677              

☔ 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.

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Nice!


func IsAffected(v osvschema.Vulnerability, pkg imodels.PackageInfo) bool {
for _, affected := range v.Affected {
// assume we're dealing with a git-source package whose name is the git repository, and that the version is the tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be clearer for this comment to be within the If statement? Right now it reads like the if statement is using the assumption, when I guess it's the other way around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally I tend to expect comments to be about the statement they precede, and that that tends to be the most common style - there's a number of small factors for that such as the comment is usually explaining the condition rather than the implementation, and editor folding of the content in the braces hides the comment which I find is typically counter to having the comment.

In this case, most of the comment is describing the top if condition, ending with describing what the condition being satisfied means we can do (which assumingly then takes place in the body), so I think it's valid where it is

continue
}

eco = "GIT"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm surprised this just compiles without casting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ha yeah I was surprised too - technically it makes sense because the type is a string rather than a "enum" even though it gets used in that fashion, so I'm guessing this is triggering an implicit cast that succeeds because the right hand side is a string 🤷

(in fact, if I add the cast it gets marked as redundant)

@G-Rath G-Rath force-pushed the support-git branch 2 times, most recently from bddc392 to 2b72697 Compare September 4, 2025 21:46
@G-Rath G-Rath force-pushed the support-git branch 4 times, most recently from 9e66ee0 to 755253e Compare September 23, 2025 03:33
@G-Rath G-Rath changed the title feat(offline): support resolving git packages that have a version specified feat(local): support resolving git packages that have a version specified Sep 23, 2025
@another-rex another-rex merged commit 29e9813 into google:main Sep 30, 2025
15 checks passed
@another-rex another-rex deleted the support-git branch September 30, 2025 03:29
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.

Offline scan for custom lockfile (C/C++ project from git project) skipped

3 participants