Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
10582ff
Fix Attempt to Use Latest JDK Version
alzimmermsft Sep 16, 2022
49ff15c
Fix YAML expression
alzimmermsft Sep 19, 2022
eda4099
More YAML fixes
alzimmermsft Sep 19, 2022
ed722c4
And another YAML fix
alzimmermsft Sep 19, 2022
71ec979
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 19, 2022
a81e41f
Try a new approach
alzimmermsft Sep 19, 2022
9c78840
Use external PowerShell script
alzimmermsft Sep 19, 2022
4db637f
Subpath cache
alzimmermsft Sep 19, 2022
0ab213f
Use JavaBuildVersion in cache key
alzimmermsft Sep 19, 2022
aa32761
Try more different things
alzimmermsft Sep 19, 2022
1f8cf2f
Remove quotes
alzimmermsft Sep 19, 2022
a8b9456
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 20, 2022
b73ad6b
Requote the cache key
alzimmermsft Sep 20, 2022
c204416
Try adding a slash
alzimmermsft Sep 20, 2022
0142fa6
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 20, 2022
683dd5b
Use more PowerShell functions
alzimmermsft Sep 20, 2022
7327b7d
Try a different directory
alzimmermsft Sep 20, 2022
e25964d
Create directory if it doesn't exist
alzimmermsft Sep 20, 2022
6b7567f
Check OS before changing path
alzimmermsft Sep 20, 2022
7d5fc36
Change check for latest JDK
alzimmermsft Sep 20, 2022
753c241
Use a parameter
alzimmermsft Sep 20, 2022
bb0eca2
Fix invalid YAML
alzimmermsft Sep 20, 2022
49e87e0
Pass the variable everywhere
alzimmermsft Sep 20, 2022
1950e3f
Try a different check
alzimmermsft Sep 20, 2022
0a7dc80
Why not use task conditions...
alzimmermsft Sep 20, 2022
979f271
Remove condition
alzimmermsft Sep 20, 2022
d03b376
Simplify everything
alzimmermsft Sep 21, 2022
9c9bb83
Fix workingDirectory
alzimmermsft Sep 21, 2022
9cb275d
Fix JDK URI
alzimmermsft Sep 21, 2022
78dc5f5
Add more logging
alzimmermsft Sep 21, 2022
0eac84d
Use PowerShell to download JDK and DevOps task to install it
alzimmermsft Sep 21, 2022
4650f90
Revert change to using task
alzimmermsft Sep 21, 2022
bc1b1f0
More logging
alzimmermsft Sep 21, 2022
4be2dac
Remove check for OS type
alzimmermsft Sep 21, 2022
bd4a401
Drop bin in JAVA_HOME and don't update PATH
alzimmermsft Sep 21, 2022
c5c2827
Add second task to verify latest JDK install
alzimmermsft Sep 21, 2022
a412183
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 21, 2022
195e8b9
Use setvariable
alzimmermsft Sep 21, 2022
80a648e
Fix bug found with new JDK changes
alzimmermsft Sep 21, 2022
f8c82fd
Fix some documentation issues
alzimmermsft Sep 21, 2022
24ff6c4
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 21, 2022
3069f7f
Fix integration tests
alzimmermsft Sep 21, 2022
8f96251
Cache unzipped latest Java directory
alzimmermsft Sep 21, 2022
32f8ef1
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Sep 22, 2022
1fdda59
Only pass SecurityManager configuration in Java 18+
alzimmermsft Sep 22, 2022
fb044e0
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Oct 7, 2022
dce9246
Update to Java 19
alzimmermsft Oct 7, 2022
c06afef
Test out step to turn failure into warning
alzimmermsft Oct 7, 2022
a4455c8
Try another approach with status change
alzimmermsft Oct 7, 2022
a990ac6
Change to continue on error
alzimmermsft Oct 7, 2022
4fd2c4e
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Oct 7, 2022
0243b1b
Use fix Ben gave me
alzimmermsft Oct 7, 2022
5d6f955
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Oct 17, 2022
c5ece2f
Update script to support all OSes
alzimmermsft Oct 17, 2022
61b5755
parameters -> arguments in call to PowerShell task
alzimmermsft Oct 17, 2022
29a0537
Determine JAVA_HOME to set based on JdkFeatureVersion
alzimmermsft Oct 17, 2022
a76a7c3
Merge branch 'main' into AzEng_AddLatestJavaVersionToTestMatrix
alzimmermsft Oct 31, 2022
7c1b76d
Deprecate public ExpandableStringEnum constructors
alzimmermsft Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
CheckoutRecordings: true
SDKType: ${{ parameters.SDKType }}

