Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SPWizard01 authored Oct 23, 2024
2 parents e0c1f9a + e659bb6 commit 7a07db9
Show file tree
Hide file tree
Showing 10,920 changed files with 697,269 additions and 429,651 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 0 additions & 6 deletions .codesandbox/ci.json

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT=18-bookworm
ARG VARIANT=20-bookworm
# https://github.com/devcontainers/images/tree/main/src/typescript-node
FROM mcr.microsoft.com/devcontainers/typescript-node:1-${VARIANT}

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "18-bookworm"
"VARIANT": "20-bookworm"
}
},
"features": {
Expand Down
22 changes: 15 additions & 7 deletions .devops/templates/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ steps:
displayName: yarn (install packages)

- script: |
yarn nx run @fluentui/workspace-plugin:check-graph
yarn nx run workspace-plugin:check-graph
yarn nx g @fluentui/workspace-plugin:tsconfig-base-all --verify
yarn nx g @fluentui/workspace-plugin:normalize-package-dependencies --verify
displayName: Workspace lint
- script: |
# @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts, thus it needs to be build in advance
yarn workspace @fluentui/api-docs build
# following packages need to be build in advance:
# @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts,
# @fluentui/digest is used within packages/fluentui/perf-test-northstar/just.config.ts, thus it needs to be build in advance
yarn workspace @fluentui/digest build
yarn tsc -p ./tsconfig.json
#
# NOTE: we are running this via nx in order to get cache hits later on
yarn nx run-many -t build -p api-docs digest
yarn tsc -p ./tsconfig.just-scripts-configs.json
displayName: Type-check just.config.ts files
- script: |
Expand All @@ -42,7 +44,13 @@ steps:
DANGER_GITHUB_API_TOKEN: $(DANGER_GITHUB_API_TOKEN)
- script: |
yarn buildci $(sinceArg)
displayName: build, test, lint, test-ssr
yarn nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail $(sinceArg)
displayName: build, test, lint, test-ssr (affected)
condition: eq(variables.isPR, true)
- script: |
yarn nx run-many -t build test lint type-check test-ssr test-integration verify-packaging --nxBail
displayName: build, test, lint, test-ssr (all)
condition: eq(variables.isPR, false)
- template: cleanup.yml
50 changes: 41 additions & 9 deletions .devops/templates/deployE2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,49 @@ steps:
filePath: yarn-ci.sh
displayName: yarn

- script: |
yarn playwright install --with-deps
displayName: Install Playwright dependencies
- script: |
yarn cypress verify
displayName: verify cypress install
# this also builds FUI N* docs if appropriate
- script: |
yarn bundle $(sinceArg)
yarn nx affected -t bundle --nxBail $(sinceArg)
displayName: bundle
condition: eq(variables.isPR, true)
- script: |
yarn lage build-storybook --verbose $(sinceArg)
yarn nx affected -t build-storybook --nxBail $(sinceArg)
displayName: build Storybooks
condition: eq(variables.isPR, true)
## This runs regardless of scope, the app will adapt to the scope as well
- script: |
yarn workspace @fluentui/pr-deploy-site generate:site
yarn nx run pr-deploy-site:generate:site
displayName: generate PR Deploy Site
- task: AzureUpload@2
- task: AzureCLI@2
displayName: Upload PR deploy site
condition: eq(variables.isPR, true)
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)
ContainerName: '$web'
SourcePath: 'apps/pr-deploy-site/dist'
storage: $(azureStorage)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch \
--destination '$web' \
--source apps/pr-deploy-site/dist \
--account-name $(azureStorage) \
--destination-path $(deployBasePath) \
--auth-mode login \
--overwrite
- task: GithubPRStatus@0
displayName: 'Update PR deploy site github status'
condition: eq(variables.isPR, true)
inputs:
githubOwner: microsoft
githubRepo: fluentui
Expand All @@ -43,8 +57,26 @@ steps:
# This MUST have a trailing slash, or the links to PR deploy site assets won't work
githubTargetLink: $(deployUrl)/

