Skip to content

feat: gate E2E jobs on affected packages#8569

Open
hectormmg wants to merge 14 commits into
devfrom
feat/e2e-affected-package-gating
Open

feat: gate E2E jobs on affected packages#8569
hectormmg wants to merge 14 commits into
devfrom
feat/e2e-affected-package-gating

Conversation

@hectormmg
Copy link
Copy Markdown
Member

Adds a detect_changes job to 1p-e2e.yml and 3p-e2e.yml that diffs the PR branch against its target and gates each library's E2E jobs on whether that library or any of its dependencies changed. Non-PR/manual runs default all flags to true.

Dependency graph applied:

  • msal-browser tests run if: msal-common or msal-browser changed
  • msal-node tests run if: msal-common or msal-node changed
  • msal-react tests run if: msal-common, msal-browser, or msal-react changed
  • msal-angular tests run if: msal-common, msal-browser, or msal-angular changed
  • msal-browser-1p tests run if: msal-common, msal-browser, or msal-browser-1p changed

Sample directories are included in path detection alongside library source paths. Shared infra changes (samples/e2eTestUtils/, .pipelines/) cause all suites to run.

Requires companion 1P PR: https://identitydivision.visualstudio.com/IDDP/_git/msal-javascript-1p/pullrequest/23588

Known gap: msal-react-react18-e2e.yml does not yet accept a jobCondition parameter — React 18 jobs are not gated in this PR.

Copilot AI review requested due to automatic review settings April 27, 2026 22:14
@hectormmg hectormmg requested a review from a team as a code owner April 27, 2026 22:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds change-detection to the E2E pipelines so suites only run when their corresponding packages (or dependencies) are affected, reducing CI time while keeping full coverage for relevant changes.

Changes:

  • Introduces a detect_changes job in both 1P and 3P E2E pipelines that diffs PR branches against the target branch and sets output flags used to gate downstream E2E jobs.
  • Gates each library’s E2E job(s) using dependsOn + a jobCondition tied to the computed “affected” flags.
  • Adds a Puppeteer “prewarm” script intended to unpack/cache the browser binary before tests run.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.pipelines/scripts/prewarm-puppeteer.js Adds a CI helper script to launch/close Puppeteer to pre-unpack the browser binary.
.pipelines/3p-e2e.yml Adds detect_changes job and gates E2E suites; updates 1P template repo ref.
.pipelines/1p-e2e.yml Adds detect_changes for msal-browser-1p gating; updates 1P template repo ref.

Comment thread .pipelines/1p-e2e.yml Outdated
Comment thread .pipelines/1p-e2e.yml Outdated
Comment thread .pipelines/3p-e2e.yml Outdated
Comment thread .pipelines/3p-e2e.yml Outdated
Comment thread .pipelines/1p-e2e.yml Outdated
@hectormmg hectormmg force-pushed the feat/e2e-affected-package-gating branch 2 times, most recently from dd975af to 0729232 Compare April 28, 2026 00:49
hectormmg and others added 7 commits April 30, 2026 10:35
Add a detect_changes job to both 1p-e2e.yml and 3p-e2e.yml that diffs
the PR branch against its target and sets per-library output variables
(runMsalBrowser, runMsalNode, runMsalReact, runMsalAngular, runMsalBrowser1p).
The dependency graph is applied so downstream library tests also run when
an upstream library changes (e.g. msal-common change triggers msal-browser,
msal-node, msal-react, msal-angular, and msal-browser-1p tests).

Each e2e-tests template call now passes dependsOn: [detect_changes] and
a jobCondition referencing the appropriate output variable, so jobs are
skipped at runtime when their library is unaffected.

Non-PR builds (manual triggers, branch runs) default all flags to true
so no tests are skipped outside of PR context.

The 1p-e2e detect job checks both repos: the 3P repo for msal-common /
msal-browser changes and the 1P repo for msal-browser-1p changes.

Known gap: msal-react-react18-e2e.yml does not yet accept a jobCondition
parameter so React 18 jobs are not yet gated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous commit accidentally prepended a new gated block with
simplified/incorrect sample lists while leaving the original full-sample
block intact, resulting in duplicate job names. This fixes the file to
have a single set of jobs using the correct full sample lists with
detect_changes gating applied.

Also removes the msal-react-react18-e2e.yml@self reference (that
template does not exist in this repo); react18 is already covered by
react18-sample in the validate_msal_react job.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-infra gate

- Move inline PowerShell from 3p-e2e.yml into .pipelines/scripts/detect-changes-3p.ps1
- Move inline PowerShell from 1p-e2e.yml into .pipelines/scripts/detect-changes-1p.ps1
- Both scripts use only runtime ADO env vars, safe for file-based execution
- Add explicit path: 3p / path: 1p on checkout steps in 1p-e2e.yml so script
  can reference repos via PIPELINE_WORKSPACE/3p and /1p reliably
- Add shared-infra gate to detect-changes-1p.ps1: .pipelines/ changes in either
  repo now force run1p=true (was missing, addresses PR feedback)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
msal-browser-1p has the same dependency shape as msal-react/msal-angular
(wrapper over msal-browser). A single script handles all libraries with an
optional -Repo1pPath parameter for when the 1P repo is also checked out.

- 3p-e2e.yml: calls script with no args (Repo3pPath defaults to cwd)
- 1p-e2e.yml: passes explicit -Repo3pPath and -Repo1pPath

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Temporary — revert to ref: dev before merging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The script now accepts -EnableBrowser/Node/React/Angular params (baked in
by YAML compile-time expansion) and reports each suite's status clearly:

  msal-browser: skipped (disabled by parameter)
  msal-node:    skipped (no affected changes)
  msal-react:   will run
  ...

This makes manual runs with some suites disabled self-documenting in logs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hectormmg hectormmg force-pushed the feat/e2e-affected-package-gating branch from 800c131 to 39433ff Compare April 30, 2026 17:35
hectormmg and others added 7 commits April 30, 2026 14:17
…, and suite table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
msal-browser-1p tests are not part of 3p-e2e.yml — only 1p-e2e.yml.
Pass -Enable1p false so the suite decision table is accurate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Suites disabled by parameter (-EnableX false) don't exist in that
pipeline — no need to list them at all.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BrokerTestApp-React and PerformanceTelemetrySample both depend on
msal-react directly, so react changes should trigger 1P E2E tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
msal-react changes don't affect the msal-browser-1p auth layer.
The 1P E2E pipeline exists to catch 3P regressions in msal-common
and msal-browser, not msal-react UI changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Attention 👋 Awaiting response from the MSAL.js team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants