Skip to content

ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update run-e2e-api-specs runs-on#29812

Merged
XxdpavelxX merged 35 commits into
mainfrom
namespace-runner-trial4
May 12, 2026
Merged

ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update run-e2e-api-specs runs-on#29812
XxdpavelxX merged 35 commits into
mainfrom
namespace-runner-trial4

Conversation

@XxdpavelxX
Copy link
Copy Markdown
Contributor

@XxdpavelxX XxdpavelxX commented May 6, 2026

Task: https://consensyssoftware.atlassian.net/browse/INFRA-3596

Description

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes CI runner selection and caching behavior across multiple iOS workflows; misconfiguration could break builds/uploads or reduce cache effectiveness, but no product/runtime code is affected.

Overview
Adds a runner_provider input (with workflow_dispatch choice) across iOS workflows to optionally run jobs on Namespace runners instead of GitHub/Cirrus defaults.

Routes runner_provider through build-and-upload-to-testflight into build.yml/upload-to-testflight, updates several jobs’ runs-on expressions (including fixture update and BrowserStack upload flows), and adjusts iOS E2E caching so Namespace runs use namespacelabs/nscloud-cache-action while skipping Cirrus Xcode derived-data cache steps.

Reviewed by Cursor Bugbot for commit 856c6c5. Bugbot is set up for automated code reviews on this repo. Configure here.

jluque0101 and others added 16 commits April 30, 2026 17:17
  Add metamask-ci-linux profile label, a placeholder for the canonical
  Namespace Linux label (to be replaced before the trial dispatch with
  runner_provider: namespace), and the common nscloud-ubuntu-* inline
  labels so Phase 2 can pick any of them without a follow-up config edit.

  Phase 0 of INFRA-3592. No workflow references these labels yet.
…-4 entry points

Adds the choice input current|namespace (default current) to the five
Phase 1-4 entry-point workflows. No runs-on or job behavior changes
yet — caller forwarding and runs-on ternary land in a follow-up commit.

Phase 0 of INFRA-3592.
…eusables

Adds the optional string input runner_provider (default current) to the
seven Phase 1-4 reusable workflows. Phase 7 reusables (runway-*, nightly,
testflight, etc.) are intentionally not modified — they continue to call
without forwarding, and the default keeps behavior byte-identical.

Phase 0 of INFRA-3592.
Adds with: runner_provider: ${{ inputs.runner_provider }} at every
in-scope caller site (55 sites across 7 caller workflows). Two iOS
build-ios-e2e.yml call sites had no with: block; a new minimal one
is added for them.

Phase 7 caller sites are intentionally not modified — push-eas-update,
nightly-build, runway-*, build-and-upload-to-testflight, build-rc-auto
continue to call without forwarding, the callee defaults to current,
and behavior is byte-identical.

Behavior is unchanged at this point: no runs-on consumes runner_provider
yet — that lands in I.3b.

Phase 0 of INFRA-3592.
Replaces every runs-on line in the in-scope Phase 1-4 workflows with the
additive ternary:

  runs-on: ${{ inputs.runner_provider == 'namespace' && 'nscloud-PLACEHOLDER-CONFIRM-LABEL' || <existing> }}

Where <existing> is the previous literal label or expression. Three sites
already had a ${{ ... }} platform ternary (build.yml setup-dependencies,
run-e2e-workflow.yml test-e2e-mobile, setup-node-modules.yml setup); for
those the existing expression is preserved verbatim inside the
runner_provider == 'namespace' || branch.

29 sites across 10 workflows. With runner_provider: current (the default
on every existing trigger), each ternary collapses to its prior literal
and behavior is byte-identical. The 'namespace' branch points at the
PLACEHOLDER label by design — replacement happens before any
runner_provider: namespace dispatch (see .phase0/namespace-artifacts.md).

Phase 0 of INFRA-3592.
…abels

Resolves Q1 of INFRA-3592 Phase 0. The four profile labels confirmed
live in the metamask Namespace workspace (format: namespace-profile-<name>):

  - namespace-profile-metamask-ci-linux       (Linux CI — Phase 1)
  - namespace-profile-metamask-android-build  (Android — Phase 3)
  - namespace-profile-metamask-ios-build      (iOS build / xl — Phase 4)
  - namespace-profile-metamask-ios-e2e        (iOS E2E test — Phase 4)