# TODO: once https://github.com/nrwl/nx/issues/26903 will be fixed we can remove NX_PARALLEL=1 override via env variable
- script: |
NX_PARALLEL=1 yarn nx affected -t e2e --nxBail --parallel 1 $(sinceArg)
displayName: Cypress E2E tests
condition: eq(variables.isPR, true)
- script: |
yarn nx run-many -t bundle --nxBail
displayName: bundle
condition: eq(variables.isPR, false)
- script: |
yarn nx run-many -t build-storybook --nxBail
displayName: build Storybooks
condition: eq(variables.isPR, false)
# TODO: once https://github.com/nrwl/nx/issues/26903 will be fixed we can remove NX_PARALLEL=1 override via env variable
- script: |
yarn e2e $(sinceArg)
NX_PARALLEL=1 yarn nx run-many -t e2e --nxBail --parallel 1
displayName: Cypress E2E tests
condition: eq(variables.isPR, false)
- template: cleanup.yml
50 changes: 50 additions & 0 deletions .devops/templates/publish-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
parameters:
- name: version
type: string
default: 8

steps:
- task: AzureCLI@2
displayName: 'Copy website drop to Azure'
inputs:
azureSubscription: 'Azure - fabricweb storage - NEW'
scriptType: 'bash'
scriptLocation: inlineScript
inlineScript: |
az storage blob upload-batch \
--destination 'fabric-website' \
--source $(System.DefaultWorkingDirectory)/apps/public-docsite/dist \
--account-name fabricweb \
--destination-path v${{ parameters.version }}/$(Build.BuildNumber)/ \
--auth-mode login \
--overwrite
- task: AzureCLI@2
displayName: 'Update dogfood manifest in Azure blob'
inputs:
azureSubscription: 'Azure - fabricweb storage - NEW'
scriptType: 'bash'
scriptLocation: inlineScript
inlineScript: |
az storage blob upload \
--account-name fabricweb \
--container-name fabric-website \
--name manifests/v${{ parameters.version }}-df.js \
--file $(System.DefaultWorkingDirectory)/site-manifests/v${{ parameters.version }}-df.js \
--auth-mode login \
--overwrite
- task: AzureCLI@2
displayName: 'Update prod manifest in Azure blob'
inputs:
azureSubscription: 'Azure - fabricweb storage - NEW'
scriptType: 'bash'
scriptLocation: inlineScript
inlineScript: |
az storage blob upload \
--account-name fabricweb \
--container-name fabric-website \
--name manifests/v${{ parameters.version }}-prod.js \
--file $(System.DefaultWorkingDirectory)/site-manifests/v${{ parameters.version }}-prod.js \
--auth-mode login \
--overwrite
57 changes: 49 additions & 8 deletions .devops/templates/runpublishvrscreenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,36 @@ parameters:
default: v8
- name: vrTestPackageName
type: string
default: '@fluentui/vr-tests'
default: vr-tests'
- name: vrTestPackagePath
type: string
default: 'apps/vr-tests'
- name: locationPrefix
type: string
default: fluentuiv8
- name: locationPostfix
type: string
default: vrscreenshotv8
- name: clientName
type: string
default: fluentuiv8

steps:
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn (install packages)

- script: |
yarn playwright install --with-deps
displayName: Install Playwright dependencies
- script: |
isPR=${{lower(eq(variables['Build.Reason'], 'PullRequest'))}}
echo $isPR
echo "##vso[task.setvariable variable=isPR;]$isPR"
if [[ $isPR == true ]]; then
packageAffected=$(yarn --silent check:affected --package ${{ parameters.vrTestPackageName }})
packageAffected=$(yarn --silent check:affected --project ${{ parameters.vrTestPackageName }})
if [[ $packageAffected == false ]]; then
echo "In PR pipeline but NOT affecting test package. Skipping test run"
echo "##vso[task.setvariable variable=vrTestSkip;]yes"
Expand All @@ -34,12 +48,7 @@ steps:
displayName: Check if vrTests should be skipped
- script: |
yarn workspace ${{ parameters.vrTestPackageName }} vr:build
displayName: Build VR tests components package
condition: eq(variables['vrTestSkip'], 'no')
- script: |
yarn workspace ${{ parameters.vrTestPackageName }} vr:test --verbose
yarn nx run ${{ parameters.vrTestPackageName }}:test-vr --nxBail
displayName: 'Run VR tests'
condition: eq(variables['vrTestSkip'], 'no')
Expand All @@ -55,3 +64,35 @@ steps:
ArtifactName: 'vrscreenshot${{ parameters.fluentVersion }}'
publishLocation: 'Container'
condition: eq(variables['vrTestSkip'], 'no')

