Skip to content

Conversation

@robert-cronin
Copy link
Contributor

@robert-cronin robert-cronin commented Jul 18, 2025

  • Adds generate command

Closes #298

This PR is dependent on #1228

@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

❌ Patch coverage is 28.92562% with 344 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.68%. Comparing base (8cb4a5c) to head (e01f207).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/generate/generate.go 35.18% 220 Missing and 14 partials ⚠️
pkg/generate/cmd.go 0.00% 101 Missing ⚠️
pkg/common/registry.go 0.00% 8 Missing ⚠️
pkg/patch/single.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1212      +/-   ##
==========================================
- Coverage   49.38%   47.68%   -1.71%     
==========================================
  Files          38       41       +3     
  Lines        5415     5864     +449     
==========================================
+ Hits         2674     2796     +122     
- Misses       2569     2884     +315     
- Partials      172      184      +12     

☔ 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.

@robert-cronin
Copy link
Contributor Author

robert-cronin commented Jul 22, 2025

Test run on nginx:1.21.6:

❯ copa generate -i nginx:1.21.6 -r nginx-1.21.6-vulns.json | docker build -t nginx:1.21.6-patched-pipe -
INFO[0000] Patched image name: docker.io/library/nginx:1.21.6-patched 
[+] Building 0.0s (0/0)  docker:default
[+] Building 5.4s (9/12)                                                                                                                                                                          
 => resolve image config for docker-image://docker.io/library/nginx:1.21.6                                                                                                                   1.7s
...
...                                                                                                                                                              0.0s
 => CACHED /bin/busybox sh -c r.io/library/nginx:1.21.6) -> (merge (docker-image://docker.io/library/nginx:1.21.6, diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) ->  0.9s
                status="$DPKG_STATUS_IS_UNKNOWN"ginx:1.21.6, diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) -> (sh -c apt-get install --no-install-recommends -y lib  0.5s
                if [ -f "$DPKG_STATUS_PATH" ]; then                                                                                                                                          0.4s
                    status="$DPKG_STATUS_IS_FILE"                                                                                                                                            1.3s
       0.0sg 0.0s (0/0)  docker:default                                                                                                                                                      0.4s
 => apt-get update                                                                                                                                                                           1.5s
 => sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1                                                                                                                           1.2s
 => sh -c apt-mark showhold | tee /held.txt                                                                                                                                                  0.5s
 => sh -c apt-get install --no-install-recommends -y libssl1.1 libgnutls30 libgssapi-krb5-2 libc-bin libcurl4 libtiff5 login ncurses-base libc6 libcom-err2 libexpat1 libext2fs2 libsepol1  24.6s
 => sh -c grep "^Package:\|^Version:" "/var/lib/dpkg/status" >> "results.manifest"                                                                                                           0.2s
 => diff (sh -c apt-get install --no-install-recommends -y libssl1.1 libgnutls30 libgssapi-krb5-2 libc-bin libcurl4 libtiff5 login ncurses-base libc6 libcom-err2 libexpat1 libext2fs2 libs  0.1s
 => => diffing                                                                                                                                                                               0.1s
 => diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) -> (sh -c apt-get install --no-install-recommends -y libssl1.1 libgnutls30 libgssapi-krb5-2 libc-bin libcurl4 lib  0.0s
 => merge (docker-image://docker.io/library/nginx:1.21.6, diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) -> (sh -c apt-get install --no-install-recommends -y libssl  0.0s
 => diff (docker-image://docker.io/library/nginx:1.21.6) -> (merge (docker-image://docker.io/library/nginx:1.21.6, diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) ->  0.9s
 => => merge (docker-image://docker.io/library/nginx:1.21.6, diff (sh -c apt-get -s upgrade 2>/dev/null | grep -q ^Inst || exit 1) -> (sh -c apt-get install --no-install-recommends -y lib  0.5s
 => => diffing                                                                                                                                                                               0.4s
 => exporting to client tarball                                                                                                                                                              1.3s
 => => sending tarball                                                                                                                                                                       0.4s
------
 > docker-image://ghcr.io/project-copacetic/copacetic/debian:11-slim:
[+] Building 0.3s (0/1)                                                                                                                                                            docker:default
[+] Building 5.3s (6/6) FINISHED                                                                                                                                                   docker:default
 => [internal] load remote build context                                                                                                                                                     0.4s
 => copy /context /                                                                                                                                                                          0.3s
 => [internal] load metadata for docker.io/library/nginx:1.21.6                                                                                                                              0.7s
 => CACHED [1/2] FROM docker.io/library/nginx:1.21.6@sha256:2bcabc23b45489fb0885d69a06ba1d648aeda973fae7bb981bafbb884165e514                                                                 0.0s
 => [2/2] COPY patch/ /                                                                                                                                                                      2.7s
 => exporting to image                                                                                                                                                                       0.8s
 => => exporting layers                                                                                                                                                                      0.7s
 => => writing image sha256:1e6a84f9b3ef0b88e10ef1a949611563a9cbf6c7fd69b62852b9e8161737a779                                                                                                 0.0s
 => => naming to docker.io/library/nginx:1.21.6-patched-pipe

@robert-cronin robert-cronin force-pushed the feat/copa-generate branch 12 times, most recently from ed00e87 to a497bd4 Compare July 28, 2025 08:10
@robert-cronin robert-cronin force-pushed the feat/copa-generate branch 2 times, most recently from 9c5294f to 558701d Compare August 5, 2025 06:41
@robert-cronin robert-cronin force-pushed the feat/copa-generate branch 10 times, most recently from ce90981 to 9c5f669 Compare August 18, 2025 06:33
@robert-cronin robert-cronin marked this pull request as ready for review August 18, 2025 06:53
@robert-cronin robert-cronin force-pushed the feat/copa-generate branch 7 times, most recently from 3ed1fb7 to 525297f Compare September 24, 2025 01:09
@robert-cronin robert-cronin force-pushed the feat/copa-generate branch 2 times, most recently from 3caa623 to b46c111 Compare September 26, 2025 08:34
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Copacetic Workboard Sep 26, 2025
@robert-cronin robert-cronin reopened this Sep 26, 2025
@robert-cronin robert-cronin moved this from ✅ Done to 👀 In review in Copacetic Workboard Sep 30, 2025
@ashnamehrotra
Copy link
Contributor

Waiting to merge after #1274

@robert-cronin robert-cronin added this to the v0.12.0 milestone Oct 6, 2025
Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
Copy link
Member

Choose a reason for hiding this comment

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

rename to docker-build.md? we can add frontend to this too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have an existing document for the frontend but maybe we can merge them in the other PR?

Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
@robert-cronin robert-cronin merged commit 13198fb into project-copacetic:main Oct 7, 2025
35 of 36 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Copacetic Workboard Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[REQ] Add copa generate command for streaming tar

3 participants