Each runs-on ternary now points at the profile that matches the existing
runner class (ubuntu-latest → ci-linux; macos-latest → ios-build; Cirrus
ubuntu-runner-amd64 → android-build; Cirrus macos-runner:tahoe-xl →
ios-build; Cirrus macos-runner:tahoe → ios-e2e). The three pre-existing
platform-driven dynamic expressions are preserved in both branches of
the ternary so Namespace dispatch follows the same iOS/Android branching
as the current runner choice.

actionlint.yaml drops the speculative nscloud-* and metamask-ci-linux
labels (never used) and registers the four canonical labels above.

Behavior on runner_provider: current is unchanged (every ternary still
collapses to its prior literal/expression).

Phase 0 of INFRA-3592.
@XxdpavelxX XxdpavelxX requested review from a team as code owners May 6, 2026 16:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 6, 2026
@metamaskbotv2 metamaskbotv2 Bot added the team-dev-ops DevOps team label May 6, 2026
@github-actions github-actions Bot added the size-S label May 6, 2026
Comment thread .github/workflows/build-ios-e2e.yml Outdated
XxdpavelxX and others added 3 commits May 6, 2026 17:01
Namespace runner profiles persist ~/Library/Developer/Xcode/DerivedData
at the infrastructure level between runs (independent of nscloud-cache-action).
Without clearing it, Xcode finds warm DerivedData, reports nothing to rebuild
in ~22s, and produces no .app output in ios/build — causing the permissions
fix step to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread .github/workflows/run-e2e-api-specs.yml Outdated
Base automatically changed from namespace-runner-trial to main May 7, 2026 11:29
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7405cc. Configure here.

Comment thread .github/workflows/build-ios-e2e.yml Outdated
Dropped accidentally during the merge of origin/main into namespace-runner-trial4
(merge commit e7405cc). When resolving the permissions-block conflict, main's
version (no permissions block) was chosen — but main only has workflow_call,
where permissions inherit from the caller.