- bash: |
set -exuo pipefail
npx [email protected] create-policy --nonBlockingPipelines '{"$(pipelineId)":{"pipelineStatus": "PENDING","pipelineName": "$(pipelineName)"}}' --clientType 'FLUENTUI'
displayName: VR App - Create Policy
env:
VR_APP_API_URL: $(VR_APP_API_URL)
TENANT_ID: $(TenantId)
PRINCIPAL_CLIENT_ID: $(PrincipalClientId)
SERVICE_CONNECTION_ID: $(ServiceConnectionId)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
condition: eq(variables.isPR, true)
- task: AzureCLI@2
displayName: 'Run fluentui-screenshotdiff'
env:
API_TOKEN: $(fabric-public-pipeline-access-PAT)
GITHUB_API_TOKEN: $(githubRepoStatusPAT)
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'
# 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
inlineScript: |
npx [email protected] run-diff --screenshotsDirectory ./screenshots --buildType pr --clientType "FLUENTUI" --ciDefinitionId 205 --groupName $(pipelineName) --locationPrefix ${{ parameters.locationPrefix }} --locationPostfix ${{ parameters.locationPostfix }} --pipelineId $(pipelineId) --clientName ${{ parameters.clientName }} --threshold '0.04' --cumThreshold '1'
condition: and(eq(variables.isPR, true), eq(variables['vrTestSkip'], 'no'))
3 changes: 2 additions & 1 deletion .devops/templates/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
# - we can use only versions that ship with container, otherwise we will run into nodejs installation issues.
# - as 1es bumps those versions within container automatically we need to use `<major>.x` to not run into issues once they bump the versions.
# https://github.com/actions/runner-images/blob/ubuntu20/20230924.1/images/linux/Ubuntu2004-Readme.md#nodejs
version: '18.x'
version: '20.x'
checkLatest: false
displayName: 'Install Node.js'
retryCountOnTaskFailure: 1
Expand Down Expand Up @@ -35,5 +35,6 @@ steps:
echo 'deployUrl "$(deployUrl)"'
echo 'isPR "$(isPR)"'
echo 'targetBranch "$(targetBranch)"'
echo number of CPUs "$(getconf _NPROCESSORS_ONLN)"
displayName: Log environment variables (Linux)
condition: eq(variables['Agent.OS'], 'Linux')
6 changes: 5 additions & 1 deletion .devops/templates/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ variables:
# Prevents failures on CI when "caniuse-lite" becomes outdated
BROWSERSLIST_IGNORE_OLD_DATA: true

NX_PARALLEL: 8
NX_PREFER_TS_NODE: true
NX_VERBOSE_LOGGING: true

# Also accessed as process.env.DEPLOYHOST
deployHost: 'fluentuipr.z22.web.core.windows.net'

# Also accessed as process.env.DEPLOYURL
deployUrl: 'https://$(deployHost)/$(deployBasePath)'

# This service principal ("subscription" is a misleading name) only has access to the fluentuipr storage account
azureSubscription: Azure PR deploy
azureSubscription: Azure PR deploy - NEW
azureStorage: fluentuipr

${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
Expand Down
4 changes: 4 additions & 0 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
node ./scripts/package-manager/src/notify-lockfile-changes.js $changedFiles
4 changes: 4 additions & 0 deletions .githooks/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
node ./scripts/package-manager/src/notify-lockfile-changes.js $changedFiles
1 change: 1 addition & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/usr/bin/env sh
Loading

0 comments on commit 7a07db9

Please sign in to comment.