diff --git a/.github/workflows/bundle-size-comment.yml b/.github/workflows/bundle-size-comment.yml index 9efffc8fb4b7cf..676d7228a1354e 100644 --- a/.github/workflows/bundle-size-comment.yml +++ b/.github/workflows/bundle-size-comment.yml @@ -8,9 +8,14 @@ on: jobs: comment: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ (github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev') && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} permissions: pull-requests: write + # `actions/checkout` + `actions/download-artifact` (cross run) need these explicitly, since + # declaring a `permissions` block sets every unlisted scope to `none` + contents: read + actions: read steps: - uses: actions/checkout@v6 with: diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index 186b59657f5e8f..13ab2617dd36d5 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -8,16 +8,18 @@ concurrency: cancel-in-progress: true env: - NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM - NX_PREFER_TS_NODE: true + # Keep the upstream larger-runner tuning; leave one core free on the fork's Ubuntu runner. + NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '3' || '6' }} NX_VERBOSE_LOGGING: true BROWSERSLIST_IGNORE_OLD_DATA: true jobs: bundle-size: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} + timeout-minutes: 180 permissions: contents: 'read' actions: 'read' @@ -52,9 +54,33 @@ jobs: - name: Compare bundle size with base if: ${{ github.event.pull_request.base.ref == 'master' }} - run: npx monosize compare-reports --branch=${{ github.event.pull_request.base.ref }} --output=markdown --quiet > ./monosize-report.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # passed via env (not inlined into the script) so nothing from the event payload is + # evaluated by the shell + BASE_REF: ${{ github.event.pull_request.base.ref }} + REPOSITORY: ${{ github.repository }} + # base reports are read from the `microsoft/fluentui` "Bundle size Base" artifacts + # (see `storage` in monosize.config.mjs). A fork's GITHUB_TOKEN cannot read those, so a + # missing/unreachable baseline must not fail PR validation there - upstream keeps failing hard. + ALLOW_MISSING_BASE_REPORT: ${{ github.repository != 'microsoft/fluentui' }} + run: | + if npx monosize compare-reports --branch="$BASE_REF" --output=markdown --quiet > ./monosize-report.md; then + exit 0 + fi + + if [ "$ALLOW_MISSING_BASE_REPORT" != 'true' ]; then + echo "::error::'monosize compare-reports' failed." + exit 1 + fi + + echo "::warning::Bundle size comparison unavailable - the base report published by 'microsoft/fluentui' is not readable from '$REPOSITORY'. The bundle-size builds themselves passed." + { + printf '### 📦 Bundle size\n\n' + printf 'Bundle size **builds passed**, but no comparison could be produced.\n\n' + printf 'Baseline reports are published by the `Bundle size Base` workflow of ' + printf '`microsoft/fluentui` and are not readable from `%s`.\n' "$REPOSITORY" + } > ./monosize-report.md - name: Save PR number if: ${{ github.event.pull_request.base.ref == 'master' }} diff --git a/.github/workflows/check-packages.yml b/.github/workflows/check-packages.yml index 2736994f3b41a8..5c8d61810406a4 100644 --- a/.github/workflows/check-packages.yml +++ b/.github/workflows/check-packages.yml @@ -5,7 +5,8 @@ on: jobs: dependency-deduplication: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'microsoft' }} + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} steps: - uses: actions/checkout@v6 with: @@ -38,7 +39,8 @@ jobs: dependency-mismatches: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'microsoft' }} + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} steps: - uses: actions/checkout@v6 with: @@ -65,7 +67,8 @@ jobs: change-files: runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'microsoft' }} + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} steps: - uses: actions/checkout@v6 with: diff --git a/.github/workflows/check-tooling.yml b/.github/workflows/check-tooling.yml index b7f0830b0897c6..845e46758c8aa7 100644 --- a/.github/workflows/check-tooling.yml +++ b/.github/workflows/check-tooling.yml @@ -14,11 +14,14 @@ env: jobs: check-tools: - if: ${{ github.repository_owner == 'microsoft' }} + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} strategy: matrix: + # both are GitHub hosted runners, no change needed for fork validation os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - uses: actions/checkout@v6 with: @@ -39,12 +42,16 @@ jobs: # pre-build react-jsx-runtime - as generate-api executor doesn't provide copy assets capability - run: yarn nx run react-jsx-runtime:build - - run: yarn nx g @fluentui/workspace-plugin:react-library --name hello-world --owner '@microsoft/fluentui-react-build' --kind standard --no-interactive + # The workflow validates generated files and follow-on generators after installing above. + # Avoid a redundant native dependency rebuild on the smaller Ubuntu runner. + - run: yarn nx g @fluentui/workspace-plugin:react-library --name hello-world --owner '@microsoft/fluentui-react-build' --kind standard --skip-install=${{ github.repository_owner == 'mainframev' }} --no-interactive - run: yarn nx g @fluentui/workspace-plugin:react-component --project hello-world-preview --name Aiur --no-interactive - run: yarn nx g @fluentui/workspace-plugin:cypress-component-configuration --project hello-world-preview --no-interactive - run: yarn nx g @fluentui/workspace-plugin:bundle-size-configuration --project hello-world-preview --no-interactive - run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=preview --no-interactive - - run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=stable --no-interactive + # API generation resolves the newly stable package through its workspace link, which is created + # by the install skipped on the fork. Upstream retains the complete post-generation validation. + - run: yarn nx g @fluentui/workspace-plugin:prepare-initial-release --project hello-world-preview --phase=stable --skip-install=${{ github.repository_owner == 'mainframev' }} --skip-generate-api=${{ github.repository_owner == 'mainframev' }} --no-interactive - run: yarn nx g @nx/workspace:remove --project hello-world --forceRemove --no-interactive - run: yarn nx g @nx/workspace:remove --project hello-world-stories --forceRemove --no-interactive - run: yarn nx g @fluentui/workspace-plugin:tsconfig-base-all --no-interactive diff --git a/.github/workflows/pr-vrt-comment.yml b/.github/workflows/pr-vrt-comment.yml index 4198336a102504..bb795a67cf0d3e 100644 --- a/.github/workflows/pr-vrt-comment.yml +++ b/.github/workflows/pr-vrt-comment.yml @@ -6,13 +6,17 @@ on: - completed env: - NX_PARALLEL: 4 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM - NX_PREFER_TS_NODE: true + # this workflow runs on `ubuntu-latest` = 4-core CPU / 16 GB of RAM + NX_PARALLEL: 4 NX_VERBOSE_LOGGING: true jobs: run_vr_diff: runs-on: ubuntu-latest + # NOTE: intentionally upstream only - the VR approval CLI authenticates against Azure via OIDC + # (`AZURE_VRT_CLIENT_ID`/`AZURE_TENANT_ID`/`AZURE_SUBSCRIPTION_ID`) and writes to the shared + # baseline storage. Forks do not have those secrets, so this stays skipped there instead of + # failing PR validation - screenshot *generation* is still validated by `pr-vrt.yml`. if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} permissions: # necessary to write comments to the PR from the vr-approval-cli @@ -28,7 +32,7 @@ jobs: # downloaded artifacts will contain screenshots from affected project including 'screenshots-report.json' which contains proper image mappings for affected project # - see @{link file://./../scripts/prepare-vr-screenshots-for-upload.js#45} - # - see @{link file://./pr-vrt.yml#56} + # - see @{link file://./pr-vrt.yml#80} - uses: actions/download-artifact@v7 with: diff --git a/.github/workflows/pr-vrt.yml b/.github/workflows/pr-vrt.yml index 4d7a717b33d311..6ccc52e87f1985 100644 --- a/.github/workflows/pr-vrt.yml +++ b/.github/workflows/pr-vrt.yml @@ -11,8 +11,8 @@ concurrency: cancel-in-progress: true env: - NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM - NX_PREFER_TS_NODE: true + # Keep the upstream larger-runner tuning; limit memory-heavy Storybook/Playwright work on the fork. + NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '2' || '6' }} NX_VERBOSE_LOGGING: true permissions: @@ -21,10 +21,12 @@ permissions: jobs: generate_vrt_screenshots: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + # The fork validates screenshot generation on Ubuntu. Upstream stays on macOS to match its baseline. + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} name: Generate screenshots - timeout-minutes: 60 + timeout-minutes: 120 steps: - uses: actions/checkout@v6 with: @@ -40,6 +42,14 @@ jobs: cache: 'yarn' node-version: '22' + # storybook builds + playwright browsers do not fit next to the preinstalled SDKs of the image + - name: Free up runner disk space + if: ${{ github.repository_owner == 'mainframev' }} + run: | + df -h / + sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL || true + df -h / + - run: yarn install --frozen-lockfile - run: yarn playwright install --with-deps diff --git a/.github/workflows/pr-website-deploy-comment.yml b/.github/workflows/pr-website-deploy-comment.yml index 42f808fe0dcd9f..481c95cfeae36c 100644 --- a/.github/workflows/pr-website-deploy-comment.yml +++ b/.github/workflows/pr-website-deploy-comment.yml @@ -17,6 +17,11 @@ env: jobs: deploy: runs-on: ubuntu-latest + # NOTE: intentionally upstream only - uploading to the `fluentuipr` storage account requires the + # Azure OIDC credentials (`AZURE_CLIENT_ID`/`AZURE_TENANT_ID`/`AZURE_SUBSCRIPTION_ID`), which do + # not exist in forks. Keeping it skipped there (the dependent `comment` job is skipped with it) + # means PR validation is not failed by a missing deployment target - the website artifact itself + # is still built and validated by `pr-website-deploy.yml`. if: ${{ github.repository_owner == 'microsoft' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} outputs: pr_number: ${{ steps.pr_number.outputs.result }} diff --git a/.github/workflows/pr-website-deploy.yml b/.github/workflows/pr-website-deploy.yml index 2b7c54f0d7faba..609d9612980b97 100644 --- a/.github/workflows/pr-website-deploy.yml +++ b/.github/workflows/pr-website-deploy.yml @@ -8,16 +8,20 @@ concurrency: cancel-in-progress: true env: - NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM - NX_PREFER_TS_NODE: true + # Keep the upstream larger-runner tuning; limit memory-heavy webpack work on the fork. + NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '2' || '6' }} NX_VERBOSE_LOGGING: true BROWSERSLIST_IGNORE_OLD_DATA: true jobs: bundle: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream. + # NOTE: this job only *builds* the PR website artifact - uploading it to Azure happens in + # `pr-website-deploy-comment.yml`, which stays upstream only (needs Azure credentials). + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} + timeout-minutes: 240 permissions: contents: 'read' actions: 'read' @@ -41,6 +45,14 @@ jobs: - name: NodeJS heap default size run: node -e 'console.log(v8.getHeapStatistics().heap_size_limit / 1024 / 1024 + " MB");' + # bundles + storybook builds of the whole workspace do not fit next to the preinstalled SDKs + - name: Free up runner disk space + if: ${{ github.repository_owner == 'mainframev' }} + run: | + df -h / + sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL || true + df -h / + - run: yarn install --frozen-lockfile - name: Install Playwright Browsers diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bfe29d543e43f8..4bb6aba82ded98 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,10 +11,13 @@ concurrency: cancel-in-progress: true env: - NX_PARALLEL: 6 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM - NX_PREFER_TS_NODE: true + # Keep the upstream larger-runner tuning; use one Nx task per core on the fork's Ubuntu runner. + NX_PARALLEL: ${{ github.repository_owner == 'mainframev' && '4' || '6' }} NX_VERBOSE_LOGGING: true + # Nx already runs tasks concurrently, so use one Jest worker per task on the 4-core fork runner. + FLUENT_JEST_WORKER: ${{ github.repository_owner == 'mainframev' && '1' || '2' }} + BROWSERSLIST_IGNORE_OLD_DATA: true DEPLOY_HOST: fluentuipr.z22.web.core.windows.net @@ -23,8 +26,10 @@ env: jobs: main: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} + timeout-minutes: 300 permissions: contents: 'read' actions: 'read' @@ -74,16 +79,62 @@ jobs: - name: build, test, lint, test-ssr (affected) run: | - FLUENT_JEST_WORKER=2 yarn nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail + yarn nx affected -t build test lint type-check test-ssr test-integration verify-packaging --nxBail - name: 'Check for unstaged changes' run: | git status --porcelain git diff-index --quiet HEAD -- || exit 1 + type-check-benchmark: + name: TypeScript benchmark + if: ${{ github.repository_owner == 'mainframev' }} + runs-on: ubuntu-latest + timeout-minutes: 180 + env: + NX_PARALLEL: 2 + NX_VERBOSE_LOGGING: true + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v6 + with: + cache: yarn + node-version: 22 + + - run: yarn install --frozen-lockfile + + - name: Report TypeScript version + run: yarn tsc --version + + - name: Run uncached workspace type-check + shell: bash + run: | + started_at=$(date +%s) + set +e + yarn nx run-many -t type-check --all --parallel="$NX_PARALLEL" --skip-nx-cache + status=$? + set -e + duration_seconds=$(($(date +%s) - started_at)) + + { + echo "## TypeScript type-check benchmark" + echo + echo "- Duration: ${duration_seconds} seconds" + echo "- Parallelism: ${NX_PARALLEL}" + echo "- Nx cache: disabled" + } >> "$GITHUB_STEP_SUMMARY" + + exit "$status" + react-compiler-analyzer: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} + timeout-minutes: 120 permissions: contents: 'read' actions: 'read' @@ -110,8 +161,15 @@ jobs: yarn nx affected -t react-compiler-analyzer--lint --nxBail react-major-versions-integration: - if: ${{ github.repository_owner == 'microsoft' }} - runs-on: macos-14-xlarge + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + runs-on: ${{ github.repository_owner == 'mainframev' && 'ubuntu-latest' || 'macos-14-xlarge' }} + timeout-minutes: 300 + permissions: + contents: 'read' + # required by `nrwl/nx-set-shas` to look up the last successful workflow run + actions: 'read' + steps: - uses: actions/checkout@v6 with: @@ -129,6 +187,15 @@ jobs: - run: echo number of CPUs "$(getconf _NPROCESSORS_ONLN)" + # this job installs 2 additional React workspaces (+ 2 Cypress binaries) next to the + # workspace `node_modules`, which does not fit next to the preinstalled SDKs of the image + - name: Free up runner disk space + if: ${{ github.repository_owner == 'mainframev' }} + run: | + df -h / + sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL || true + df -h / + - run: | yarn install --frozen-lockfile yarn rit --react 17 --install-deps @@ -156,15 +223,18 @@ jobs: - name: React Versions Integration Tests (17,18) - Type-check & Test env: NODE_OPTIONS: --max-old-space-size=4096 + # Each task gets a 4 GB heap, so limit the 16 GB fork runner while preserving upstream tuning. run: | - FLUENT_JEST_WORKER=2 yarn nx affected -t test-rit--17--type-check,test-rit--18--type-check,test-rit--17--test,test-rit--18--test --exclude='react-19-tests-v9' + yarn nx affected -t test-rit--17--type-check,test-rit--18--type-check,test-rit--17--test,test-rit--18--test --exclude='react-19-tests-v9' --parallel=${{ github.repository_owner == 'mainframev' && '2' || '6' }} e2e: - if: ${{ github.repository_owner == 'microsoft' }} - # TODO: switch to macos once problematic tests are fixed + # upstream repo + the fork used to validate large migrations before they are opened upstream + if: ${{ github.repository_owner == 'microsoft' || github.repository_owner == 'mainframev' }} + # NOTE: this job was already running on ubuntu # https://github.com/microsoft/fluentui/issues/33173 # https://github.com/microsoft/fluentui/issues/33172 runs-on: ubuntu-latest + timeout-minutes: 120 permissions: contents: 'read' actions: 'read' diff --git a/apps/public-docsite-resources/package.json b/apps/public-docsite-resources/package.json index 362cb5c11f9a6a..9629404cad53d3 100644 --- a/apps/public-docsite-resources/package.json +++ b/apps/public-docsite-resources/package.json @@ -30,7 +30,6 @@ "license": "MIT", "scripts": { "build": "just-scripts build", - "prebundle": "yarn build", "bundle": "just-scripts bundle", "lint": "eslint --ext .js,.ts,.tsx ./src", "just": "just-scripts", diff --git a/apps/public-docsite-resources/project.json b/apps/public-docsite-resources/project.json index 3e2fd9316813c6..316c333afabba0 100644 --- a/apps/public-docsite-resources/project.json +++ b/apps/public-docsite-resources/project.json @@ -3,5 +3,10 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "implicitDependencies": [], - "tags": ["v8"] + "tags": ["v8"], + "targets": { + "bundle": { + "dependsOn": ["build", "^build"] + } + } } diff --git a/packages/react-components/babel-preset-global-context/project.json b/packages/react-components/babel-preset-global-context/project.json index a692c5e265aeb1..d1a97ad0efa11b 100644 --- a/packages/react-components/babel-preset-global-context/project.json +++ b/packages/react-components/babel-preset-global-context/project.json @@ -4,5 +4,10 @@ "projectType": "library", "implicitDependencies": [], "sourceRoot": "packages/react-components/babel-preset-global-context/src", - "tags": ["vNext", "platform:node", "tools"] + "tags": ["vNext", "platform:node", "tools"], + "targets": { + "e2e": { + "dependsOn": ["build"] + } + } } diff --git a/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx b/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx index b1a8a183cd68f6..dbf45bc6e2fcbd 100644 --- a/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx +++ b/packages/react-components/react-headless-components-preview/library/src/components/Dialog/Dialog.cy.tsx @@ -186,7 +186,9 @@ describe('Dialog', () => { cy.get('#open-popover-btn').should('have.focus'); // Open Tooltip, wait for the tooltip to appear and then close it with Escape - cy.get(dialogTriggerCloseSelector).focus().wait(0).realType('{esc}'); + cy.get(dialogTriggerCloseSelector).focus(); + cy.get('[role="tooltip"]').should('be.visible'); + cy.focused().realType('{esc}'); cy.get(dialogSurfaceSelector).should('exist'); }); diff --git a/scripts/jest/src/shared.js b/scripts/jest/src/shared.js index 6c8ce0e1b8b9af..dcec9524df1a8c 100644 --- a/scripts/jest/src/shared.js +++ b/scripts/jest/src/shared.js @@ -9,7 +9,8 @@ * based on testing spawning only 50% of available workers is fastest on both Local Machine and CI env atm ( 8 Core machine, 16GB RAM) */ -// - for macos large runner on GHA we need to set it to 2 {@link file://./../../../.github/workflows/pr.yml#77} +// - on GHA `FLUENT_JEST_WORKER` is set per runner size because Nx already runs tasks concurrently +// {@link file://./../../../.github/workflows/pr.yml} // - for ADO runners it's 50% // - temporary adding FLUENT_JEST_WORKER var in order to make it pass on both GHA and ADO const workersConfig = { maxWorkers: process.env.FLUENT_JEST_WORKER || '50%' }; diff --git a/scripts/puppeteer/src/utils.ts b/scripts/puppeteer/src/utils.ts index 27d6c40b3b58d4..6c801a0a3f4bfc 100644 --- a/scripts/puppeteer/src/utils.ts +++ b/scripts/puppeteer/src/utils.ts @@ -4,16 +4,20 @@ import type { LaunchOptions } from './types'; export async function launch(options: LaunchOptions = {}) { const maxAttempts = 5; + const launchOptions = + process.platform === 'linux' && process.env.CI + ? { ...options, args: [...(options.args ?? []), '--no-sandbox', '--disable-setuid-sandbox'] } + : options; let attempt = 1; let browser: puppeteer.Browser | undefined; - console.log(`puppeteer: launching with settings: ${JSON.stringify(options)}`); + console.log(`puppeteer: launching with settings: ${JSON.stringify(launchOptions)}`); while (!browser) { try { - browser = await puppeteer.launch(options); + browser = await puppeteer.launch(launchOptions); console.log('puppeteer: launched...'); } catch (err) { if (attempt === maxAttempts) { diff --git a/tools/workspace-plugin/src/generators/prepare-initial-release/index.ts b/tools/workspace-plugin/src/generators/prepare-initial-release/index.ts index e5ae740281b08f..5b1d2186690067 100644 --- a/tools/workspace-plugin/src/generators/prepare-initial-release/index.ts +++ b/tools/workspace-plugin/src/generators/prepare-initial-release/index.ts @@ -235,13 +235,17 @@ async function stableRelease(tree: Tree, options: NormalizedSchema & { isSplitPr } return (_tree: Tree) => { - installPackagesTask(tree, true); + if (!options.skipInstall) { + installPackagesTask(tree, true); + } generateChangefileTask(tree, newPackage.npmName, { message: 'feat: release stable', changeType: 'minor' }); generateChangefileTask(tree, suiteNpmProjectName, { message: `feat: add ${newPackage.npmName} to suite`, changeType: 'minor', }); - generateApiMarkdownTask(tree, suiteProjectName); + if (!options.skipGenerateApi) { + generateApiMarkdownTask(tree, suiteProjectName); + } }; async function updateProjectsThatUsedPreviewPackage() { diff --git a/tools/workspace-plugin/src/generators/prepare-initial-release/schema.json b/tools/workspace-plugin/src/generators/prepare-initial-release/schema.json index 89cff067882dcc..38f9cb34ad2e32 100644 --- a/tools/workspace-plugin/src/generators/prepare-initial-release/schema.json +++ b/tools/workspace-plugin/src/generators/prepare-initial-release/schema.json @@ -37,6 +37,16 @@ } ] } + }, + "skipInstall": { + "type": "boolean", + "description": "Skip installing dependencies after preparing the release", + "default": false + }, + "skipGenerateApi": { + "type": "boolean", + "description": "Skip generating API documentation after preparing a stable release", + "default": false } }, "required": ["project", "phase"] diff --git a/tools/workspace-plugin/src/generators/prepare-initial-release/schema.ts b/tools/workspace-plugin/src/generators/prepare-initial-release/schema.ts index 07b25f9267f630..1e27771b0ce73a 100644 --- a/tools/workspace-plugin/src/generators/prepare-initial-release/schema.ts +++ b/tools/workspace-plugin/src/generators/prepare-initial-release/schema.ts @@ -14,4 +14,12 @@ export interface ReleasePackageGeneratorSchema { * Phase of npm release life cycle for fluent v9 core package */ phase: 'preview' | 'stable' | 'compat'; + /** + * Skip installing dependencies after preparing the release + */ + skipInstall?: boolean; + /** + * Skip generating API documentation after preparing a stable release + */ + skipGenerateApi?: boolean; } diff --git a/tools/workspace-plugin/src/generators/react-library/index.ts b/tools/workspace-plugin/src/generators/react-library/index.ts index f70a75d90469de..92752d08aa4fd4 100644 --- a/tools/workspace-plugin/src/generators/react-library/index.ts +++ b/tools/workspace-plugin/src/generators/react-library/index.ts @@ -40,6 +40,10 @@ export default async function (tree: Tree, schema: ReactLibraryGeneratorSchema) await formatFiles(tree); + if (schema.skipInstall) { + return; + } + return () => { installPackagesTask( tree, diff --git a/tools/workspace-plugin/src/generators/react-library/schema.json b/tools/workspace-plugin/src/generators/react-library/schema.json index 0576cdcbd353e7..c85c77253e72ea 100644 --- a/tools/workspace-plugin/src/generators/react-library/schema.json +++ b/tools/workspace-plugin/src/generators/react-library/schema.json @@ -38,6 +38,11 @@ "x-prompt": { "message": "What kind of react-components library do you wanna create?" } + }, + "skipInstall": { + "type": "boolean", + "description": "Skip installing dependencies after generating the library", + "default": false } }, "required": ["name", "owner"] diff --git a/tools/workspace-plugin/src/generators/react-library/schema.ts b/tools/workspace-plugin/src/generators/react-library/schema.ts index b15e11fbb0d5ce..cd9de6cd196aff 100644 --- a/tools/workspace-plugin/src/generators/react-library/schema.ts +++ b/tools/workspace-plugin/src/generators/react-library/schema.ts @@ -18,4 +18,8 @@ export interface ReactLibraryGeneratorSchema { * v9 library kind either embracing converged patterns(standard) or using griffel only with old framework patterns(compat) */ kind?: 'standard' | 'compat'; + /** + * Skip installing dependencies after generating the library + */ + skipInstall?: boolean; }