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

POM Restructuring Phase #1 #8242

Merged
merged 30 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d037752
Remove modules from parent.
mitchdenny Feb 18, 2020
315ab61
Add specific core modules.
mitchdenny Feb 18, 2020
84ae1c3
Remove management package from list of packages to build.
mitchdenny Feb 18, 2020
e09a991
Swap to building against root pom.xml.
mitchdenny Mar 10, 2020
6806b54
Removed commented out modules section.
mitchdenny Mar 10, 2020
7d9a579
Remove perf stress module from module list.
mitchdenny Mar 10, 2020
422b853
First attempt at a project list hack.
mitchdenny Mar 11, 2020
47a06c2
COntinue project list hack.
mitchdenny Mar 11, 2020
eb1a81d
Extract steps into a template.
mitchdenny Mar 11, 2020
2b8061f
Tweak quotes.
mitchdenny Mar 11, 2020
06f4d87
Changes to make analyze use project list.
mitchdenny Mar 11, 2020
de8a204
Add project list to test jobs.
mitchdenny Mar 11, 2020
5e2245b
Add install step which builds dependencies ahead of running tests.
mitchdenny Mar 11, 2020
cc255ef
Fix indentation.
mitchdenny Mar 11, 2020
034491e
Bringing identity and appconfiguration into scope.
mitchdenny Mar 11, 2020
cec7573
Pulling all track 1 and track 2 modules into the root POM model.
mitchdenny Mar 11, 2020
7bb0d38
Removed appinsights dir from root POM.
mitchdenny Mar 12, 2020
4762998
Tweaks to data plane template.
mitchdenny Mar 12, 2020
eff4e5a
Try adding azure-storage-perf to artifact list.
mitchdenny Mar 13, 2020
2f3747a
Make perf core a dependency of blob (HACK!).
mitchdenny Mar 13, 2020
d103219
Added dependency tags to perf-test-core and moved to storage common.
mitchdenny Mar 13, 2020
2670b8b
HACK: Adding storage blob as a test dependency of azure-messaging-eve…
mitchdenny Mar 13, 2020
3599c95
Fix version.
mitchdenny Mar 13, 2020
91195a1
Fix log analytics build.
mitchdenny Mar 16, 2020
a2c0aea
Remove -amd switch.
mitchdenny Mar 17, 2020
6705c09
Extra -amd switch removal.
mitchdenny Mar 17, 2020
5a1c586
Removed CG manifest creation. Default behavior should work.
mitchdenny Mar 17, 2020
66b1d52
Tweak test template for Cosmos.
mitchdenny Mar 18, 2020
686baee
Fix up app config.
mitchdenny Mar 18, 2020
42aeeb3
Respond to PR feedback.
mitchdenny Mar 19, 2020
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
84 changes: 21 additions & 63 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ jobs:
BuildSHA: $(Build.SourceVersion)
RepoId: 'Azure/azure-sdk-for-java'

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

- task: Maven@3
displayName: 'Build and Package'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
mavenPomFile: pom.xml
goals: 'package'
options: '$(DefaultOptions) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests -Dgenerate-overview' # We include template-module so we ensure it always builds in CI
Copy link
Member

Choose a reason for hiding this comment

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

nit: I don't think the comment at the end of the line is needed any longer.

options: '$(DefaultOptions) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests -Dgenerate-overview -pl $(ProjectList) -am' # We include template-module so we ensure it always builds in CI
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
Expand Down Expand Up @@ -155,32 +159,23 @@ jobs:
Options: --batch-mode
MavenOptions: $(MemoryOptions) $(LoggingOptions)

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

# maven dependency:tree needs to be able to resolve dependencies, so these should be installed.
- task: Maven@3
displayName: 'Build and Install'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
mavenPomFile: pom.xml
goals: 'install'
options: '$(DefaultOptions) -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true'
options: '$(DefaultOptions) -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl $(ProjectList) -am'
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: false

- pwsh: |
if ("${{parameters.SDKType}}" -ieq "client") {
$excludes = "^(microsoft|mgmt)"
} else {
$excludes = "^(azure|mgmt)"
}

$directory = "$(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}"

Write-Host "Directory: '$directory'. Excludes: '$excludes'"
$(Build.SourcesDirectory)/eng/Set-ComponentRegistrations.ps1 $directory -ExcludeRegex $excludes -Verbose
displayName: 'Generate cgmanifest.json'

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
# ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
# builds should be sufficient.
Expand All @@ -190,8 +185,8 @@ jobs:
- task: Maven@3
displayName: 'Run SpotBugs, Checkstyle, RevApi, and Javadoc'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
options: '--no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme-windows'
mavenPomFile: pom.xml
options: '--no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme-windows -pl $(ProjectList)'
mavenOptions: '$(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
Expand Down Expand Up @@ -254,11 +249,15 @@ jobs:
condition: and(succeeded(), eq(variables['ShouldRunSourceTests'],'true'))
displayName: 'Update versions for source build'

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

- task: Maven@3
displayName: 'Run tests'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
options: ${{ parameters.TestOptions }}
mavenPomFile: pom.xml
options: ${{ parameters.TestOptions }} -pl $(ProjectList) -am
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
Expand All @@ -273,45 +272,4 @@ jobs:
condition: and(always(), or(ne(variables['TestFromSource'],'true'), eq(variables['ShouldRunSourceTests'],'true')))
inputs:
mergeTestResults: true
testRunTitle: $(RunTitle)

# HACK: This has been disabled to unblock releases where aggregate code
# coverage reporting was causing agent timeouts. We've got an issue
# to discuss how to handle aggregate-style reporting across the repo
# but at the moment this isn't going to work:
#
# https://github.com/Azure/azure-sdk-for-java/issues/7271
#
# # Generate JaCoCo code coverage report on Java 11, Linux builds if the build reason is not PR.
# - task: Maven@3
# displayName: 'Generate aggregate code coverage report'
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# inputs:
# # Aggregate reports for non-PR builds will use pom.client.xml and include non-shipping modules
# mavenPomFile: pom.client.xml
# options: '$(DefaultOptions) -Dinclude-non-shipping-modules -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true'
# mavenOptions: '-Xmx3072m $(LoggingOptions)'
# javaHomeOption: 'JDKVersion'
# jdkVersionOption: $(JavaVersion)
# jdkArchitectureOption: 'x64'
# publishJUnitResults: false
# goals: 'verify'

# # Azure DevOps only seems to respect the last code coverage result published, so only do this for Linux + Java LTS.
# # Code coverage reporting is setup only for Track 2 modules.
# - task: PublishCodeCoverageResults@1
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# inputs:
# codeCoverageTool: JaCoCo
# summaryFileLocation: eng/jacoco-test-coverage/target/site/test-coverage/jacoco.xml
# reportDirectory: eng/jacoco-test-coverage/target/site/test-coverage/
# failIfCoverageEmpty: true

# # Publish code coverage to an artifact so it can be uploaded to the Maven site.
# # Do this for track 2 modules only. Code coverage from previous step is only published for Linux + Java LTS.
# - task: PublishPipelineArtifact@0
# displayName: 'Publish coverage artifact'
# condition: and(eq(variables['OsName'], 'Linux'), eq(variables['JavaVersion'], '1.11'), ne(variables['Build.Reason'], 'PullRequest'))
# inputs:
# artifactName: coverage
# targetPath: eng/jacoco-test-coverage/target/site/
testRunTitle: $(RunTitle)
24 changes: 18 additions & 6 deletions eng/pipelines/templates/jobs/archetype-sdk-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ jobs:
BuildSHA: $(Build.SourceVersion)
RepoId: 'Azure/azure-sdk-for-java'

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

- task: Maven@3
displayName: 'Build and Package'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
mavenPomFile: pom.xml
goals: 'package'
options: '$(DefaultOptions) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests -Dgenerate-overview' # We include template-module so we ensure it always builds in CI
Copy link
Member

Choose a reason for hiding this comment

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

nit: end of line comment can be deleted.

options: '$(DefaultOptions) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests -Dgenerate-overview -pl $(ProjectList) -am -amd' # We include template-module so we ensure it always builds in CI
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
Expand Down Expand Up @@ -150,11 +154,15 @@ jobs:
Options: --batch-mode
MavenOptions: $(MemoryOptions) $(LoggingOptions)

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

- task: Maven@3
displayName: 'Install Module and Run SpotBugs, Checkstyle, RevApi, and Javadoc'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
options: '--no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme'
mavenPomFile: pom.xml
options: '--no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme -pl $(ProjectList) -am'
mavenOptions: '$(MemoryOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
Expand Down Expand Up @@ -186,6 +194,10 @@ jobs:
Options: --batch-mode
MavenOptions: $(MemoryOptions) $(LoggingOptions)

- template: ../steps/generate-project-list.yml
parameters:
Artifacts: ${{parameters.Artifacts}}

- task: Maven@3
displayName: 'Start Jetty'
condition: succeeded()
Expand All @@ -204,8 +216,8 @@ jobs:
- task: Maven@3
displayName: 'Run tests'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
options: ${{ parameters.TestOptions }}
mavenPomFile: pom.xml
options: ${{ parameters.TestOptions }} -pl $(ProjectList) -am
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- task: Maven@3
displayName: $(DisplayName)
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.xml
${{ insert }}: ${{ parameters.TestStepMavenInputs }}
env: ${{ parameters.EnvVars }}

Expand Down
18 changes: 18 additions & 0 deletions eng/pipelines/templates/steps/generate-project-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This job template uses the artifact list in the ci.yml file
# to generate a variable at build time that can be passed into
# the Maven -pl command-line switch to constrain what subset of
# projects are targetted based on the artifacts this pipeline
mitchdenny marked this conversation as resolved.
Show resolved Hide resolved
# produces. The -am and -amd switches are then applied as
# appropriate to constrain the full graph that is built depending
# on whether we are doing a recorded test play back or a full live
# test.

steps:
- pwsh: |
Write-Host "##vso[task.setvariable variable=ProjectList;]"
displayName: Initialize project list variable

- ${{each artifact in parameters.Artifacts }}:
- pwsh: |
Write-Host "##vso[task.setvariable variable=ProjectList;]$(ProjectList),${{artifact.groupId}}:${{artifact.name}}"
displayName: Append ${{artifact.groupId}}:${{artifact.name}} to project list
1 change: 0 additions & 1 deletion pom.data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@
</build>
</profile>
</profiles>

<modules>
<module>./sdk/batch/microsoft-azure-batch</module>
<module>./sdk/eventhubs/microsoft-azure-eventhubs/pom.xml</module>
Expand Down
3 changes: 3 additions & 0 deletions pom.management.xml
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,11 @@
</build>
</profile>
</profiles>
<!--
<modules>

<module>./profiles/2018-03-01-hybrid</module>
<module>./profiles/2019-03-01-hybrid</module>
</modules>
-->
</project>
Loading