Skip to content

Commit 3e564e0

Browse files
chore(runway): cherry-pick test: upload Test Plan JSON file to artifacts (#29347)
- test: upload Test Plan JSON file to artifacts (#29337) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** Fix broken Test Plan JSON link by uploading as GitHub Actions artifact instead of gh-pages (which is blocked by branch protection). Changes - Replace gh-pages upload with actions/upload-artifact@v4 (unzipped) - Update PR comment to link to build workflow for artifact access <!-- 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? --> ## **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: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCRM-69 ## **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** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [ ] 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). - [ ] 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 - [ ] 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. #### 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](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] 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. [e741248](e741248) Co-authored-by: sleepytanya <104780023+sleepytanya@users.noreply.github.com>
1 parent 7f06615 commit 3e564e0

2 files changed

Lines changed: 10 additions & 42 deletions

File tree

.github/workflows/build-rc-auto.yml

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -164,46 +164,15 @@ jobs:
164164
E2E_OPENAI_API_KEY: ${{ secrets.E2E_OPENAI_API_KEY }}
165165
E2E_GEMINI_API_KEY: ${{ secrets.E2E_GEMINI_API_KEY }}
166166

167-
- name: Upload test plan JSON to GitHub Pages
167+
- name: Upload test plan JSON artifact
168168
if: always()
169-
continue-on-error: true
170-
run: |
171-
VERSION="${{ needs.validate-and-find-pr.outputs.semver }}"
172-
JSON_FILE="release-test-plan.json"
173-
174-
# Check if JSON file was generated
175-
if [ ! -f "$JSON_FILE" ]; then
176-
echo "No test plan JSON file found, skipping upload"
177-
exit 0
178-
fi
179-
180-
# Save JSON to temp
181-
cp "$JSON_FILE" "/tmp/test-plan-${VERSION}.json"
182-
183-
# Configure git
184-
git config user.name "github-actions[bot]"
185-
git config user.email "github-actions[bot]@users.noreply.github.com"
186-
187-
# Fetch gh-pages branch or create it
188-
git fetch origin gh-pages:gh-pages 2>/dev/null || echo "gh-pages doesn't exist yet"
189-
190-
# Switch to gh-pages
191-
if git checkout gh-pages 2>/dev/null; then
192-
echo "Switched to existing gh-pages branch"
193-
else
194-
git checkout --orphan gh-pages
195-
git rm -rf . 2>/dev/null || true
196-
git clean -fd 2>/dev/null || true
197-
fi
198-
199-
# Create test-plans directory and copy JSON
200-
mkdir -p test-plans
201-
cp "/tmp/test-plan-${VERSION}.json" "test-plans/"
202-
203-
# Commit and push
204-
git add test-plans/
205-
git commit -m "Add test plan JSON for RC ${VERSION}" || echo "No changes to commit"
206-
git push origin gh-pages
169+
uses: actions/upload-artifact@v4
170+
with:
171+
name: test-plan-${{ needs.validate-and-find-pr.outputs.semver }}
172+
path: release-test-plan.json
173+
compression-level: 0
174+
if-no-files-found: ignore
175+
retention-days: 90
207176

208177
slack-notification:
209178
name: Slack RC Notification

scripts/build-announce/test-plan-section.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,9 @@ export function buildTestPlanSection(testPlan: TestPlanResult): string {
199199
md += `---\n`;
200200
md += `*Generated by AI Test Plan Analyzer (${testPlan.model}) at ${testPlan.generatedAt}*\n\n`;
201201

202-
// JSON link for automation (version will be replaced by caller)
202+
// JSON link - artifact is uploaded separately and available in the Actions run
203203
if (testPlan.version) {
204-
const jsonUrl = `https://metamask.github.io/metamask-mobile/test-plans/test-plan-${testPlan.version}.json`;
205-
md += `AI generated test plan (JSON): [test-plan-${testPlan.version}.json](${jsonUrl})\n\n`;
204+
md += `AI generated test plan (JSON): Available as artifact \`test-plan-${testPlan.version}\` in the [build workflow](${process.env.BUILD_PIPELINE_URL || '#'})\n\n`;
206205
}
207206

208207
return md;

0 commit comments

Comments
 (0)