Commit dd2a1f5
authored
fix: Update smart E2E selection fallback when job fails (MetaMask#24460)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Fix Smart E2E Selection job failure blocking PR builds and tests by
adding a fallback
### Changes:
- Add `final-outputs` step with `if: always()` to guarantee outputs are
set even if AI analysis fails
- Use `|| echo` to prevent script failures from stopping the action
- Fix JSON quoting issue using `printf` to preserve `["ALL"]` format
- Improve user-facing PR comment when AI is unavailable
- Outputs `["ALL"]` with confidence `0` on failure, triggering all
applicable tests
### How it works:
1. AI analysis runs and sets outputs
2. If AI fails, the `final-outputs` step catches it and sets fallback
values
3. Downstream jobs receive guaranteed outputs and run tests accordingly
## **Related issues**
- Failing job:
https://github.com/MetaMask/metamask-mobile/actions/runs/20932157126/job/60146624935?pr=22076
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
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**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Strengthens the `smart-e2e-selection` action to avoid blocking builds
when AI analysis fails and to guarantee consumable outputs.
>
> - New `final-outputs` step (with `if: always()`) sets
`ai_e2e_test_tags` (fallback to `["ALL"]`) and passes through
`ai_confidence` when analysis fails
> - Wraps AI script with `|| echo` so failures don’t break the job;
initializes default outputs in `ai-analysis`
> - Updates outputs to read from `final-outputs` and always displays
them
> - PR comment logic: uses `pr_comment.md` if present; otherwise posts a
clear fallback message; preserves skip messaging
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c33e87b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7e7fe22 commit dd2a1f5
1 file changed
Lines changed: 23 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
137 | 150 | | |
| 151 | + | |
138 | 152 | | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
142 | | - | |
143 | | - | |
| 156 | + | |
| 157 | + | |
144 | 158 | | |
145 | 159 | | |
146 | 160 | | |
| |||
191 | 205 | | |
192 | 206 | | |
193 | 207 | | |
| 208 | + | |
| 209 | + | |
194 | 210 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 211 | + | |
202 | 212 | | |
203 | 213 | | |
204 | 214 | | |
| |||
0 commit comments