-
Notifications
You must be signed in to change notification settings - Fork 45
#1181: UrlUpdater fetches every defined version for Docker #1117
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?
#1181: UrlUpdater fetches every defined version for Docker #1117
Conversation
- deleted the new line patterns out of the regex in DockerDesktopUrlUpdater because Pattern.DOTALL already handles this
Pull Request Test Coverage Report for Build 18510598572Details
💛 - Coveralls |
- Added a fallback for "*" (Latest) - Version to be found in the filesystem - Added a fallback to name the downloadcache file to latest if version is "*" (latest)
- Changed order to prevent nullpointer - changed structure to if-else
- Changed order to prevent nullpointer
- Added test for only latest version
- Refactored UrlUpdaterMockSingle to modify the verion which should be tested - deleted temporary test case
- Updated CHANGELOG.adoc
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.
@mbilda thank you very much for your PR. You did a great job and very well analysed the problem. Even you tested the URL Updater via GHA in your fork. Excellent 🚀
However, I checked the logs of your test run and found e.g. this line:
12:28:42.793 [com.devonfw.tools.ide.url.UpdateInitiator.main()] - WARN - c.d.t.i.u.updater.AbstractUrlUpdater - For tool docker and version 4.33.2 the download verification failed with status code 403 for URL https://desktop.docker.com/win/main/amd64/179689/Docker%20Desktop%20Installer.exe.
It seems that there are a lot of such errors and I can also reproduce this in my browser:

My assumption is that after merging this we get dedicated versions of docker desktop but no URL for Windows and therefore we will entirely break it for Windows users.
Could you confirm my observations and maybe find a solution to improve your PR?
|
See also this final summary: |
|
@hohwille good point. Why do we even try to download this version? The crucial part of this is the following: TODO:
Furthermore, if the download of the non-existing windows version fails, we return out of the addVersions()-function and skipping the "maybe existing" other versions for mac. Questions:
|
- Refactored DockerDesktopUrlUpdater to verify each version before downloading
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.
so far we do not have dedicated versions of docker-desktop:
https://github.com/devonfw/ide-urls/tree/master/docker/docker/
That means this PR is adding this as a new feature.
I found that the web-site you are crawling (https://docs.docker.com/desktop/release-notes/) also contains checksum links pointing to SHA256 checksums.
You should also use these checksums since otherwise our fallback applies to compute them ourselves what requires that we download every entire release and compute the checksum ourselves what causes gigabytes of wasted bandwidth and makes the process also much slower.
See here for an existing example:
IDEasy/url-updater/src/main/java/com/devonfw/tools/ide/url/tool/intellij/IntellijUrlUpdater.java
Lines 83 to 84 in a44dc22
| String cs = getCheckSum(checkSumLink); | |
| doAddVersion(url, link, os, systemArchitecture, cs); |
url-updater/src/main/java/com/devonfw/tools/ide/url/tool/docker/DockerDesktopUrlUpdater.java
Outdated
Show resolved
Hide resolved
# Conflicts: # CHANGELOG.adoc
|
This PR extends on the fly because there are several open points to discuss to handle the new url updater for docker desktop.
This PR handles two individual things. The first one is the fix for the actual bug. IDE could not handle latest version. Because it is resolved to " * ". The second one is the improvement of the url updater which throws a lot of open questions. To get things done, i will exclude the first part of this PR and create a new PR for this fix only. (#1182) |
…essary versions devonfw#1181 - removed the fix for issue devonfw#692
…essary versions - removed changelog
…essary versions - removed test for different issue
…essary versions - formatting
…essary versions - added checksum curl to get checksum for specific version - added checksum result to addVersion to prevent url updater to calculate checksum by itself
I added the checksum to the addVersion method. |
url-updater/src/main/java/com/devonfw/tools/ide/url/tool/docker/DockerDesktopUrlUpdater.java
Outdated
Show resolved
Hide resolved
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.
Thanks for adding the checksum check too. I've added a small suggestion, please check.
…essary versions - added review remarks - introduced constants to remove hardcoded filename
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.
LGTM.
# Conflicts: # url-updater/src/main/java/com/devonfw/tools/ide/url/tool/docker/DockerDesktopUrlUpdater.java
fixed the regex for the download urls (made sure that all versions can be found) made sure that a dynamic base URL can be used by WireMock added a test for the DockerDesktopUrlUpdater (using an old download URL pattern and a new one) added a test resource file based on the original website

Closes: #1181
With this implementation i was able to create versionized folders in my custom repository for the defined docker versions:

This still needs to be tested with workflow because test <-> workflow isn't the same environment and so on.
We were also able to test the "real" UrlUpdater via github actions. We created a custom github action for testing the url updater. We checked out the url repository to fetch all existing versions and were able to upload/download the temporarily produced new repo.

The results can be seen here:
https://github.com/mbilda/IDEasy/actions/runs/13834518742