- template: ../steps/install-latest-jdk.yml

- template: ../steps/install-reporting-tools.yml
parameters:
JdkVersion: $(JavaTestVersion)
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
SDKType: ${{ parameters.SDKType }}

- template: ../steps/install-latest-jdk.yml

- template: ../steps/install-reporting-tools.yml
parameters:
JdkVersion: $(JavaTestVersion)
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ stages:

- AZURE_TEST.*=.*/
- ${{ if eq(parameters.SDKType, 'data') }}:
- JavaTestVersion=(.*1)\.17(.*)/$1.11$2
- JavaTestVersion=(.*1)\.\d{2}(.*)/$1.11$2
Comment thread
alzimmermsft marked this conversation as resolved.
PreBuildSteps: ${{ parameters.PreBuildSteps }}
AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }}
${{ if eq(parameters.SDKType, 'data') }}:
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/stages/platform-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
"TestFromSource": false,
"TestGoals": "surefire:test",
"TestOptions": ""
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll have to look, but I wonder if there are some opportunities to consolidate the matrix again.

{
"Agent": {
"ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" }
},
"JavaTestVersion": "1.19",
Comment thread
alzimmermsft marked this conversation as resolved.
"AZURE_TEST_HTTP_CLIENTS": "netty",
"TestFromSource": false,
"TestGoals": "surefire:test",
"TestOptions": ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could roll this into the above include if you think it would be simpler by just adding 1.18 to the JavaTestVersion value (since all other values are the same).

}
]
}
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ steps:
env:
AZURE_VERSION_OVERRIDE_TESTS: ${{ parameters.TestVersionSupport }}
condition: and(succeeded(), ne(variables['TestFromSource'], 'true'))
continueOnError: ${{ eq(variables['LatestJdkVersion'], variables['JavaTestVersion']) }}

- task: Maven@3
displayName: 'Run tests'
Expand All @@ -69,6 +70,7 @@ steps:
env: ${{ parameters.TestEnvVars }}
# we want to run this when TestFromSource isn't true
condition: and(succeeded(), ne(variables['TestFromSource'], 'true'))
continueOnError: ${{ eq(variables['LatestJdkVersion'], variables['JavaTestVersion']) }}

# Generate the pom file with all the modules required for creating an aggregate code coverage report
- task: PythonScript@0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:

steps:
# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
# as we require the github service connection to be loaded.
# as we require the GitHub service connection to be loaded.
- ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Expand Down Expand Up @@ -86,7 +86,7 @@ steps:
condition: and(succeeded(), eq(variables['TestFromSource'], 'true'))

# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
# as we require the github service connection to be loaded.
# as we require the GitHub service connection to be loaded.
- ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Expand Down
27 changes: 27 additions & 0 deletions eng/pipelines/templates/steps/install-latest-jdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
steps:
# Non-standard JDK versions are only supported in Linux.
# Make the assumption here Linux is being used, if it's not it's a configuration issue that needs to be fixed there.
- task: Cache@2
inputs:
key: 'jdk | "$(JavaTestVersion)" | "$(CacheSalt)" | "$(Agent.OS)"'
path: $(Agent.BuildDirectory)/jdk-$(LatestJdkFeatureVersion)
displayName: 'Cache Latest JDK'
condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion'])

- task: PowerShell@2
displayName: 'Install Latest JDK'
inputs:
pwsh: true
arguments: >
-JdkFeatureVersion $(LatestJdkFeatureVersion)
workingDirectory: $(Agent.BuildDirectory)
filePath: eng/scripts/Install-Latest-JDK.ps1
condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion'])

