Skip to content

test: add automated build environment display to RC and production builds.#29390

Merged
sleepytanya merged 9 commits into
mainfrom
feat/automated-env-validation
Apr 30, 2026
Merged

test: add automated build environment display to RC and production builds.#29390
sleepytanya merged 9 commits into
mainfrom
feat/automated-env-validation

Conversation

@sleepytanya

@sleepytanya sleepytanya commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds automated build environment display to RC and production builds. Captures actual environment values used during builds (METAMASK_ENVIRONMENT, METAMASK_BUILD_TYPE, API URLs, etc.) and displays them:

  • RC builds: In PR comment alongside build links
  • Prod builds: Extracted via new workflow (Slack notification in follow-up PR).

Changes:

  • scripts/apply-build-config.js: Add --write-build-env flag to generate build-env.json with actual env values
  • build.yml: Generate and upload build-env.json as artifact during builds (used by both RC and
    prod)
  • build-rc-auto.yml: Download build-env artifacts in post-rc-build-comment job
  • scripts/build-announce/: Add env section to RC build PR comments
  • prod-build-env-notify.yml: New workflow triggered on prod build completion, extracts env values (Slack posting in follow-up PR)

Changelog

CHANGELOG entry: null

Related issues

Fixes:
https://consensyssoftware.atlassian.net/browse/MMQA-1108

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 build workflows and the RC PR-comment pipeline to generate, upload, download, and parse a new build-env.json artifact; misconfiguration could break build jobs or PR comment posting. Risk is limited to CI/reporting paths and is largely non-blocking (continue-on-error/|| true) but still touches release build automation.

Overview
Adds generation of a build-env.json file during CI builds (via scripts/apply-build-config.js --write-build-env) and uploads it as a build artifact for each platform.

Updates RC automation to download these artifacts and extends scripts/build-announce to parse them and include a Build Environment section (env/build type, remote FF mapping, key API URLs/flags) in the RC PR comment, with a fallback “not available” section on extraction failure.

Introduces a new Prod Build Env Notify workflow that triggers on successful production workflow runs, downloads the build-env artifact, extracts key values with jq, and currently prints a placeholder for a future Slack notification; also ignores local build-env.json via .gitignore.

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

@sleepytanya sleepytanya requested a review from a team as a code owner April 28, 2026 04:39
@sleepytanya sleepytanya added No QA Needed Apply this label when your PR does not need any QA effort. team-qa QA team release-7.75.0 Issue or pull request that will be included in release 7.75.0 labels Apr 28, 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.

Comment thread scripts/build-announce/index.ts
Comment thread scripts/build-announce/env-validation-section.ts
Comment thread .github/workflows/prod-build-env-notify.yml Outdated

@cursor cursor Bot 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.

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 2b8119e. Configure here.

Comment thread .github/workflows/build.yml Outdated
@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: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 9 changed files are exclusively CI/build infrastructure and scripting changes with zero impact on app source code or test infrastructure:

  1. GitHub Workflows (build.yml, build-rc-auto.yml, prod-build-env-notify.yml): Changes add build environment artifact generation/upload/download steps and a new notification workflow. All new steps have error-tolerant fallbacks (continue-on-error: true, || true). No changes to existing build steps, test execution, or app compilation logic.

  2. scripts/apply-build-config.js: Adds a new --write-build-env CLI mode that writes build environment values to build-env.json. Existing --export and --export-github-env modes are completely unchanged. No impact on how the app is built or configured.

  3. scripts/build-announce/: New TypeScript files for displaying build environment info in RC PR comments. This is purely a developer tooling/notification feature with no connection to app functionality or E2E tests.

  4. .gitignore: Adds build-env.json to gitignore - trivial change.

None of these changes affect:

  • Any React Native app components or screens
  • Any controllers, reducers, or state management
  • Any navigation or routing logic
  • Any E2E test infrastructure (tests/, page-objects/, fixtures/, .detoxrc.js)
  • Any app build configuration that would change app behavior

Running E2E tests would provide zero validation value for these changes. No performance tests are needed either as no performance-sensitive code paths are touched.

Performance Test Selection:
No performance-sensitive code changes. All changes are CI/build tooling scripts and workflow files that have no impact on app rendering, data loading, state management, or any user-facing performance characteristics.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@sleepytanya sleepytanya enabled auto-merge April 28, 2026 16:21
@sleepytanya sleepytanya added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 862bf76 Apr 30, 2026
63 of 64 checks passed
@sleepytanya sleepytanya deleted the feat/automated-env-validation branch April 30, 2026 20:25
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.75.0 Issue or pull request that will be included in release 7.75.0 release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants