-
Notifications
You must be signed in to change notification settings - Fork 576
Update pnpm store cache-keys to include compat-workspaces pnpm-lock.yaml #27221
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
Changes from all commits
057e7a3
f35b8eb
eed4c85
e5ac513
f5e1ae8
b86a188
1c1c191
8207055
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 |
|---|---|---|
|
|
@@ -71,6 +71,15 @@ parameters: | |
| - name: artifactBuildId | ||
| type: string | ||
|
|
||
| # A valid git ref to use for the microsoft/FluidFramework repository checkout (e.g. refs/heads/main, a commit SHA, tag, etc) | ||
| # Pipelines that are triggered on completion of the "Build - client packages" pipeline should generally use | ||
| # the same source commit as what was used for "Build - client packages". This is typically available via | ||
| # `$(resources.pipeline.client.sourceCommit)` (where "client" is actually the name of the resource declared | ||
| # in the current pipeline's root yaml file) | ||
| - name: fluidFrameworkSourceVersion | ||
| type: string | ||
| default: $(Build.SourceVersion) | ||
|
|
||
| # Name of the Secure File that contains the self-signed cert for the R11s deployment. | ||
| # If not blank, the pipeline will try to install it to the local cert store. | ||
| - name: r11sSelfSignedCertSecureFile | ||
|
|
@@ -88,11 +97,6 @@ parameters: | |
| type: boolean | ||
| default: false | ||
|
|
||
| # If true, the versions of our packages installed for compat testing will be cached. | ||
| - name: cacheCompatVersionsInstalls | ||
| type: boolean | ||
| default: false | ||
|
|
||
| # If tests need to run against an ODSP tenant, specify the type of tenant here. Steps will be injected to lease one for the duration of the test. | ||
| - name: odspTenantType | ||
| type: string | ||
|
|
@@ -174,6 +178,22 @@ stages: | |
| path: $(FFPipelineHostDirectory) | ||
| clean: true | ||
|
|
||
| # ADO doesn't support checking out refs that are determined at pipeline queue time as ours likely would be | ||
| # (where the ref is a function of one of the pipeline resource inputs). See docs here: | ||
| # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checking-out-a-specific-ref | ||
| # To work around this, we get to the right revision in a follow-up step. | ||
| - checkout: self | ||
| path: $(FluidFrameworkDirectory) | ||
| clean: true | ||
|
|
||
| - bash: | | ||
| git fetch --depth=1 origin $FF_SOURCE_VERSION | ||
| git checkout $FF_SOURCE_VERSION | ||
| workingDirectory: $(Pipeline.Workspace)/$(FluidFrameworkDirectory) | ||
| displayName: Switch FluidFramework checkout to artifact source version | ||
| env: | ||
| FF_SOURCE_VERSION: ${{ parameters.fluidFrameworkSourceVersion }} | ||
|
|
||
| # Install self-signed cert for R11s deployment in local cert store | ||
| - ${{ if ne(parameters.r11sSelfSignedCertSecureFile, '') }}: | ||
| - task: DownloadSecureFile@1 | ||
|
|
@@ -231,15 +251,15 @@ stages: | |
| - template: /tools/pipelines/templates/include-install-pnpm.yml@self | ||
| parameters: | ||
| buildDirectory: $(FFPipelineHostDirectory) | ||
| # The compat-workspaces lockfile is committed to the FluidFramework repo and changes | ||
| # whenever legacy package versions are added or removed. Including it in the pnpm store | ||
| # cache key ensures a cache miss whenever the set of compat packages changes. | ||
| additionalCacheKey: '$(Pipeline.Workspace)/$(FluidFrameworkDirectory)/packages/test/test-version-utils/compat-workspaces/full/pnpm-lock.yaml' | ||
|
|
||
| - template: /tools/pipelines/templates/include-setup-npmrc-for-download.yml@self | ||
|
|
||
| # Set up Docker environment if running against docker | ||
| - ${{ if eq(parameters.runAgainstDocker, true) }}: | ||
| # Checks out FluidFramework repo | ||
| - checkout: self | ||
|
Contributor
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. the "self" -> "same version as pipeline artifact" is technically a behavior change. But pretty sure it's one we want (rather than possibly version skew the test workload and the docker environment)
Contributor
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. Agreed. |
||
| path: $(FluidFrameworkDirectory) | ||
| clean: true | ||
| - task: Docker@2 | ||
| displayName: 'Login to container registry' | ||
| inputs: | ||
|
|
@@ -371,43 +391,6 @@ stages: | |
| sourcePackageLocation: $(Pipeline.Workspace)/$(FFPipelineHostDirectory)/node_modules/${{ parameters.testPackage }} | ||
| destPackageLocation: $(Pipeline.Workspace)/$(FFPipelineHostDirectory) | ||
|
|
||
| - ${{ if eq(parameters.cacheCompatVersionsInstalls, true) }}: | ||
| - task: Bash@3 | ||
| displayName: Compute compat versions install location and version | ||
| inputs: | ||
| targetType: 'inline' | ||
| workingDirectory: $(Pipeline.Workspace)/$(FFPipelineHostDirectory)/node_modules/@fluid-private/test-end-to-end-tests | ||
| # Using import.meta.resolve to compute this is more resilient to different install tree types. | ||
| # Also note that test-version-utils is esm-only, so cannot be loaded with require. | ||
| script: | | ||
| set -eu -o pipefail | ||
| node --input-type=module -e " | ||
| import { createRequire } from 'module'; | ||
| const require = createRequire(import.meta.url); | ||
| const path = require('path'); | ||
| const versionUtilsIndexUrl = await import.meta.resolve('@fluid-private/test-version-utils'); | ||
| const basePath = new URL(versionUtilsIndexUrl.replace('/lib/index.js', '')).pathname; | ||
| const legacyModulesPath = path.join(basePath, 'node_modules', '.legacy'); | ||
| console.log('Resolved @fluid-private/test-version-utils legacy modules to ' + legacyModulesPath); | ||
| console.log('##vso[task.setvariable variable=compatVersionInstallsPath]' + legacyModulesPath); | ||
| const packageJsonPath = path.join(basePath, 'package.json'); | ||
| const packageJson = require(packageJsonPath); | ||
| const packageVersion = packageJson.version; | ||
| const [major, minor] = packageVersion.split('.'); | ||
| const cacheKey = 'major:' + major + ',minor:' + minor; | ||
| console.log('Computed compat version cache key: ' + cacheKey); | ||
| console.log('##vso[task.setvariable variable=compatVersionCacheKey;]'+ cacheKey); | ||
| " | ||
|
|
||
| - task: Cache@2 | ||
| displayName: Cache compat versions install location | ||
| timeoutInMinutes: 3 | ||
| continueOnError: true | ||
| inputs: | ||
| # Increment the number on the cache-bust key (no special semantics) to force a new cache key. | ||
| key: '"compat-version-installs" | "cache-bust-1" | "$(Agent.OS)" | "${{ parameters.testCommand }}" | "${{ variant.name }}" | "$(compatVersionCacheKey)"' | ||
| path: $(compatVersionInstallsPath) | ||
|
|
||
| # Only check out tenants from the tenant pool if we are running tests against ODSP | ||
| - ${{ if ne(parameters.odspTenantType, 'none') }}: | ||
| # Retrieve a tenant from the tenant pool | ||
|
|
@@ -429,6 +412,7 @@ stages: | |
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| inputs: | ||
| targetType: 'inline' | ||
| workingDirectory: $(Pipeline.Workspace)/$(FFPipelineHostDirectory) | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
|
|
@@ -528,6 +512,7 @@ stages: | |
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| inputs: | ||
| targetType: 'inline' | ||
| workingDirectory: $(Pipeline.Workspace)/$(FFPipelineHostDirectory) | ||
| script: | | ||
| set -eu -o pipefail | ||
| pnpm exec trips-cleanup --odspEndpoint=${{ parameters.odspTenantType }} --useFic | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.