-
Notifications
You must be signed in to change notification settings - Fork 90
fix: checkUpgradable runs unconditionally in dpkg #1072
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: amanycodes <amanycodes@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1072 +/- ##
==========================================
- Coverage 45.62% 45.52% -0.11%
==========================================
Files 20 20
Lines 3134 3139 +5
==========================================
- Hits 1430 1429 -1
- Misses 1596 1600 +4
- Partials 108 110 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@amanycodes thanks for investigating! this should be expected behavior (if there are no upgradable packages with scan report or update all we should error out). It should be the case for dpkg, and rpm - can we change it for apk? In the issue I was referring to the logs such as "no patchable packages found" which we output for rpm but do not explicitly output in other cases. This way users will know patching is failing because there were not upgradable packages. Let me know if that makes sense! |
Yeah, makes sense! will update the dpkg and apk to show the error of "no patchable packages found". I misunderstood this with existing packages not being further upgradable. Thanks for clarification! Also is that unconditional execution in |
Signed-off-by: amanycodes <amanycodes@gmail.com>
I'm still confused about the check we're doing in |
This PR checks and improves log consistency for "No Upgradable Packages" (NUP) across
rpm
,dpkg
, andapk
package managers. It also fixes a bug in the dpkg manager (later discussed).I ran
copa patch
with a dummy report to simulate NUP. Dummy Report structure (dpkg example):I checked consistency on two cases for each package manager:
installedVersion == FixedVersion
and expected a log like:INFO[...] Validated package <pkg> version <ver> meets requested version <ver>
FixedVersion > InstalledVersion
: The package manager attempts an upgrade but leaves the package at its originalInstalledVersion
because the higherFixedVersion
is not found in its repositories and expected log like:ERRO[...] installed package <pkg> version <ver> is lower than required <ver> from report
I used a regular copa patch command:
copa patch -i $IMAGE -r $REPORT --debug
For apk: I used

alpine:latest
and checked forbusybox
andscanelf
and got:For rpm: I used


rockylinux:9-minimal
and checked forcoreutils-single
and got:For dpkg: I used

ubuntu:22.04
and checked fortar
and got:and in
dpkg
I found the inconsistency. Upon checking theinstallUpdates()
I found thatcheckUpgragdable
was being unconditionally executed. copa was failing & terminating the patching early if image has no general updates even though report was specified. I have now fixed this and it's being conditionally executed(only running this check in "update all" mode like in apk.go).This makes the logging for NUP consistent across all package managers.
partially closes: #1010