Skip to content

Commit

Permalink
Use doclint -missing to handle Java 21 Javadoc errors instead of sett…
Browse files Browse the repository at this point in the history
…ing different Java versions in CI (#42112)
  • Loading branch information
alzimmermsft authored Sep 30, 2024
1 parent a43653d commit 7cac012
Show file tree
Hide file tree
Showing 171 changed files with 193 additions and 53 deletions.
1 change: 0 additions & 1 deletion eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ jobs:
- template: /eng/pipelines/templates/steps/run-and-validate-linting.yml
parameters:
JavaBuildVersion: $(JavaTestVersion)
JavadocSafeJavaBuildVersion: $(JavadocSafeJavaBuildVersion)
AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }}
BuildParallelization: ${{ parameters.BuildParallelization }}
ContinueOnError: true
Expand Down
8 changes: 2 additions & 6 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ parameters:
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)
- name: JavadocSafeJavaBuildVersion
type: string
default: $(JavadocSafeJavaBuildVersion)
- name: IgnoreVerifyTypeSpecCodeGenerationError
type: boolean
default: false
Expand Down Expand Up @@ -163,14 +160,14 @@ jobs:
displayName: 'pip install markdown2 and BeautifulSoup4'
- task: Maven@4
displayName: 'Build and Package, JDK Version: ${{ parameters.JavadocSafeJavaBuildVersion }}'
displayName: 'Build and Package, JDK Version: ${{ parameters.JavaBuildVersion }}'
inputs:
mavenPomFile: pom.xml
goals: 'deploy'
options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} -DskipTests -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dspotless.apply.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module so we ensure it always builds in CI
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: ${{ parameters.JavadocSafeJavaBuildVersion }} # TODO (vcolin7): Change to ${{ parameters.JavaBuildVersion }} once Javadoc migration to Java 21 is complete.
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false

Expand Down Expand Up @@ -368,7 +365,6 @@ jobs:
- template: /eng/pipelines/templates/steps/run-and-validate-linting.yml
parameters:
JavaBuildVersion: ${{ parameters.JavaBuildVersion }}
JavadocSafeJavaBuildVersion: ${{ parameters.JavadocSafeJavaBuildVersion }}
AdditionalLintingOptions: ${{ parameters.AdditionalLintingOptions }}
BuildParallelization: ${{ parameters.BuildParallelization }}
RunLinting: true
Expand Down
7 changes: 2 additions & 5 deletions eng/pipelines/templates/stages/archetype-sdk-client-patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ parameters:
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)
- name: JavadocSafeJavaBuildVersion
type: string
default: $(JavadocSafeJavaBuildVersion)
- name: TestPipeline
type: boolean
default: false
Expand Down Expand Up @@ -126,14 +123,14 @@ extends:
JdkVersion: ${{ parameters.JavaBuildVersion }}

- task: Maven@4
displayName: 'Build From Source and Package, JDK Version: ${{ parameters.JavadocSafeJavaBuildVersion }}'
displayName: 'Build From Source and Package, JDK Version: ${{ parameters.JavaBuildVersion }}'
inputs:
mavenPomFile: ClientFromSourcePom.xml
goals: 'deploy'
options: '$(DefaultOptions) -T ${{parameters.BuildParallelization}} -DskipTests -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dspotless.apply.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module, so we ensure it always builds in CI.
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: ${{ parameters.JavadocSafeJavaBuildVersion }}
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false

Expand Down
3 changes: 0 additions & 3 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ parameters:
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)
- name: JavadocSafeJavaBuildVersion
type: string
default: $(JavadocSafeJavaBuildVersion)
- name: LiveTestStages
type: stageList
default: []
Expand Down
5 changes: 1 addition & 4 deletions eng/pipelines/templates/steps/run-and-validate-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ parameters:
- name: JavaBuildVersion
type: string
default: $(JavaBuildVersion)
- name: JavadocSafeJavaBuildVersion
type: string
default: $(JavadocSafeJavaBuildVersion)
- name: AdditionalLintingOptions
type: string
default: ''
Expand Down Expand Up @@ -87,7 +84,7 @@ steps:
options: '$(DefaultOptions) --no-transfer-progress ${{ parameters.AdditionalLintingOptions }} -pl $(ProjectList)'
mavenOptions: '$(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: ${{ parameters.JavadocSafeJavaBuildVersion }} # TODO (vcolin7): Change to ${{ parameters.JavaBuildVersion }} once Javadoc migration to Java 21 is complete. See: https://github.com/Azure/azure-sdk-for-java/issues/38267.
jdkVersionOption: ${{ parameters.JavaBuildVersion }}
jdkArchitectureOption: 'x64'
publishJUnitResults: false
${{ if ne(parameters.SDKType, 'client') }}:
Expand Down
2 changes: 0 additions & 2 deletions eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ variables:
DocWardenVersion: '0.7.2'
# This is the default Java build version. It's the version used to build the shipping libraries, Spotbugs etc.
JavaBuildVersion: '1.21'
# This is the highest Java version we can write all our Javadocs with. Libraries that support a higher version can override this value in their CI templates.
JavadocSafeJavaBuildVersion: '1.17' # TODO (vcolin7): Remove and use JavaBuildVersion in templates once Javadoc migration to Java 21 is complete. See: https://github.com/Azure/azure-sdk-for-java/issues/38267.
# This is the highest LTS Java version we use to build the Cosmos Spark connectors and libraries baselined on Java 7.
FallbackJavaBuildVersion: '1.17'
# This is the default Java test version. It's the version used when running tests.
Expand Down
1 change: 1 addition & 0 deletions sdk/advisor/azure-resourcemanager-advisor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/agrifood/azure-resourcemanager-agrifood/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,27 @@

