Refresh updatefile on each check even if we're not updating, fixes #479 #489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Problem/Issue/Bug:
OP #479: Our update strategy is not working because we only refresh the update file if an update is found. Thus we're regularly running afoul of github's API limit, it even broke a test today. Basically, once the update file gets older than a week, every single invocation of ddev results in a hit on github.
How this PR Solves The Problem:
Instead of refreshing the update file when an update is ready, it does it every time we hit the update interval (and before we even check for an update).
Note: This also does the docker check before the update check, because the docker check is fatal and the update check is not. That lets the update check just return with a warning in some situations.
Manual Testing Instructions:
touch -t 201708200000 ~/.update
then usels -al ~/.ddev/.update
to review the results.Automated Testing Overview:
There were no existing tests around this code (that I found), and I didn't add any.
Related Issue Link(s):
OP #479
Release/Deployment notes:
Our users start getting impacted by this bug one week after first using the tool, and until an update comes out. One way we can help them is by adding this to an interim release, thus causing the file to be refreshed in buggy versions of ddev. So we should prepare a tag and release.