Commit 0b33167
ci(INFRA-3631): Phase 5d — Shadow CI benchmark workflow for Namespace evaluation (#30158)
## **Description**
INFRA-3631 Phase 5d — Adds a shadow CI workflow that runs the full CI
pipeline on Namespace runners via `workflow_dispatch`, enabling
side-by-side performance and reliability comparison with the current
Cirrus/GitHub runner path.
**Changes:**
### Shadow CI Workflow
- **`ci-namespace-shadow.yml`**: Calls `ci.yml` with `runner_provider:
namespace` via `workflow_call`. Automatic triggers (PR, push, hourly
cron) are commented out for initial validation — only
`workflow_dispatch` is active. Ready to enable after review.
- **`ci.yml`**: Added `workflow_call:` trigger with `runner_provider`
input (string, default `current`). The 44 existing
`inputs.runner_provider` references already handle undefined gracefully,
so this is backward-compatible.
### Benchmark Script
- **`scripts/namespace-benchmark.sh`**: Collects per-job p50/p95
wall-clock durations comparing `ci.yml` vs `ci-namespace-shadow.yml`
runs over a configurable time window.
### Rollback Safety
- All Namespace-specific logic gated on `inputs.runner_provider ==
'namespace'`
- Shadow workflow concurrency group uses caller's workflow name, so it
never cancels normal CI runs
- `runner_provider=current` path unchanged and validated
### Includes Phase 5 (INFRA-3597) cache architecture
This branch is based on `phase5/cache-and-artifacts` (PR #29886) rebased
on latest `main`, so it includes the full cache and artifact
architecture work. The shadow-specific changes are in the last commit.
## **Validation Runs**
| Run | Provider | Result |
|-----|----------|--------|
|
[25826373445](https://github.com/MetaMask/metamask-mobile/actions/runs/25826373445)
| namespace | 81 success, Android 27/27 E2E pass, iOS build pass, 2 iOS
E2E flakes (pre-existing) |
|
[25828982183](https://github.com/MetaMask/metamask-mobile/actions/runs/25828982183)
| current | Rollback validation (in progress) |
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: INFRA-3631 (parent epic INFRA-3511)
## **Manual testing steps**
```gherkin
Feature: INFRA-3631 Shadow CI benchmark workflow
Scenario: Current runner path is unchanged
Given ci.yml runs with runner_provider current (or default)
When all jobs execute
Then the same runner selection and caching behavior runs as before
And no shadow or namespace-specific logic is triggered
Scenario: Namespace runner path works via workflow_call
Given ci.yml is called with runner_provider namespace (via workflow_dispatch or workflow_call)
When all jobs execute
Then Namespace runner profiles are selected for all jobs
And nscloud-cache-action is used for caching
And all Android E2E shards pass
Scenario: Shadow workflow calls ci.yml correctly
Given ci-namespace-shadow.yml is dispatched (requires merge to main)
When the shadow-ci job invokes ci.yml with runner_provider namespace
Then the full CI pipeline runs on Namespace runners
And the shadow run does not cancel or interfere with normal CI runs
Scenario: Benchmark script produces comparison data
Given at least one successful ci.yml and ci-namespace-shadow.yml run exist
When scripts/namespace-benchmark.sh is executed
Then per-job p50 and p95 durations are printed for both workflows
```
## **Screenshots/Recordings**
N/A — CI infrastructure PR.
## **Pre-merge author checklist**
- [x] I've followed MetaMask Contributor Docs and Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using JSDoc format if applicable
- [x] I've applied the right labels on the PR
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR
- [ ] I confirm that this PR addresses all acceptance criteria
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches GitHub Actions orchestration by introducing a new
scheduled/PR-triggered shadow workflow and making `ci.yml` reusable via
`workflow_call`, which could affect CI load or execution paths if
misconfigured, though it remains advisory and defaults preserve existing
behavior.
>
> **Overview**
> Adds a new **advisory** GitHub Actions workflow,
`ci-namespace-shadow.yml`, that runs the full CI pipeline by calling
`ci.yml` with `runner_provider: namespace` (including PR/push/hourly
schedule triggers) to benchmark Namespace runners without gating merges.
>
> Updates `ci.yml` to support `workflow_call` with a `runner_provider`
input (defaulting to `current`) so it can be invoked by the shadow
workflow, and adds `scripts/namespace-benchmark.sh` to compute per-job
p50/p95 wall-clock times across `ci.yml` vs `ci-namespace-shadow.yml`
runs. Also documents `[shadow]` CI jobs in `CONTRIBUTING.md`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0a3a5cc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Borislav Grigorov <11405770+bsgrigorov@users.noreply.github.com>1 parent afc5b0e commit 0b33167
4 files changed
Lines changed: 93 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments