feat: log successful uploads in combine-to-osv#5050
Merged
jess-lowe merged 5 commits intogoogle:masterfrom Mar 16, 2026
Merged
Conversation
This modifies the cveworker `uploadToGCS` and `writeToDisk` routines to return a boolean flag indicating if a file was actually modified or written (i.e. not skipped due to matching hash). The `Worker` method now accepts an `atomic.Uint64` pointer to accumulate the success counts. Finally, the main `Upload` function creates the counter, passes it to the workers, and logs the total successful uploads upon completion. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com>
This modifies the cveworker `uploadToGCS` and `writeToDisk` routines to return a boolean flag indicating if a file was actually modified or written (i.e. not skipped due to matching hash). The `Worker` method now accepts an `atomic.Uint64` pointer to accumulate the success counts. Finally, the main `Upload` function creates the counter, passes it to the workers, and logs the total successful uploads upon completion. Fixes golangci-lint nlreturn issue on writeToDisk. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com>
another-rex
reviewed
Mar 15, 2026
This modifies the cveworker `uploadToGCS` and `writeToDisk` routines to return a boolean flag indicating if a file was actually modified or written (i.e. not skipped due to matching hash). It also adds documentation to these functions explaining the new boolean return value. The `Worker` method now accepts an `atomic.Uint64` pointer to accumulate the success counts. Finally, the main `Upload` function creates the counter, passes it to the workers, and logs the total successful uploads upon completion. Fixes golangci-lint nlreturn issue on writeToDisk. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com>
This modifies the cveworker `uploadToGCS` and `writeToDisk` routines to return an error rather than logging errors internally. It introduces `ErrUploadSkipped` to gracefully communicate that an upload was bypassed due to a matching hash. The `Worker` method now handles these errors, logs them appropriately, and accepts an `atomic.Uint64` pointer to accumulate successful writes and uploads. Finally, the main `Upload` function creates the counter, passes it to the workers, and logs the total successful uploads upon completion. Co-authored-by: jess-lowe <86962800+jess-lowe@users.noreply.github.com>
another-rex
approved these changes
Mar 15, 2026
Comment on lines
+195
to
+197
| if counter != nil { | ||
| counter.Add(1) | ||
| } |
Contributor
There was a problem hiding this comment.
Are we expecting the counter to ever be nil? I think we can get rid of this check, and just panic if we forgot to pass in a counter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's nice to know how many records were actually changed on the combine to osv run