Skip to content

feat: Bulk Image Patching #1235

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

amanycodes
Copy link
Contributor

@amanycodes amanycodes commented Jul 29, 2025

This PR introduces bulk patching for copa that allows user to patch multiple container images by passing a single YAML config file path in the --config flag.

eg: copa patch --config path/config.yaml

This is the initial implementation which focuses on the "comprehensive/update-all" patching foundational for report based bulk image patching for future prospects.

The design doc which this is implemented on: Bulk Image Patching

Closes #631

Signed-off-by: amanycodes <[email protected]>
Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 30.12821% with 218 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.42%. Comparing base (526f809) to head (797798c).

Files with missing lines Patch % Lines
pkg/bulk/engine.go 0.00% 167 Missing ⚠️
pkg/bulk/discover.go 64.94% 31 Missing and 3 partials ⚠️
pkg/bulk/config.go 65.38% 6 Missing and 3 partials ⚠️
pkg/cmd/cmd.go 63.63% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1235      +/-   ##
==========================================
- Coverage   42.86%   42.42%   -0.45%     
==========================================
  Files          35       38       +3     
  Lines        4122     4427     +305     
==========================================
+ Hits         1767     1878     +111     
- Misses       2224     2414     +190     
- Partials      131      135       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amanycodes amanycodes marked this pull request as ready for review August 1, 2025 19:20
Copy link
Contributor

@robert-cronin robert-cronin left a comment

Choose a reason for hiding this comment

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

Added some comments. Great to see copa get a config file! This is a great addition, thanks!

pkg/cmd/cmd.go Outdated
Short: "Patch container images with upgrade packages specified by a vulnerability report",
Example: "copa patch -i images/python:3.7-alpine -r trivy.json -t 3.7-alpine-patched",
Use: "patch",
Short: "Patch container images with upgrade packages specified by a vulnerability report or by comprehensive update",
Copy link
Member

Choose a reason for hiding this comment

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

since this is the initial scope:

Suggested change
Short: "Patch container images with upgrade packages specified by a vulnerability report or by comprehensive update",
Short: "Patch container images with upgrade packages specified by comprehensive update",

Copy link
Contributor Author

@amanycodes amanycodes Aug 4, 2025

Choose a reason for hiding this comment

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

@sozercan but this short is for the patch command as a whole right? not just bulk image patch. maybe we can specify comprehensive update for bulk additionally.

@@ -1,32 +0,0 @@
package patch
Copy link
Member

Choose a reason for hiding this comment

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

why did this get removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cmd.go was moved to its own package (pkg/cmd) as i was having cyclic dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

[REQ] bulk image patching
3 participants