-
Notifications
You must be signed in to change notification settings - Fork 174
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
win_get_url - Make checksum work more like ansible.builtin.get_url #718
win_get_url - Make checksum work more like ansible.builtin.get_url #718
Conversation
dc9c0da
to
52c681b
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.
The changes you've added here look good. Appreciate you updating the docs and adding the changelog fragment but are you also able to add a test for this specific scenario. We currently have some tests with the checksum
option under https://github.com/ansible-collections/ansible.windows/blob/main/tests/integration/targets/win_get_url/tasks/tests_checksum.yml but it doesn't look like there are any ones for idempotency checking when force: false
is set.
If you need help with any of this please let me know and I can guide you where I can.
Co-authored-by: Jordan Borean <[email protected]>
I added a test for the behaviour where it shouldn't do any download if checksum already matches. Tried a few different ways but can't think of how to make an automated test for the other part. As far as I can see httpbin only sends 304 replies for the /cache endpoint, which otherwise returns dynamic data so it's impossible to make it emulate the case where we have a file that differs by checksum but the If-Modified-Since logic would say there is nothing new at the URL. |
Not sure what the failing check here is about, is it related to the PR or some CI infrastructure? |
Thanks, appreciate it.
I think that's fine to ignore for now, if we get any future regressions we can look at potentially spinning up a custom HTTP endpoint just as a test but I think that's overkill for now.
There seems to be some trouble with Zuul so the failure is unrelated here. |
SUMMARY
Makes checksum handling behave more like ansible.builtin.get_url
Fixes #717
ISSUE TYPE
COMPONENT NAME
win_get_url
ADDITIONAL INFORMATION
I'm not 100% sure about the logic to trigger collecting
$dest_checksum
, it is technically called in some circumstances it wasn't before, though if I read the code right that was only in error cases since all normal exits would calculate it at the end of the script.