- pwsh: |
Write-Host "Java 8 JDK: $Env:JAVA_HOME_8_X64"
Write-Host "Java 11 JDK: $Env:JAVA_HOME_11_X64"
Write-Host "Java 17 JDK: $Env:JAVA_HOME_17_X64"
Write-Host "Latest JDK: $Env:JAVA_HOME_$(LatestJdkFeatureVersion)_X64"
displayName: 'Verify Latest JDK Install'
condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion'])
3 changes: 3 additions & 0 deletions eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ variables:
JavaBuildVersion: '1.17'
# This is the default Java test version. It's the version used when running tests.
JavaTestVersion: '1.17'
# This is the latest JDK version.
LatestJdkVersion: '1.19'
LatestJdkFeatureVersion: '19'
# This is the version of Python used by various tools in the Java build/release processes
PythonVersion: '3.9'

Expand Down
53 changes: 53 additions & 0 deletions eng/scripts/Install-Latest-JDK.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$JdkFeatureVersion
)

# Query Adoptium for the list of installs for the JDK feature version.
$adoptiumApiUrl = "https://api.adoptium.net"
$os

if ($IsWindows) {
$os = "windows"
} elseif ($IsMacOS) {
$os = "mac"
} else {
$os = "linux"
}

$getInstalls = "$adoptiumApiUrl/v3/assets/latest/$JdkFeatureVersion/hotspot?architecture=x64&image_type=jdk&os=$os&vendor=eclipse"
$jdkUnzipName = "jdk-$JdkFeatureVersion"

Write-Host "Downloading latest JDK to" (Get-Location)

if (!(Test-Path -Path $jdkUnzipName -PathType container)) {
# Query Adoptium for the list of installs for the JDK feature version.
Write-Host "Inkvoking web request to '$getInstalls' to find JDK $JdkFeatureVersion installs available on $os."
$installsAvailable = Invoke-WebRequest -URI $getInstalls | ConvertFrom-Json
$jdkLink = $installsAvailable.binary.package.link
$jdkZipName = $jdkLink.split("/")[-1]

Write-Host "Downloading install from '$jdkLink' to '$jdkZipName'."
Invoke-WebRequest -URI $jdkLink -OutFile $jdkZipName

if ($IsWindows) {
Expand-Archive -Path $jdkZipName -Destination "jdk-temp"
Move-Item -Path (Join-Path -Path "jdk-temp" -ChildPath (Get-ChildItem "jdk-temp")[0].Name) -Destination $jdkUnzipName
} else {
New-Item -Path "jdk-temp" -ItemType "directory"
tar -xvf $jdkZipName -C "jdk-temp"
Move-Item -Path (Join-Path -Path "jdk-temp" -ChildPath (Get-ChildItem "jdk-temp")[0].Name) -Destination $jdkUnzipName
}

}

$javaHome = (Convert-Path $jdkUnzipName)
Write-Host "Latest JDK: $javaHome"

Write-Host "Current JAVA_HOME: $Env:JAVA_HOME"
Write-Host "##vso[task.setvariable variable=JAVA_HOME;]$javaHome"
Write-Host "Updated JAVA_HOME: $Env:JAVA_HOME"

