google / google/osv.dev

Invalidate `last_update_date` when source changes

Open
#2,424 2 comments 0 reactions 0 assignees View on GitHub
backlog enhancement infra techdebt
Dominant language
Go
Stars
2.9k
Forks
369
Avg merge
1d 17h
Merged PRs (30d)
149

Description

Currently, if we change e.g. a bucket or REST endpoint in a SourceRepository and reimport, we may have the following race condition with these checks:

https://github.com/google/osv.dev/blob/6b36cfb6432c37bd2c68e2260f13adff9f0dd45f/docker/importer/importer.py#L465

https://github.com/google/osv.dev/blob/6b36cfb6432c37bd2c68e2260f13adff9f0dd45f/docker/importer/importer.py#L671

This checks whether the candidate record was updated since the last `SourceRepository` update as an optimisation.

However, if the bucket/REST URL changes, this is irrelevant, and could lead to missed imports because the new bucket/REST URL could've been populated before the last `SourceRepository` import with the old source.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.