Skip to content

refactor(linter): rewrite linter cronjob in go#5104

Open
jess-lowe wants to merge 10 commits intogoogle:masterfrom
jess-lowe:refactor/rewrite-linter-in-go
Open

refactor(linter): rewrite linter cronjob in go#5104
jess-lowe wants to merge 10 commits intogoogle:masterfrom
jess-lowe:refactor/rewrite-linter-in-go

Conversation

@jess-lowe
Copy link
Copy Markdown
Contributor

The linter cronjob is currently timing out and not completing due to some error. Instead of fixing that, I'll take the opportunity to rewrite the linter in Go instead.

Comment thread go/cmd/osv-linter-worker/main.go Outdated
Comment thread go/cmd/osv-linter-worker/main.go Outdated
@jess-lowe jess-lowe marked this pull request as ready for review April 24, 2026 06:12
@jess-lowe jess-lowe requested a review from michaelkedar April 24, 2026 06:12
Copy link
Copy Markdown
Member

@michaelkedar michaelkedar left a comment

Choose a reason for hiding this comment

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

I think this is good, just a couple of things

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe move this file to go/cmd/osv-linter-worker (and make sure all the paths here & in build-and-stage still work)


func run() error {
ctx := context.Background()
dsClient, err := datastore.NewClient(ctx, gcpProject)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we abstract away the Datastore stuff behind an interface like the importer does so this is easier to migrate in the future.
We have a SourceRepositoryStore already that is probably already sufficient for this, and you could make an ImportFindingsStore + struct that has the methods/fields you need

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe the ImportFindingsStore could also do the GCS bucket things too? Or are the bucket outputs unlikely to be migrated?

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