$jdkFeatureVersionJavaHome = "JAVA_HOME_" + $JdkFeatureVersion + "_X64"
Write-Host "##vso[task.setvariable variable=$jdkFeatureVersionJavaHome;]$javaHome"
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
* An enumeration of supported authorization methods with the {@link ClaimsBasedSecurityNode}.
*/
public final class CbsAuthorizationType extends ExpandableStringEnum<CbsAuthorizationType> {
/**
* Creates a new instance of {@link CbsAuthorizationType} without a {@link #toString()} value.
* <p>
* This constructor shouldn't be called as it will produce a {@link CbsAuthorizationType} which doesn't have a
* String enum value.
*
* @deprecated Use one of the constants or the {@link #fromString(String, Class)} factory method.
*/
@Deprecated
public CbsAuthorizationType() {
}

/**
* Authorize with CBS through a shared access signature.
*/
Expand All @@ -18,7 +30,7 @@ public final class CbsAuthorizationType extends ExpandableStringEnum<CbsAuthoriz

/**
* Authorize with CBS using a JSON web token.
*
* <p>
* This is used in the case where Azure Active Directory is used for authentication and the authenticated user
* wants to authorize with Azure Event Hubs.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ public final class DeliveryState extends ExpandableStringEnum<DeliveryState> {
*/
public static final DeliveryState TRANSACTIONAL = fromString("TRANSACTIONAL", DeliveryState.class);

/**
* Creates a new instance of {@link DeliveryState} without a {@link #toString()} value.
* <p>
* This constructor shouldn't be called as it will produce a {@link DeliveryState} which doesn't have a String
* enum value.
*
* @deprecated Use one of the constants or the {@link #fromString(String, Class)} factory method.
*/
@Deprecated
public DeliveryState() {
}

/**
* Gets the corresponding delivery state from its string representation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ public final class ResourceAuthorIdentityType extends ExpandableStringEnum<Resou
/** Static value Key for ResourceAuthorIdentityType. */
public static final ResourceAuthorIdentityType KEY = fromString("Key");

/**
* Creates a new instance of {@link ResourceAuthorIdentityType} without a {@link #toString()} value.
* <p>
* This constructor shouldn't be called as it will produce a {@link ResourceAuthorIdentityType} which doesn't have a
* String enum value.
*
* @deprecated Use one of the constants or the {@link #fromString(String, Class)} factory method.
*/
@Deprecated
public ResourceAuthorIdentityType() {
}

/**
* Creates or finds a ResourceAuthorIdentityType from its string representation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
@Target(PARAMETER)
public @interface BodyParam {
/**
* @return the Content-Type that the body should be treated as
* Gets the Content-Type for the body.
*
* @return The Content-Type for the body.
*/
String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
@Target(PARAMETER)
public @interface FormParam {
/**
* Gets the name of the key in a key-value pair as part of the form data.
*
* @return The name of the key in a key value pair as part of the form data.
*/
String value();

/**
* Whether the form parameter is already form encoded.
* <p>
*
* A value true for this argument indicates that value of {@link FormParam#value()} is already encoded hence engine
* should not encode it, by default value will be encoded.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
@Target(METHOD)
public @interface UnexpectedResponseExceptionTypes {
/**
* Gets an array of {@link UnexpectedResponseExceptionType} that annotate a method.
*
* @return array of {@link UnexpectedResponseExceptionType} that annotate a method.
*/
UnexpectedResponseExceptionType[] value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class AccessToken {

/**
* Creates an access token instance.
*
* @param token the token string.
* @param expiresAt the expiration time.
*/
Expand All @@ -23,21 +24,27 @@ public AccessToken(String token, OffsetDateTime expiresAt) {
}

/**
* @return the token string.
* Gets the token.
*
* @return The token.
*/
public String getToken() {
return token;
}

/**
* @return the time when the token expires, in UTC.
* Gets the time when the token expires, in UTC.
*
* @return The time when the token expires, in UTC.
*/
public OffsetDateTime getExpiresAt() {
return expiresAt;
}

/**
* @return if the token has expired.
* Whether the token has expired.
*
* @return Whether the token has expired.
*/
public boolean isExpired() {
return OffsetDateTime.now().isAfter(expiresAt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public HttpRequestException(final String message, final HttpRequest request, fin
}

/**
* Gets the {@link HttpRequest} being sent when the exception occurred.
*
* @return The {@link HttpRequest} being sent when the exception occurred.
*/
public HttpRequest getRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ public HttpResponseException(final String message, final HttpResponse response,
}

/**
* Gets the {@link HttpResponse} received that is associated to the exception.
*
* @return The {@link HttpResponse} received that is associated to the exception.
*/
public HttpResponse getResponse() {
return response;
}

/**
* Gets the deserialized HTTP response value.
*
* @return The deserialized HTTP response value.
*/
public Object getValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ public HttpAuthorization(String scheme, String parameter) {
}

/**
* Gets the scheme of the authorization header.
*
* @return Scheme of the authorization header.
*/
public String getScheme() {
return scheme;
}

/**
* Gets the credential of the authorization header.
*
* @return Credential of the authorization header.
*/
public String getParameter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public class MatchConditions {
private String ifMatch;
private String ifNoneMatch;

/**
* Creates a new instance of {@link MatchConditions}.
*/
public MatchConditions() {
}

/**
* Gets the ETag that resources must match.
*
Expand Down
Loading