Skip to content
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

Avoid "+" sign in Java path in v2-preview #145

Merged
merged 12 commits into from
Mar 27, 2021

Conversation

maxim-lobanov
Copy link
Contributor

@maxim-lobanov maxim-lobanov commented Mar 25, 2021

Description:
Initially, we have implemented logic to save Java on local disk using Java version semver notation: /hostedtoolcache/Java/11.0.3+4.

Recently, we have faced with the issue on images side that it breaks some tricky Kotlin and Java use-cases. Find more details in actions/runner-images#3014

As a fix, we are replacing + to - during reading versions from local cache and when put them to local cache.
So it will be store Java on path like /hostedtoolcache/Java/11.0.3-4. It also works for Adopt versions like 11.0.3+4.2.256, it will be 11.0.3-4.2.256
As a additional benefit: with this approach toolkit/toolcache is able to resolve 4-digits versions in tool-cache properly
Also added additional unit-tests to cover it

@maxim-lobanov maxim-lobanov marked this pull request as ready for review March 25, 2021 09:41
@konradpabjan
Copy link
Collaborator

konradpabjan commented Mar 25, 2021

One small issue, I'm looking at the E2E tests and the output shows that the path has a +, I think that should be different.

Here is a output for Adopt

image

Here is Zulu

image

Edit: JK, actions are on Ring 0 so they have the old images with + in the path. No actions needed

@maxim-lobanov maxim-lobanov merged commit 46d5f06 into actions:v2-preview Mar 27, 2021
maxim-lobanov added a commit that referenced this pull request Apr 5, 2021
* actions/setup-java@v2 - Support different distributions (#132)

* Implement support for custom vendors in setup-java

* minor improvements

* minor refactoring

* Add unit tests and e2e tests

* Update documentation for setup-java@v2 release

* minor improvements

* regenerate dist

* fix comments

* resolve comments

* resolve comments

* fix tests

* Update README.md

Co-authored-by: George Adams <george.adams@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* fix minor nitpicks

* handle 4th digit

* pull latest main

* Update README.md

* rename adoptium to adopt

* rename adoptium to adopt

* rename adoptium to adopt

* Update README.md

* make java-version and distribution required for action

* update readme

* fix tests

* fix e2e tests

Co-authored-by: George Adams <george.adams@microsoft.com>
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* Add "overwrite-settings" input parameter (#136)

* add overwrite-settings parameter

* fix e2e tests

* print debug

* fix e2e tests

* add comment

* remove comment

* Add "Contents/Home" postfix on macOS if provider creates it (#139)

* Update e2e-versions.yml

* Update e2e-versions.yml

* implement fix

* Update e2e-versions.yml

* Update installer.ts

* fix filter logic

* Update e2e-versions.yml

* remove extra logic

* Update e2e-versions.yml

* Add check-latest flag (#141)

* add changes for check-latest

* run prerelease script

* resolving comments

* fixing tests

* fix spelling

* improve core.info messages

* run format

* run prerelease

* change version to fix test

* resolve comment for check-latest

* Update README.md

* added hosted tool cache section

* Apply suggestions from code review

Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>

* Avoid "+" sign in Java path in v2-preview (#145)

* try to handle _ versions

* more logs

* more debug

* test 1

* more fixes

* fix typo

* Update e2e-versions.yml

* add unit-tests

* remove debug info from tests

* debug pre-cached versions

* change e2e tests to ubuntu-latest

* update npm licenses

Co-authored-by: George Adams <george.adams@microsoft.com>
Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
Co-authored-by: Dmitry Shibanov <dmitry-shibanov@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants