-
Notifications
You must be signed in to change notification settings - Fork 470
MODULES-10763 Only report apt-get update as a corrective change if /var/cache/apt/pkgcache.bin changes. #1073
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
|
Thanks, @kenyon -- Fixed along with another missed dollar-sign escape. |
|
Hey @pillarsdotnet - appreciate this contribution. However, I wonder if the changes introduce are slightly hard to follow. Is there a more idiomatic approach we could take? |
|
I'm open to suggestions, but this is how I've been resolving the problem locally while this bug stood unresolved for the last two years. |
|
Hi @pillarsdotnet, it seems like this change is producing a few failures in our automated testing. These need to be addressed before we can think about merging your PR. |
ef6a14c to
43e7a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failures are certainly due to these changes. Maybe need to set the provider to shell? Not sure why it's giving an empty string as the command in the error.
|
The weird thing is that it's giving an empty string as the command in errors for other execs besides the one I modified. |
|
Okay, setting |
de12063 to
bf97014
Compare
|
Re-coded in case the testing box lacks the |
Sorry; I don't know how to ping the modules team. Should I post in slack every time I push a commit? |
Sorry; I was assuming (based on previous experience) that unless I ping someone, the tests won't run. What is the recommended process for getting tests to run in a timely manner? |
|
the tests will run when someone with merge permissions presses the button :) |
|
WOO-HOO! All acceptance tests that are in any way related to the changes in this PR are now passing. I've squashed all the commits in order to reduce noise. Can I get a review, please? |
31e5458 to
d9985d8
Compare
|
Some of the other spec tests check whether the |
dad3813 to
23e22b6
Compare
|
On re-reading the docs for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like this because it makes the apt_update exec much more complicated. As mentioned in previous comments #1073 (comment), the right way to set up a periodic apt update is with unattended-upgrades. So then the only time this exec command gets run is when there really is a corrective change, because it has been refreshed by another resource.
|
Thanks, @kenyon I've implemented your suggestions. Unfortunately, re-tooling to run unattended-upgrades instead of invoking the package resource is not an option for us. Since there is not a mechanism that will trigger The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, but I'm not an apt expert.
|
@pillarsdotnet I don't think that's true about the |
|
Also, this PR is for the |
|
Hey 👋! I don't want to be the guy blocking things but this change does not look correct from my window 😞:
|
|
@pillarsdotnet can you elaborate on why enabling the apt-daily systemd service and timer that come with apt are not possible for you? There is no "re-tooling" to be done, you already have it because it comes with apt. That is the standard Debian way of keeping the package cache up to date: https://debian-handbook.info/browse/stable/sect.regular-upgrades.html (which the unattended_upgrades module can configure, and it is not required to also enable automatic package upgrades) If you wanted to run |
Instead of running
apt-get updateas an exec directly, we run it as theunlessattribute of an exec.After running
apt-get update, if the content of/var/cache/apt/pkgcache.binis unchanged, the exec does not run, and reports no change.If the content of
/var/cache/apt/pkgcache.binchanges, the exec runs and reports a corrective change.This resolves MODULES-10763.