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

Allow not to create subdirectory for jdk extraction #14847

Merged

Conversation

EzzhevNikita
Copy link
Contributor

@EzzhevNikita EzzhevNikita commented May 17, 2021

Task name: JavaToolInstallerV0

Description: Added additional input for the task that allows disabling adding additional directory in jdkDestinationDirectory.

  • Previously when task installed JDk into the directory that looks similar to this like (it created additional directory for JDK inside DestinationDirectory):
    jdkDestinationDirectory/JAVA_HOME_8_X64_OpenJDK_zip

  • In new behavior, by default, we don't change the installation path and it will look in the same format, but we could disable the creation of subdirectory, using createExtractDirectory input.

Documentation changes required: (Y/N) Y

Added unit tests: (Y/N) N

Attached related issue: (Y/N) #14778

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

@EzzhevNikita EzzhevNikita requested a review from a team as a code owner May 17, 2021 05:56
@EzzhevNikita EzzhevNikita force-pushed the users/EzzhevNikita/allow_not_to_create_extractdirectory branch from 66f042e to 47363e6 Compare May 17, 2021 06:07
Copy link
Contributor

@DaniilShmelev DaniilShmelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the comments, but other than that LGTM, thanks!
Let me test this manually as well

@EzzhevNikita EzzhevNikita requested a review from a team May 17, 2021 08:58
Copy link
Contributor

@anatolybolshakov anatolybolshakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@DaniilShmelev
Copy link
Contributor

Task failed with the following error:
##[error]JDK file is not valid. Verify if JDK file contains only one root folder with 'bin' inside.

Repro:

- task: JavaToolInstallerM@0
  displayName: 'createExtractDirectory=false'
  inputs:
    versionSpec: 7
    jdkArchitectureOption: x64
    jdkSourceOption: AzureStorage
    azureResourceManagerEndpoint: $(StorageAccountConnection)
    azureStorageAccountName: $(StorageAccountName)
    azureContainerName: $(AzureContainerName)
    azureCommonVirtualFile: $(ArchiveName)
    jdkDestinationDirectory: ./tempAzure/java_dir
    createExtractDirectory: false

@EzzhevNikita
Copy link
Contributor Author

Task failed with the following error:
##[error]JDK file is not valid. Verify if JDK file contains only one root folder with 'bin' inside.

Repro:

- task: JavaToolInstallerM@0
  displayName: 'createExtractDirectory=false'
  inputs:
    versionSpec: 7
    jdkArchitectureOption: x64
    jdkSourceOption: AzureStorage
    azureResourceManagerEndpoint: $(StorageAccountConnection)
    azureStorageAccountName: $(StorageAccountName)
    azureContainerName: $(AzureContainerName)
    azureCommonVirtualFile: $(ArchiveName)
    jdkDestinationDirectory: ./tempAzure/java_dir
    createExtractDirectory: false

Yeah thanks, I found this problem too

@DaniilShmelev
Copy link
Contributor

Tested these changes manually with azure and local JDK. Found no issues.

@EzzhevNikita EzzhevNikita merged commit 88a49c4 into master May 20, 2021
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