Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update last modified time of combine-to-osv entries #2158

Merged
merged 3 commits into from
May 7, 2024

Conversation

hogo6002
Copy link
Contributor

@hogo6002 hogo6002 commented May 6, 2024

Fixes #2103

The current modfied time of a combine-to-osv entry only reflects the CVE modified time without checking if any parts has been changed. Updates code to set the modified field to the most recent modification time of parts' components or the original CVE entry.

  • Uses os.Stat(file).ModTime() to check the last modified time of each part.
  • Maintains a map to record the most recent modification of each part file associated with each CVE ID.
  • Updates PackageInfo's modified field if the part modified time is later than the original CVE's modified time.

It may not be the best implementation, but its failure wouldn't affect the logic of any existing code.

Copy link
Contributor

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

Thanks!

vulnfeeds/cmd/combine-to-osv/main.go Outdated Show resolved Hide resolved
vulnfeeds/cmd/combine-to-osv/main.go Outdated Show resolved Hide resolved
vulnfeeds/cmd/combine-to-osv/main.go Show resolved Hide resolved
vulnfeeds/cmd/combine-to-osv/main.go Outdated Show resolved Hide resolved
@hogo6002 hogo6002 requested a review from another-rex May 6, 2024 07:39
Copy link
Contributor

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

minor comment, otherwise LGTM!

vulnfeeds/cmd/combine-to-osv/main.go Show resolved Hide resolved
@another-rex another-rex merged commit fd8f8fc into google:master May 7, 2024
11 checks passed
hogo6002 added a commit that referenced this pull request May 7, 2024
hogo6002 added a commit that referenced this pull request May 9, 2024
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.

combine-to-osv doesn't reflect last modified time of component parts
2 participants