/**
* Base class for Azure App Configuration performance tests.
*
* @param <TOptions> The type of stress options.
*/
public abstract class ServiceTest<TOptions extends PerfStressOptions> extends PerfStressTest<TOptions> {
private static final String CONFIGURATION_ERROR
= "Configuration %s must be set in either environment variables " + "or system properties.%n";

/**
* The synchronous configuration client.
*/
protected final ConfigurationClient configurationClient;

/**
* The asynchronous configuration client.
*/
protected final ConfigurationAsyncClient configurationAsyncClient;

/**
* The base class for Azure App Configuration tests.
*
* @param options the configurable options for performing perf testing on this class.
*
* @throws RuntimeException if "AZURE_APPCONFIG_CONNECTION_STRING" is null or empty.
*/
public ServiceTest(TOptions options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 0 additions & 1 deletion sdk/appconfiguration/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: appconfiguration
JavadocSafeJavaBuildVersion: '1.21'
Artifacts:
- name: azure-data-appconfiguration
groupId: com.azure
Expand Down
1 change: 1 addition & 0 deletions sdk/attestation/azure-resourcemanager-attestation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/automanage/azure-resourcemanager-automanage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/automation/azure-resourcemanager-automation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/azurestack/azure-resourcemanager-azurestack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
2 changes: 2 additions & 0 deletions sdk/batch/azure-compute-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
</javaModulesSurefireArgLine>

<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/batchai/azure-resourcemanager-batchai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/botservice/azure-resourcemanager-botservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<revapi.skip>true</revapi.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions sdk/commerce/azure-resourcemanager-commerce/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
--add-opens com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
--add-opens com.azure.communication.callingserver/com.azure.communication.callingserver.implementation=ALL-UNNAMED
--add-opens com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-chat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
--add-opens com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<test.dir>src/test</test.dir>
<jacoco.min.linecoverage>0.70</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.70</jacoco.min.branchcoverage>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-email/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<javaModulesSurefireArgLine>
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-identity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
--add-opens com.azure.communication.identity/com.azure.communication.identity=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-phonenumbers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
--add-opens com.azure.communication.phonenumbers/com.azure.communication.phonenumbers=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
3 changes: 1 addition & 2 deletions sdk/communication/azure-communication-rooms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
com.azure.communication.common/com.azure.communication.common.implementation=ALL-UNNAMED
</javaModulesSurefireArgLine>
<codesnippet.skip>false</codesnippet.skip>
<javadocDoclet></javadocDoclet>
<javadocDocletOptions></javadocDocletOptions>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/azure-communication-sms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<codesnippet.skip>false</codesnippet.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/consumption/azure-resourcemanager-consumption/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>
<dependencies>
<dependency>
Expand Down
1 change: 0 additions & 1 deletion sdk/core/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: core
JavadocSafeJavaBuildVersion: '1.21'
TimeoutInMinutes: 90
ReleaseDependsOnLiveTests: ${{ parameters.release_dependsonlivetests }}
Artifacts:
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Licensed under the MIT License.
<revapi.skip>true</revapi.skip>

<!-- TODO: Remove this once all Javadoc warnings and errors are resolved -->
<doclint>all,-missing</doclint>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos-dotnet-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Licensed under the MIT License.
<revapi.skip>true</revapi.skip>

<!-- TODO: Remove this once all Javadoc warnings and errors are resolved -->
<doclint>all,-missing</doclint>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos-encryption/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Licensed under the MIT License.
--add-opens com.azure.cosmos.encryption/com.azure.cosmos.encryption.models=ALL-UNNAMED
--add-opens com.azure.cosmos/com.azure.cosmos.implementation=ALL-UNNAMED
</javaModulesSurefireArgLine>
<doclintMissingInclusion>-</doclintMissingInclusion>
</properties>

<dependencies>
Expand Down
Loading

0 comments on commit 7cac012

Please sign in to comment.