Skip to content

chore: new environment variable to builds with gh actions#26668

Merged
tommasini merged 1 commit into
mainfrom
chore/env-variable-build-gh-actions
Feb 27, 2026
Merged

chore: new environment variable to builds with gh actions#26668
tommasini merged 1 commit into
mainfrom
chore/env-variable-build-gh-actions

Conversation

@tommasini

@tommasini tommasini commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Description

OTA was broken with old environment variables check. This PR aims to solve that by introdocing a new environment variable.

Changelog

CHANGELOG entry:

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

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 how several services choose API endpoints/environments by switching from GITHUB_ACTIONS/E2E checks to a new BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY flag, which could route builds to different backend environments if misconfigured.

Overview
Introduces a new build-time env flag, BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY, and uses it to decide when to take build-provided URLs/environments (from builds.yml) versus deriving them from METAMASK_ENVIRONMENT.

Updates Baanx Card URL mapping, ramps SDK environment selection (Aggregator + Deposit), ramps controller init, and rewards API URL override logic to key off this flag, and refreshes/adjusts tests accordingly (including removing the previous special-casing tied to E2E).

Written by Cursor Bugbot for commit 4249918. This will update automatically on new commits. Configure here.

@tommasini tommasini requested review from a team as code owners February 26, 2026 23:11
@tommasini tommasini added skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. no changelog required No changelog entry is required for this change labels Feb 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Feb 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
This PR refactors environment variable detection for GitHub Actions builds by introducing a new BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY flag and replacing the previous GITHUB_ACTIONS === 'true' && E2E !== 'true' condition with just BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY === 'true'.

The changes affect:

  1. Ramps Controller (ramps-service-init.ts) - determines which Ramps environment (Production/Staging) to use
  2. Rewards Controller (rewards-api-url.ts) - determines which Rewards API URL to use
  3. Card/Baanx (mapBaanxApiUrl.ts) - determines which Baanx API URL to use
  4. Ramp Aggregator SDK (getSdkEnvironment.ts) - determines SDK environment
  5. Ramp Deposit SDK (getSdkEnvironment.ts) - determines SDK environment

All changes are:

  • Environment variable condition refactoring (no logic changes)
  • Test file updates to use the new environment variable
  • Adding the new flag to builds.yml

For E2E tests, when BUILDS_ENABLED_WITH_GH_ACTIONS_TEMPORARY is not set (typical E2E environment), the code falls back to the METAMASK_ENVIRONMENT switch, so E2E tests should continue to work correctly.

Selected SmokeRamps and SmokeCard as these are the primary user-facing features affected by the environment detection changes. The rewards functionality doesn't have a dedicated E2E tag, and the changes there are minimal.

Performance Test Selection:
These changes are purely build configuration and environment variable refactoring. They do not affect UI rendering, data loading, state management, or any runtime performance characteristics. The changes only affect which API endpoints are selected at build time, not how the app performs at runtime.

View GitHub Actions results

@tommasini tommasini added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Feb 26, 2026

@Cal-L Cal-L left a comment

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.

Lgtm

@tommasini tommasini added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 78ecb3d Feb 27, 2026
118 of 124 checks passed
@tommasini tommasini deleted the chore/env-variable-build-gh-actions branch February 27, 2026 00:32
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 27, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.69.0 Issue or pull request that will be included in release 7.69.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants