refactor(vulnfeeds): migrate debian-copyright-mirror to Go - #5885
Merged
jess-lowe merged 12 commits intoSep 28, 2026
Merged
Conversation
another-rex
reviewed
Aug 24, 2026
another-rex
left a comment
Contributor
There was a problem hiding this comment.
This is a lot of unnecessary code imho. We don't need to reimplement the whole archiving stack in go. Just shell out to tar to extract the files like it did in the original script.
This should be about 200 lines of go code, not 1500
michaelkedar
previously approved these changes
Sep 25, 2026
another-rex
reviewed
Sep 25, 2026
another-rex
left a comment
Contributor
There was a problem hiding this comment.
Please also rewrite the commit to fix the CLA issue.
Contributor
There was a problem hiding this comment.
Wow actually about 200 lines, nice!
jess-lowe
force-pushed
the
refactor/debian-copyright-mirror
branch
from
September 25, 2026 04:26
7297911 to
95dcbee
Compare
another-rex
previously approved these changes
Sep 28, 2026
another-rex
left a comment
Contributor
There was a problem hiding this comment.
Nice LGTM. (PR description might need a bit of updating though)
| } | ||
|
|
||
| files, err := ExtractUnstableCopyright(stdout, prefixFilter) | ||
| _ = cmd.Wait() |
Contributor
There was a problem hiding this comment.
Can we also return this error (if this errors?)
michaelkedar
approved these changes
Sep 28, 2026
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.
Rewrites debian-copyright-mirror from Python and Bash into a standalone Go binary (vulnfeeds/cmd/mirrors/debian-copyright-mirror). Instead of buffering the entire archive and parsing the full YAML file into memory, the Go implementation streams filelist.yaml.xz over HTTP to scan for unstable package copyright files, manages parallel downloads via curl, creates the tarball archive, and uploads directly to Google Cloud Storage using the Cloud Storage Go client library. This eliminates the legacy Python and Bash scripts, removes runtime dependencies on Python and the gcloud CLI to significantly shrink the Docker container footprint, and improves reliability while maintaining full compatibility with downstream consumers like cpe-repo-gen.
Testing Done
go test ./...invulnfeeds(all tests passing).golangci-lint run(0 issues)..targeneration with live Debian changelog metadata.