Phase 4 added workflow_dispatch to this workflow so iOS builds can be manually
triggered for Namespace trial validation. Direct workflow_dispatch runs don't
inherit permissions from a caller, and setup-e2e-env now assumes an AWS role
via OIDC (introduced by main's #29247 "ci: reuse native E2E builds across
commits and PRs"), which requires id-token: write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two long explanatory comment blocks in the Namespace cache and cleanup steps
shrunk from ~16 lines to 6. Kept the load-bearing details (why cache scope
excludes ios/Pods, why the cleanup is necessary despite nscloud-cache-action)
and dropped the elaborate failure mode enumeration — the commit history of
Step 5 debugging covers that.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@XxdpavelxX XxdpavelxX changed the title INFRA-3596: phase4: add workflow_dispatch to build-ios-e2e, update ru… ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update ru… May 11, 2026
@XxdpavelxX XxdpavelxX changed the title ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update ru… ci(INFRA-3596): phase4: add workflow_dispatch to build-ios-e2e, update run-e2e-api-specs runs-on May 11, 2026
@bsuv
Copy link
Copy Markdown

bsuv commented May 11, 2026

Follow-up from the recent Namespace call: their nscloud-cache-action ships a built-in cocoapods preset (and 24 others) that may eliminate the /Volumes/cache/<path> symlink workaround on this PR.

Worth A/B-testing before merge:

- uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0  # v1.4.3
  with:
    cache: cocoapods

vs. the current explicit path: list. If the preset behaves cleanly, we'd be able to:

  1. Drop the custom path-mount entries for ios/Pods and ~/Library/Caches/CocoaPods.
  2. Remove the stale DerivedData/build/Pods clear step.
  3. Inherit whatever path coverage / ignore-glob tuning Namespace bakes into the preset upstream.

Reference: https://namespace.so/docs/reference/github-actions/nscloud-cache-action#cache. CocoaPods was specifically called out as "helpful right away" by the Namespace team.

A single dispatch with runner_provider=namespace against this branch should be enough to confirm. If the preset doesn't cover everything we need on this iOS path, the current explicit approach is the right fallback.

XxdpavelxX and others added 3 commits May 11, 2026 14:17
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nfig

A/B-tested per Bogdan's review comment on PR #29812:
- Test A (preset + clear step): run 25688771799 — passed in 24 min
- Test B (preset only, no clear step): run 25690563669 — passed in 21 min

Both passed with real build durations (not the ~22s false-success pattern from
the Step 5 debugging cycle), confirming the cocoapods preset is sufficient on
Namespace without an explicit DerivedData/ios/build/ios/Pods clear step.

Net change vs prior config:
- path: ~/.cocoapods → cache: cocoapods (preset)
- Drops the rm -rf clear step entirely

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@XxdpavelxX
Copy link
Copy Markdown
Contributor Author

XxdpavelxX commented May 11, 2026

@bsuv You're right. The preset is sufficient on its own, including without
the clear step. I tested with two A/B dispatches against the namespace-runner-trial4 branch:

- Test A (preset + clear step):    run 25688771799 — passed in 24 min                                                          
- Test B (preset only, no clear):  run 25690563669 — passed in 21 min                                                          

Both produced real builds, so the cocoapods preset
appears to handle whatever combination of path coverage and write-policy
prevents the stale-state failure modes. Adopted in commit f37c5cc.

Comment thread .github/workflows/build-ios-e2e.yml Outdated
name: Build iOS E2E Apps

on:
workflow_dispatch:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the reason for we need to add a dispatch?

Copy link
Copy Markdown
Contributor Author

@XxdpavelxX XxdpavelxX May 11, 2026

Choose a reason for hiding this comment

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

Fair point, added it for trial iteration speed during Phase 4 validation. It's useful during trial, not really needed once this lands. Removed

Aligns with Phase 3's Android equivalent (build-android-e2e.yml on main does
not have workflow_dispatch) per tommasini's PR review.

The workflow_dispatch trigger was added by Jose during Phase 0 trial-branch
setup so iOS workflows could be validated independently on Namespace. It was
useful during Phase 4 debugging (Step 5 cache-action iterations, Bogdan's
recent cocoapods preset A/B test), but those use cases were trial-phase
only — once Phase 4 lands, future Namespace validation goes through ci.yml's
workflow_dispatch entry point.

Also drops the dependent top-level permissions: block (only needed because
direct workflow_dispatch doesn't inherit permissions from a caller).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added size-S and removed size-M labels May 11, 2026
@XxdpavelxX XxdpavelxX requested a review from tommasini May 11, 2026 22:45
@XxdpavelxX XxdpavelxX removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 6 changed files are GitHub Actions workflow files with purely CI infrastructure changes. The changes add a runner_provider input parameter to multiple workflows, enabling an alternative Namespace CI runner provider alongside the existing runners. Key points:

  1. No app source code changes - no application logic, components, controllers, or test logic was modified
  2. Backward compatible - runner_provider defaults to current, preserving all existing behavior unchanged
  3. Additive only - new runner path added without modifying existing runner paths
  4. CI plumbing - changes affect where CI jobs run (runner selection), not what they test or how the app behaves
  5. Namespace-specific additions: CocoaPods cache action for Namespace runners, conditional Xcode cache skipping for Namespace runners

These workflow changes do not affect any E2E test functionality, app behavior, or test infrastructure logic. No E2E test tags are needed to validate these changes - they are validated by the CI system itself when the workflows execute.

Performance Test Selection:
No app source code, performance-sensitive components, or rendering logic was changed. These are purely CI workflow infrastructure changes affecting runner selection only. No performance impact on the app.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@XxdpavelxX XxdpavelxX self-assigned this May 12, 2026
Copy link
Copy Markdown
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@XxdpavelxX XxdpavelxX added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 6bc75ee May 12, 2026
106 of 107 checks passed
@XxdpavelxX XxdpavelxX deleted the namespace-runner-trial4 branch May 12, 2026 18:10
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-S team-dev-ops DevOps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants