Skip to content

Conversation

christopherferreira9
Copy link
Contributor

@christopherferreira9 christopherferreira9 commented Sep 29, 2025

Description

The main goal for this PR is to remove the sh logic and move it into a new mjs file so that it gets easier to maintain.

Test runs:

No changes besides CI:

GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="false" \
IOS="false" \
SHARED="false" \
IGNORE_FILES=".github/scripts/compute-mobile-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/compute-mobile-builds.mjs .github/workflows/needs-e2e-build.yml" \
node .github/scripts/compute-mobile-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: 0cf6f66adcc10ba7561165a8f4494084decac26f
Ignoring - no mobile-impacting changes (pure ignore)

Skip-e2e label applied:

# Compute outputs using Node script
GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="false" \
IOS="false" \
SHARED="false" \
IGNORE_FILES=".github/scripts/compute-mobile-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/compute-mobile-builds.mjs .github/workflows/needs-e2e-build.yml" \
node .github/scripts/compute-mobile-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: 07de2e3dc98aeafa17278559d941f1c5ef304d1b
Ignoring - no mobile-impacting changes (pure ignore)

iOS Changes only:

# Compute outputs using Node script
GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="false" \
IOS="true" \
SHARED="false" \
IGNORE_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml ios/Podfile.lock" \
node .github/scripts/needs-e2e-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: f36acee62121e59f32ed820f96f01d0ba5c8159a
Building iOS only (mixed changes)

Common changes (package.json):

# Compute outputs using Node script
GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="false" \
IOS="false" \
SHARED="true" \
IGNORE_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml package.json yarn.lock" \
node .github/scripts/needs-e2e-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: de83095bc9a1d3d3442c64cfed44248ceaf0f61d
Building both platforms (shared files changes)

Android changes only:

# Compute outputs using Node script
GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="true" \
IOS="false" \
SHARED="false" \
IGNORE_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml android/settings.gradle" \
node .github/scripts/needs-e2e-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: a6091c54a7c1631e2f5752c98076aab338889778
Building Android only (mixed changes)

E2E spec files changes:

# Compute outputs using Node script
GITHUB_EVENT_NAME="pull_request" \
SHOULD_SKIP_E2E="false" \
ANDROID="false" \
IOS="false" \
SHARED="true" \
IGNORE_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml" \
CATCH_ALL_FILES=".github/scripts/needs-e2e-builds.mjs .github/workflows/needs-e2e-build.yml e2e/specs/settings/dummy.spec.ts" \
node .github/scripts/needs-e2e-builds.mjs
shell: /usr/bin/bash -e {0}
env:
  HEAD_COMMIT_HASH: dba7d3520e0cdfd665b3f1fe89b58a4b354243af
Building both platforms (shared files changes)

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

Move e2e build decision logic from bash in the workflow to a Node script and wire the workflow to use it.

  • CI:
    • New script: Add ./github/scripts/needs-e2e-builds.mjs to compute android_final, ios_final, builds, and changed_files based on env flags (ANDROID, IOS, SHARED, IGNORE_FILES, CATCH_ALL_FILES, SHOULD_SKIP_E2E, GITHUB_EVENT_NAME).
    • Workflow update: Replace inline bash state machine in ./github/workflows/needs-e2e-build.yml with Node script invocation; consolidate output writing (including safe multiline changed_files) and skip/schedule handling.
    • Decision logic: Handles shared vs platform-specific vs ignored changes and conservative fallback to build both when unclassified changes are present.

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

@christopherferreira9 christopherferreira9 marked this pull request as draft September 29, 2025 16:39
Copy link
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-qa QA team label Sep 29, 2025
cursor[bot]

This comment was marked as outdated.

@christopherferreira9 christopherferreira9 changed the title test: fixes the scheduled main smoke e2e runs test: refactors needs-builds step Sep 30, 2025
@christopherferreira9 christopherferreira9 added the skip-e2e skip E2E test jobs label Sep 30, 2025
@christopherferreira9 christopherferreira9 removed the skip-e2e skip E2E test jobs label Sep 30, 2025
@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Sep 30, 2025
@christopherferreira9 christopherferreira9 marked this pull request as ready for review September 30, 2025 10:44
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the CI workflow logic from inline bash shell scripting to a dedicated Node.js script for better maintainability and readability. The main purpose is to extract the complex state machine logic for determining mobile builds into a separate .mjs file.

  • Moves complex bash logic from workflow YAML to a dedicated Node.js script
  • Simplifies the workflow by replacing 90+ lines of shell code with a single script call
  • Maintains all existing functionality while improving code organization

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/needs-e2e-build.yml Replaces inline bash state machine with Node script call
.github/scripts/needs-e2e-builds.mjs New script implementing the mobile build decision logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 317d994 Oct 1, 2025
58 checks passed
@christopherferreira9 christopherferreira9 deleted the christopher/refactor-needs-build branch October 1, 2025 08:52
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
@metamaskbot metamaskbot added the release-7.57.0 Issue or pull request that will be included in release 7.57.0 label Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.57.0 Issue or pull request that will be included in release 7.57.0 size-M team-qa QA team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants