-
Notifications
You must be signed in to change notification settings - Fork 102
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
Improve tools download to be stable #641
Comments
If providers of downloads would only care about systematic URLs the world could be so great:
https://openjdk.net resp. https://adoptium.net are by far the worst providers. Just two simple examples:
Just some concerns:
Please be systematic and stop making our lives so uneccesary hard! |
Please use the consistent API at https://api.adoptium.net for downloads :-) |
Thanks for the nice joke. Surely you can quickly see that this enitre repo is about automation of download, installation, configuration and maintenance of IDE installations during the entire project lifecycle. |
I have implemented this story as planned. Some problems are that now in the commandlets we still have various tool specific quirks (for different understandings of
In the end we currently can already solve all issues without these changes and without any version-specific file. However, this story aims to get us prepared for the unexpected and keep stability and maintainability of devonfw-ide. Therefore, I think the invest in the proposed change makes sense. For JDK we could then also omit requests ending in 404 for older releases that are not on adopotium but only on AdoptOpenJdk. |
I'm sorry - I was simply responding to the fact that it appeared you are going directly to the GitHub downloads (which is rate limited and has inconsistent naming) as opposed to using the API (which isn't perfect, but has a better user experience). I/we have no way of knowing the details of the 1Million+ of different users and use cases of Adoptium! |
you also said
I feel there needs even to be a solution then, which has not yet specified here to declare version ranges or take the notation of package.json files in regards to version specifications to make it possible to say "this is the url for all versions greater than" or even lower than. Not sure, whether the 404 really is a problem here as we simply can handle it internally so it will not bother the user right? So possibly taking it as it is right now might be all we need for the moment.
I feel we should start KISS, as you said, we already solve all issues. So possible we should go for it for the moment as there are more urgent things, we might want to focus first on and take this up with the ideas you already provided to extend the logic to take further cases into account when they arise. |
@maybeec thanks for your feedback.
With the proposed solution we can do that via However, we also have the chance to configure exceptions for entire ranges of versions (e.g. only by major version).
It is not a problem but it is waste and we should also care about sustainability. With the current solution I can tell that for specific java versions the first request will always end up as 404. That could be improved. Surely this itself is nice-to-have.
You are missing the point that we create an API with this new repo that we cannot change easily in the future. |
@hohwille, fine, you are right, that the changes on the new repo need to be backward compatible or you will have to create a new repo or branch every time you are doing incompatible changes. A new branch for example might be a solution here. Anyhow, I agree we should be as KISS as possible. So fine, if time allows to make it even more bullet proof before the release. I also thought about the ability to have the same schema within the setttings folder (by default empty), which would allow people of a project to put their own mirrors there as well in the same scheme. This could be even a good consolidation on how custom tools are managed at the moment, which is inconsistent to how the already supported tools are managed. |
I am sorry, too, as I was a little stupid and did not understand in the first place, what you have been suggesting (I thought you wanted me to parse the HTML of your website to find the download links). However, our download scripts have to run on any machine with minimal prerequisites and are therefore written in bash. Invoking restful APIs and parsing JSON is not much fun in bash. |
Great! Our API docs are at https://api.adoptium.net/q/swagger-ui/ |
This issue itself is considered done. I have created new issues in ide-mirrors repo. |
For the record. I already implemented something similar as a kind of hidden feature:
So via the variable |
So here is our plan how we want to fix issues like #626 on the long run:
ide-mirrors
eclipse
,java
,mvn
)default
that contains download mirror base URLs (one URL per line)default
mirror list, we create a separate file named exactly like the version of the tool (e.g.2021-03
or11.0.9.1_1
) that contains the alternative mirror URLside-mirrors
in addition to the settings. However here we always clone the original repo maintained by us from github.doDownload
function to also take additional parametersopenjdk${major_version}-binaries/releases/download/${jdk_folder}/OpenJDK${major_version}U-jdk_x64_${os}_hotspot_${software_version}${extension}
) or alternatively (maybe even better) we use variables in the URLs on theide-mirrors
that are later resolved (but beside standard variables likeos
andversion
we would then need to provide variables from the commandlet todoDownload
that then needs to resolve those variables)doDownload
function is changed such that itide-mirrors
local cloneide-mirrors
default
as fileide-mirrors
- e.g. if a project adds its own commandlet and maybe even uses internal URLs for download that shall not be published on github).So our current approach is that we have all mirrors hard-coded in commandlets. With the new approach this is the same as if we had this mirror URL configured in the
default
file for each according tool. However, we then can change this for every IDE installation with at least a version containing this story implemented around the globe without any new release ofdevonfw-ide
and without the need for any project to update to that new release. Further, we can add additional mirrors and for specific versions of a tool we can override the mirrors to fix bugs like #618 (we would changedefault
to the new location and copy the old mirrors to all old java versions we support or know about).So to sum up, we get back control to fix download issues and avoid that a single distributor of a software (mirror) who has issues with availability of his download service can block devonfw-ide in the future.
With this also comes some responsibility: we need to be aware that with changing the
ide-mirrors
repo we can not only fix a download issue worldwide but also break all IDEs worldwide when we push broken stuff.For the record: We always avoid that we evaluate dynamic script logic from external sources for security reasons. It might be easier and more flexible if we would provide a bash function in
ide-mirrors
repo that takes tool and version as parameter and provides the full download URL for your OS and architecture. However, then an attacker could interfere EVERY IDE installation around the globe if he for whatever reason manages to manipulate such a file. Surely an attacker could also try to manipulate a scipt in devonfw-ide directly but here we still have a release process and are in control. With automated download script from the internet we would open the door for sensible vulnerability that I strictly want to avoid.The text was updated successfully, but these errors were encountered: