feat: gate E2E jobs on affected packages#8569
Open
hectormmg wants to merge 14 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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_changesjob 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+ ajobConditiontied 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. |
dd975af to
0729232
Compare
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>
800c131 to
39433ff
Compare
…, 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>
Contributor
|
Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
detect_changesjob to1p-e2e.ymland3p-e2e.ymlthat 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 totrue.Dependency graph applied:
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.ymldoes not yet accept ajobConditionparameter — React 18 jobs are not gated in this PR.