-
Notifications
You must be signed in to change notification settings - Fork 1.3k
js - pullrequest
#31420
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
js - pullrequest
#31420
Changes from 95 commits
03e9f7c
f6352dc
dccd0f9
cf03790
4c683df
2cb2a7b
6295825
dd73653
e750488
725c6a7
733b020
3bf5519
61aee6d
cd78bea
b6d50de
b913f2e
6daa9b0
741a3c7
f651fd1
5cb6786
d0f58a5
063520a
e52aba6
0d0034c
c5a6059
b5a6a65
16fd9e1
da96d77
ece0dbf
1b23867
2626172
48cb9cf
ddba884
83464d4
a3f2366
4722a54
4a7d646
b072794
aa7643f
d0d2f1f
0ce2151
07d47dc
1c6218b
7398926
d503e4b
36140a4
2166d3b
01b5822
37c1084
599bf6e
53f5ef8
eb37ef5
8ecf061
2dc4112
0805b60
64f581e
86f4dd6
966ae33
b70cd1f
c69371b
e2ceb92
abbff35
7dc60ba
6adb684
795a98a
3a975b6
37d47de
f02bcf2
8a4fea9
25c20ae
ea53757
72b7401
191c749
0f20711
72db8de
3af6f36
94ba6b5
9aa8fac
4f67fe6
2a0391e
2996fdf
e75d156
1248bca
5d831c9
3a09472
7b64344
16cd6b3
cd50e71
909c5b7
e9e0e82
1609ea3
cddda7f
f0172ed
0799806
1c2891d
6dda23d
d67e2f9
37a4dbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,32 +13,23 @@ steps: | |
|
|
||
| - pwsh: | | ||
| $folder = "${{parameters.ServiceDirectory}}" | ||
| if ($folder -eq "*") { $folder = "" } | ||
| if ($folder -eq "*" -or $folder -eq "auto") { $folder = "" } | ||
| echo "##vso[task.setvariable variable=folder]$folder" | ||
| displayName: "Set folder variable for readme links" | ||
|
|
||
| # we are not passing service directory, so we only ever set dev build to true | ||
| - template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml | ||
| parameters: | ||
| ServiceDirectory: ${{ parameters.ServiceDirectory }} | ||
|
|
||
| - script: | | ||
| npm install ./eng/tools/versioning | ||
| node eng/tools/versioning/set-dev.js --build-id "$(Build.BuildNumber)" --repo-root "$(Build.SourcesDirectory)" --service "$(folder)" | ||
| node eng/tools/versioning/set-dev.js --build-id "$(Build.BuildNumber)" --repo-root "$(Build.SourcesDirectory)" | ||
| node common/scripts/install-run-rush.js update | ||
| condition: and(succeeded(),eq(variables['SetDevVersion'],'true')) | ||
| displayName: "Update package versions for dev build" | ||
|
|
||
| - task: Powershell@2 | ||
| inputs: | ||
| filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1 | ||
| arguments: > | ||
| -ServiceDirectory ${{parameters.ServiceDirectory}} | ||
| -OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo | ||
| -AddDevVersion | ||
| pwsh: true | ||
| workingDirectory: $(Pipeline.Workspace) | ||
| displayName: Update package properties with dev version | ||
| condition: and(succeeded(),eq(variables['SetDevVersion'],'true')) | ||
| - template: /eng/common/pipelines/templates/steps/save-package-properties.yml | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. save-package-properties.yml will call |
||
| parameters: | ||
| ServiceDirectory: ${{parameters.ServiceDirectory}} | ||
|
|
||
| - script: | | ||
| node common/scripts/install-run-rush.js install | ||
|
|
@@ -47,7 +38,9 @@ steps: | |
|
|
||
| - template: /eng/pipelines/templates/steps/set-artifact-packages.yml | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really the main thrust of the PR. |
||
| parameters: | ||
| PackageInfo: $(Build.ArtifactStagingDirectory)/PackageInfo | ||
| Artifacts: ${{ parameters.Artifacts }} | ||
|
|
||
| - ${{ if and(eq(variables['System.TeamProject'], 'internal'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}: | ||
| - task: AzureCLI@2 | ||
| inputs: | ||
|
|
@@ -60,26 +53,24 @@ steps: | |
| sasToken=$(az storage container generate-sas --account-name azuresdkartifacts --name azure-sdk-for-js-rush-cache --permissions dlrw --auth-mode login --as-user --expiry $expiry --https-only -o tsv) | ||
| echo "##vso[task.setvariable variable=rushBuildCacheCred;issecret=true;]$sasToken" | ||
|
|
||
| # Option "-p max" ensures parallelism is set to the number of cores on all platforms, which improves build times. | ||
| # The default on Windows is "cores - 1" (microsoft/rushstack#436). | ||
| - script: | | ||
| node eng/tools/rush-runner.js build "${{parameters.ServiceDirectory}}" -packages "$(ArtifactPackageNames)" --verbose -p max | ||
| - pwsh: | | ||
| node eng/tools/rush-runner.js build $(ChangedServices) -packages "$(ArtifactPackageNames)" --verbose -p max | ||
| displayName: "Build libraries" | ||
| env: | ||
| ${{ if and(eq(variables['System.TeamProject'], 'internal'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}: | ||
| RUSH_BUILD_CACHE_CREDENTIAL: $(rushBuildCacheCred) | ||
| RUSH_BUILD_CACHE_WRITE_ALLOWED: 1 | ||
|
|
||
| - script: | | ||
| node eng/tools/rush-runner.js build:samples "${{parameters.ServiceDirectory}}" -packages "$(ArtifactPackageNames)" --verbose | ||
| displayName: "Build samples" | ||
| node eng/tools/rush-runner.js build:samples "$(ChangedServices)" -packages "$(ArtifactPackageNames)" --verbose | ||
| displayName: "Build samples for PR" | ||
|
|
||
| - pwsh: | | ||
| eng/tools/check-api-warning.ps1 | ||
| displayName: "Check api extractor output changes" | ||
|
|
||
| - script: | | ||
| node eng/tools/rush-runner.js pack "${{parameters.ServiceDirectory}}" -packages "$(ArtifactPackageNames)" --verbose | ||
| node eng/tools/rush-runner.js pack "$(ChangedServices)" -packages "$(ArtifactPackageNames)" --verbose | ||
| displayName: "Pack libraries" | ||
|
|
||
| # Unlink node_modules folders to significantly improve performance of subsequent tasks | ||
|
|
@@ -93,18 +84,22 @@ steps: | |
| ServiceDirectory: ${{parameters.ServiceDirectory}} | ||
|
|
||
| - pwsh: | | ||
| $artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | ||
| $artifacts = Get-ChildItem -Recurse -Force "$(Build.ArtifactStagingDirectory)/PackageInfo/*.json" ` | ||
| | ForEach-Object { $_.Name.Replace(".json", "") } | ||
|
|
||
| foreach ($artifact in $artifacts) | ||
| { | ||
| $artifactName = $artifact.name | ||
| Write-Host "Copying $artifactName artifacts to $(Build.ArtifactStagingDirectory)/$artifactName" | ||
| New-Item -Type Directory -Name $artifactName -Path $(Build.ArtifactStagingDirectory) > $null | ||
| Copy-Item sdk/${{parameters.ServiceDirectory}}/**/$artifactName-[0-9]*.[0-9]*.[0-9]*.tgz $(Build.ArtifactStagingDirectory)/$artifactName | ||
| Copy-Item sdk/${{parameters.ServiceDirectory}}/**/browser/$artifactName-[0-9]*.[0-9]*.[0-9]*.zip $(Build.ArtifactStagingDirectory)/$artifactName | ||
| if ($${{ parameters.IncludeRelease }} -eq $true -and $artifact.skipPublishDocMs -ne $true) | ||
| $artifactDetails = Get-Content -Raw $(Build.ArtifactStagingDirectory)/PackageInfo/$artifact.json | ConvertFrom-Json | ||
|
|
||
| Write-Host "Copying $artifact artifacts to $(Build.ArtifactStagingDirectory)/$artifact" | ||
| New-Item -Type Directory -Force -Name $artifact -Path $(Build.ArtifactStagingDirectory) > $null | ||
| Copy-Item sdk/$($artifactDetails.Service)/**/$artifact-[0-9]*.[0-9]*.[0-9]*.tgz $(Build.ArtifactStagingDirectory)/$artifact | ||
| Copy-Item sdk/$($artifactDetails.Service)/**/browser/$artifact-[0-9]*.[0-9]*.[0-9]*.zip $(Build.ArtifactStagingDirectory)/$artifact | ||
|
|
||
| if ($${{ parameters.IncludeRelease }} -eq $true -and $artifactDetails.ArtifactDetails.skipPublishDocMs -ne $true) | ||
| { | ||
| New-Item -Type Directory -Name documentation -Path $(Build.ArtifactStagingDirectory)/$artifactName > $null | ||
| Copy-Item $(Build.SourcesDirectory)/docGen/$artifactName.zip $(Build.ArtifactStagingDirectory)/$artifactName/documentation | ||
| New-Item -Type Directory -Force -Name documentation -Path $(Build.ArtifactStagingDirectory)/$artifact > $null | ||
| Copy-Item $(Build.SourcesDirectory)/docGen/$artifact.zip $(Build.ArtifactStagingDirectory)/$artifact/documentation | ||
| } | ||
| } | ||
| displayName: 'Copy Packages' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,51 @@ | ||
| parameters: | ||
| PackageInfo: '' | ||
| Artifacts: [] | ||
| steps: | ||
| # Package-Properties folder contains the package properties for all discovered packages that were either A) affected by the PR or | ||
| # B) explicitly present in the service directory. This repo splits the builds into two categories: "mgmt" and "dataplane". While | ||
| # a given directory may contain both, there will be a separate build definition to release the management packages. Due to this | ||
| # we need to artificially filter the packages to ensure that only the packages targeted for THAT ci.yml are built. | ||
| # When we merge the PR adding js - pullrequest, this code will also merge, meaning the public - <service> - ci builds will still operate | ||
| # EXACTLY the same as they did before the pipelinev3 change. This is important to ensure that we don't accidentally build the wrong packages | ||
| # while in the integration period. After we disable all the public `js - <service> - ci` builds, only the `js - pullrequest` build WONT provide | ||
| # an artifact list, which will allow the expand/contract. Meanwhile the internal builds will continue to provide the artifact list from their | ||
| # individual ci.yml and ci.mgmt.yml files. | ||
| - pwsh: | | ||
| $artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | ||
| $packages = "" | ||
| foreach ($artifact in $artifacts) | ||
| { | ||
| $packages += "$($artifact.name)," | ||
| $knownArtifacts = @() | ||
| if ($artifacts) { | ||
| $knownArtifacts = $artifacts | ForEach-Object { $_.name } | ||
| } | ||
| echo "##vso[task.setvariable variable=ArtifactPackageNames]$packages" | ||
| displayName: "Find Packages to build" | ||
|
|
||
| $packageProperties = Get-ChildItem -Recurse "${{ parameters.PackageInfo }}" *.json ` | ||
| | Where-Object { if($knownArtifacts) { $knownArtifacts -contains $_.Name.Replace(".json", "") } else { $true } } | ||
|
|
||
| $pkgNames = $packageProperties | ForEach-Object { $_.Name.Replace(".json", "") } | ||
|
|
||
| $setting = $pkgNames -join "," | ||
| Write-Host "Setting ArtifactPackageNames to: `n$setting" | ||
| Write-Host "##vso[task.setvariable variable=ArtifactPackageNames;]$setting" | ||
| displayName: Resolve Targeted Packages | ||
| condition: eq(variables['ArtifactPackageNames'], '') | ||
|
|
||
| - pwsh: | | ||
| # set changed services given the set of changed packages, this will mean that | ||
| # ChangedServices will be appropriate for the batched set of packages if that is indeed how | ||
| # we set the targeted artifacts | ||
| $packageProperties = Get-ChildItem -Recurse "${{ parameters.PackageInfo }}" *.json ` | ||
| | Foreach-Object { Get-Content -Raw -Path $_.FullName | ConvertFrom-Json } | ||
|
|
||
| $packageSet = "$(ArtifactPackageNames)" -split "," | ||
|
|
||
| $changedServicesArray = $packageProperties | Where-Object { $packageSet -contains $_.ArtifactName } | ||
| | ForEach-Object { $_.ServiceDirectory } | Get-Unique | ||
|
|
||
| $changedServices = $changedServicesArray -join " " | ||
| $commaChangedServices = $changedServicesArray -join "," | ||
| Write-Host "##vso[task.setvariable variable=ChangedServices;]$changedServices" | ||
| Write-Host "##vso[task.setvariable variable=ChangedServicesCsv;]$commaChangedServices" | ||
|
|
||
| Write-Host "This run is targeting: `n$(ArtifactPackageNames) in [$changedServices]" | ||
| displayName: Resolve Targeted Packages | ||
| condition: ne(variables['ArtifactPackageNames'], '') | ||
scbedd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.