diff --git a/azure-pipelines.vrt-baseline.yml b/azure-pipelines.vrt-baseline.yml index 8ba195238009d..c728aa88a920f 100644 --- a/azure-pipelines.vrt-baseline.yml +++ b/azure-pipelines.vrt-baseline.yml @@ -29,15 +29,25 @@ jobs: vrTestPackageName: '@fluentui/vr-tests-web-components' vrTestPackagePath: 'apps/vr-tests-web-components' - - bash: vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'FluentUI-web-components' --locationPostfix 'vrscreenshotwebcomponents' --pipelineId $(pipelineId) + - task: AzureCLI@2 displayName: 'Run Screenshotdiff update baseline' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) VR_APP_API_URL: $(VR_APP_API_URL) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'FluentUI-web-components' --locationPostfix 'vrscreenshotwebcomponents' --pipelineId $(pipelineId) - job: VRToolUpdateBaseline_V9 variables: @@ -53,15 +63,25 @@ jobs: vrTestPackageName: '@fluentui/vr-tests-react-components' vrTestPackagePath: 'apps/vr-tests-react-components' - - bash: vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'fluentuiv9' --locationPostfix 'vrscreenshotv9' --pipelineId $(pipelineId) + - task: AzureCLI@2 displayName: 'Run Screenshotdiff update baseline' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) VR_APP_API_URL: $(VR_APP_API_URL) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'fluentuiv9' --locationPostfix 'vrscreenshotv9' --pipelineId $(pipelineId) - job: VRToolUpdateBaseline_V8 variables: @@ -77,16 +97,25 @@ jobs: vrTestPackageName: '@fluentui/vr-tests' vrTestPackagePath: 'apps/vr-tests' - - bash: vr-app run-diff --screenshotsDirectory ./screenshots --buildType release --clientType "FLUENTUI" --locationPrefix 'fluentuiv8' --locationPostfix 'vrscreenshotv8' --pipelineId $(pipelineId) + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) VR_APP_API_URL: $(VR_APP_API_URL) - + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --screenshotsDirectory ./screenshots --buildType release --clientType "FLUENTUI" --locationPrefix 'fluentuiv8' --locationPostfix 'vrscreenshotv8' --pipelineId $(pipelineId) - job: VRToolUpdateBaseline_V0 variables: pipelineId: '313' @@ -101,12 +130,22 @@ jobs: vrTestPackageName: '@fluentui/docs' vrTestPackagePath: 'packages/fluentui/docs' - - bash: vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'FluentUI-v0' --locationPostfix 'vrscreenshotv0' --pipelineId $(pipelineId) + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) VR_APP_API_URL: $(VR_APP_API_URL) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --buildType release --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --locationPrefix 'FluentUI-v0' --locationPostfix 'vrscreenshotv0' --pipelineId $(pipelineId) diff --git a/azure-pipelines.vrt-pr.yml b/azure-pipelines.vrt-pr.yml index 1ccbf978d174d..a1e8c623e797c 100644 --- a/azure-pipelines.vrt-pr.yml +++ b/azure-pipelines.vrt-pr.yml @@ -30,10 +30,10 @@ jobs: - bash: | postPolicy="true"; - response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET} ) + response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET}) parsedResponse=${response/*"access_token"/} token=${parsedResponse:3:${#parsedResponse}-5} - curl --location --request POST 'https://vrapprovalfunction-prod.azurewebsites.net/api/policyStateV2' \ + curl --location --request POST 'https://vrtfunctionappv0.azurewebsites.net/api/policyStateV2' \ --header 'Authorization: Bearer '"$token" \ --header 'Content-Type: application/json' \ --data-raw ' { @@ -56,9 +56,9 @@ jobs: }' displayName: 'Call policy State Api' env: - VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) + VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_URL: $(VR_APP_CLIENT_URL) - template: .devops/templates/runpublishvrscreenshot.yml @@ -66,16 +66,26 @@ jobs: fluentVersion: webcomponents vrTestPackageName: '@fluentui/vr-tests-web-components' vrTestPackagePath: 'apps/vr-tests-web-components' - # ciDefinitionId is set to 205 because that is the ID of the baseline pipeline (https://uifabric.visualstudio.com/fabricpublic/_build?definitionId=205) used by the master branch - - bash: vr-app run-diff --screenshotsDirectory ./screenshots --buildType pr --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'FluentUI-web-components' --locationPostfix 'vrscreenshotwebcomponents' --pipelineId $(pipelineId) --clientName 'fluentui-web-components-v3' --threshold '0.04' --cumThreshold '1' + + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) - VR_APP_API_URL: $(VR_APP_API_URL) + VR_APP_API_URL: $(VR_APP_API_URL_NEW) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --screenshotsDirectory ./screenshots --buildType pr --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'FluentUI-web-components' --locationPostfix 'vrscreenshotwebcomponents' --pipelineId $(pipelineId) --clientName 'fluentui-web-components-v3' --threshold '0.04' --cumThreshold '1' condition: eq(variables['vrTestSkip'], 'no') - job: VisualRegressionTest_V9 @@ -98,7 +108,7 @@ jobs: response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET} ) parsedResponse=${response/*"access_token"/} token=${parsedResponse:3:${#parsedResponse}-5} - curl --location --request POST 'https://vrapprovalfunction-prod.azurewebsites.net/api/policyStateV2' \ + curl --location --request POST 'https://vrtfunctionappv0.azurewebsites.net/api/policyStateV2' \ --header 'Authorization: Bearer '"$token" \ --header 'Content-Type: application/json' \ --data-raw ' { @@ -121,9 +131,9 @@ jobs: }' displayName: 'Call policy State Api' env: - VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) + VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_URL: $(VR_APP_CLIENT_URL) - template: .devops/templates/runpublishvrscreenshot.yml @@ -132,15 +142,25 @@ jobs: vrTestPackageName: '@fluentui/vr-tests-react-components' vrTestPackagePath: 'apps/vr-tests-react-components' - - bash: vr-app run-diff --buildType pr --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'fluentuiv9' --locationPostfix 'vrscreenshotv9' --pipelineId $(pipelineId) --clientName 'fluentuiv9' --threshold '0.04' --cumThreshold '1' + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) - VR_APP_API_URL: $(VR_APP_API_URL) + VR_APP_API_URL: $(VR_APP_API_URL_NEW) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --buildType pr --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'fluentuiv9' --locationPostfix 'vrscreenshotv9' --pipelineId $(pipelineId) --clientName 'fluentuiv9' --threshold '0.04' --cumThreshold '1' condition: eq(variables['vrTestSkip'], 'no') - job: VisualRegressionTest_V8 @@ -159,10 +179,10 @@ jobs: - bash: | postPolicy="true"; - response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET} ) + response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET}) parsedResponse=${response/*"access_token"/} token=${parsedResponse:3:${#parsedResponse}-5} - curl --location --request POST 'https://vrapprovalfunction-prod.azurewebsites.net/api/policyStateV2' \ + curl --location --request POST 'https://vrtfunctionappv0.azurewebsites.net/api/policyStateV2' \ --header 'Authorization: Bearer '"$token" \ --header 'Content-Type: application/json' \ --data-raw ' { @@ -185,9 +205,9 @@ jobs: }' displayName: 'Call policy State Api' env: - VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) + VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_URL: $(VR_APP_CLIENT_URL) - template: .devops/templates/runpublishvrscreenshot.yml @@ -196,15 +216,25 @@ jobs: vrTestPackageName: '@fluentui/vr-tests' vrTestPackagePath: 'apps/vr-tests' - - bash: vr-app run-diff --screenshotsDirectory ./screenshots --buildType pr --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'fluentuiv8' --locationPostfix 'vrscreenshotv8' --pipelineId $(pipelineId) --clientName 'fluentuiv8' --threshold '0.04' --cumThreshold '1' + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) - VR_APP_API_URL: $(VR_APP_API_URL) + VR_APP_API_URL: $(VR_APP_API_URL_NEW) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --screenshotsDirectory ./screenshots --buildType pr --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'fluentuiv8' --locationPostfix 'vrscreenshotv8' --pipelineId $(pipelineId) --clientName 'fluentuiv8' --threshold '0.04' --cumThreshold '1' condition: eq(variables['vrTestSkip'], 'no') - job: VisualRegressionTest_V0 @@ -224,10 +254,10 @@ jobs: - bash: | postPolicy="true"; - response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET} ) + response=$(curl --request POST ${VR_APP_CLIENT_URL} --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id='${VR_APP_CLIENT_ID} --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET}) parsedResponse=${response/*"access_token"/} token=${parsedResponse:3:${#parsedResponse}-5} - curl --location --request POST 'https://vrapprovalfunction-prod.azurewebsites.net/api/policyStateV2' \ + curl --location --request POST 'https://vrtfunctionappv0.azurewebsites.net/api/policyStateV2' \ --header 'Authorization: Bearer '"$token" \ --header 'Content-Type: application/json' \ --data-raw ' { @@ -250,8 +280,8 @@ jobs: }' displayName: 'Call policy State Api' env: - VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) + VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_URL: $(VR_APP_CLIENT_URL) - template: .devops/templates/runpublishvrscreenshot.yml @@ -260,13 +290,23 @@ jobs: vrTestPackageName: '@fluentui/docs' vrTestPackagePath: 'packages/fluentui/docs' - - bash: vr-app run-diff --buildType pr --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'FluentUI-v0' --locationPostfix 'vrscreenshotv0' --pipelineId $(pipelineId) --clientName 'FluentUIV0' --threshold '0.04' --cumThreshold '1' + - task: AzureCLI@2 displayName: 'Run fluentui-screenshotdiff' env: API_TOKEN: $(fabric-public-pipeline-access-PAT) GITHUB_API_TOKEN: $(githubRepoStatusPAT) STORAGE_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) - VR_APP_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) VR_APP_CLIENT_ID: $(VR_APP_CLIENT_ID) - VR_APP_API_URL: $(VR_APP_API_URL) + VR_APP_API_URL: $(VR_APP_API_URL_NEW) + STORAGE_ACCOUNT_ID: $(StorageAccountId) + TENANT_ID: $(TenantId) + PRINCIPAL_CLIENT_ID: $(PrincipalClientId) + SERVICE_CONNECTION_ID: $(ServiceConnectionId) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + azureSubscription: $(AzureSubscription) + scriptType: bash + scriptLocation: 'inlineScript' + inlineScript: | + vr-app run-diff --buildType pr --screenshotsDirectory ./screenshots --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix 'FluentUI-v0' --locationPostfix 'vrscreenshotv0' --pipelineId $(pipelineId) --clientName 'FluentUIV0' --threshold '0.04' --cumThreshold '1' condition: eq(variables['vrTestSkip'], 'no') diff --git a/download-vr-cli.yml b/download-vr-cli.yml index 5a679dbc0b9d0..25edd7043ed40 100644 --- a/download-vr-cli.yml +++ b/download-vr-cli.yml @@ -1,6 +1,6 @@ steps: - bash: | set -exuo pipefail - npm install -g vr-approval-cli@0.0.168 + npm install -g vr-approval-cli@0.4.3 displayName: Download VR App CLI retryCountOnTaskFailure: 3