Skip to content

ci(web-wallet): nightly non-gating E2E workflow (#177 item 2c) - #179

Open
raul-oliveira wants to merge 1 commit into
masterfrom
raul-oliveira/feat/web-wallet-e2e-followups-pr3
Open

ci(web-wallet): nightly non-gating E2E workflow (#177 item 2c)#179
raul-oliveira wants to merge 1 commit into
masterfrom
raul-oliveira/feat/web-wallet-e2e-followups-pr3

Conversation

@raul-oliveira

@raul-oliveira raul-oliveira commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Motivation

Nothing exercises the real-MetaMask web-wallet E2E suite in CI. main.yml runs on [push] and
only runs the lightweight smoke (playwright test --project=chromium), never
playwright.e2e.config.ts. So rot in the on-demand E2E infrastructure (e.g. a clean checkout no
longer being able to run the suite) goes unnoticed until someone runs it by hand.

This PR adds a scheduled, signal-only GitHub Actions workflow that runs the real-MetaMask-Flask
suite once a day (plus manual workflow_dispatch) purely to surface that rot. The suite is
explicitly non-gating: a scheduled workflow never attaches as a PR status check, so it is
inherently non-gating, and it must additionally not be added to branch protection / required
checks. It reuses the Nix toolchain from main.yml, boots a real headed Chromium under xvfb
(MV3 extension loading needs a real display), and uploads the Playwright HTML report + traces +
videos as artifacts for triage.

This is PR 3 of the #177 follow-up sequence and closes item 2c of that issue.

Acceptance Criteria

  • A new workflow .github/workflows/e2e-web-wallet-nightly.yml runs the real-MetaMask suite via playwright test --config playwright.e2e.config.ts.
  • It is triggered on a daily schedule (06:00 UTC) and on manual workflow_dispatch; it never runs per-PR.
  • It is intentionally non-gating and must not be added to branch protection or required checks.
  • It reuses main.yml's toolchain: the same pinned cachix/install-nix-action SHA and DeterminateSystems/magic-nix-cache-action@v7, and the same plain nix develop . -c yarn install invocation.
  • It builds the workspace dependency explicitly (yarn workspace @hathor/hathor-rpc-handler build) so it is self-sufficient regardless of the other PRs in the sequence.
  • It installs Playwright Chromium (playwright install chromium --with-deps) and the xvfb apt package, and runs the suite headed under xvfb-run -a.
  • It sets E2E_FLASK_VERSION: '13.31.0', E2E_TIMEOUT_SCALE: '2', and E2E_PASSWORD: ${{ vars.E2E_PASSWORD || 'Hathor@123' }}; no PIN env var is wired (the suite never consumes one).
  • It uploads the Playwright report and traces/videos as artifacts with if: always() so failures can be triaged.
  • packages/web-wallet/tests/e2e/e2e.md points at the nightly workflow as the CI signal.

Notes / caveats

  • Full green requires a real scheduled / workflow_dispatch run on GitHub. Local validation only
    proves the workflow is well-formed and its load-bearing steps resolve. Validated locally inside
    nix develop: the YAML parses clean under @action-validator/cli; yarn install, the
    @hathor/hathor-rpc-handler build, and playwright install chromium each succeed; and every
    uses: ref matches main.yml.
  • Funded journeys caveat: import, feature-example, and token-lifecycle use the committed
    public funded testnet stub seed and pass only while that testnet address holds balance. On a dry
    wallet they fail at their first funded step — acceptable for a non-gating signal run. If the team
    later wants an always-green signal, a follow-up can restrict the schedule to --project=onboarding
    (dry); the full matrix is kept here deliberately.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
  • Make sure either the unit tests and/or the QA tests are capable of testing the new features
  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

Summary by CodeRabbit

  • Tests

    • Added a scheduled daily and manually triggered end-to-end test run for the web wallet.
    • Test runs execute the real MetaMask flow and remain non-blocking.
    • Playwright reports, traces, and videos are retained for troubleshooting.
  • Documentation

    • Documented the nightly test workflow, validation steps, and artifact-based failure triage.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a daily and manually triggered, non-gating GitHub Actions workflow for the web-wallet real-MetaMask Playwright E2E suite. It provisions Nix and Chromium, runs headed tests under xvfb, always uploads reports and test artifacts, and documents the workflow.

Changes

Nightly web-wallet E2E CI

Layer / File(s) Summary
Workflow specification
docs/superpowers/specs/...
Documents the scheduled workflow design, environment variables, setup and execution steps, validation requirements, and non-gating constraints.
Nightly workflow execution
.github/workflows/e2e-web-wallet-nightly.yml
Adds daily and manual triggers, Nix and Playwright setup, RPC handler building, xvfb-based real-MetaMask tests, and unconditional report and trace/video uploads.
E2E workflow documentation
packages/web-wallet/tests/e2e/e2e.md
Links to the nightly workflow and describes artifact-based failure triage.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions as GitHub Actions
  participant Nix as Nix environment
  participant Xvfb as xvfb-run
  participant Playwright
  participant Artifacts as Uploaded artifacts
  GitHubActions->>Nix: Install dependencies and build RPC handler
  Nix->>Playwright: Install Chromium
  GitHubActions->>Xvfb: Start virtual display
  Xvfb->>Playwright: Run real-MetaMask E2E suite
  Playwright->>Artifacts: Produce report, traces, and videos
  GitHubActions->>Artifacts: Always upload outputs
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a nightly, non-gating web-wallet E2E workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch raul-oliveira/feat/web-wallet-e2e-followups-pr3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@raul-oliveira raul-oliveira moved this from Todo to In Progress (Done) in Hathor Network Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/e2e-web-wallet-nightly.yml:
- Around line 52-53: Update the “Install dependencies” step in the nightly
workflow to run Yarn with immutable lockfile enforcement, using the existing
yarn install command with the --immutable option. Preserve the current Nix
development-shell invocation while ensuring installation fails instead of
modifying or bypassing the committed lockfile.
- Around line 39-40: Update the actions/checkout@v4 step in the workflow to
disable credential persistence by setting persist-credentials to false, leaving
the checkout behavior and subsequent E2E steps unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fd2b7a28-c4a6-491d-b1b9-bd3e75031f09

📥 Commits

Reviewing files that changed from the base of the PR and between 2703be0 and 4b7aa10.

📒 Files selected for processing (3)
  • .github/workflows/e2e-web-wallet-nightly.yml
  • docs/superpowers/specs/2026-07-28-web-wallet-e2e-pr3-nightly-ci.md
  • packages/web-wallet/tests/e2e/e2e.md

Comment on lines +39 to +40
- name: Checkout code
uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow excerpt =="
sed -n '1,140p' .github/workflows/e2e-web-wallet-nightly.yml

echo
echo "== checkout usages and git refs/triggers/actions in workflow =="
rg -n "actions/checkout|persist-credentials|git (fetch|clone|clone|add|push|submodule|config|lfs|push|fetch)|github\.|GITHUB_TOKEN|permissions|pull_request|workflows|packages" .github/workflows/e2e-web-wallet-nightly.yml

Repository: HathorNetwork/hathor-rpc-lib

Length of output: 4289


🌐 Web query:

actions/checkout v4 persist-credentials default true README

💡 Result:

In the actions/checkout action, the persist-credentials input has a default value of true [1][2][3]. When set to true (the default), the action automatically configures the repository's local git configuration with the provided token or SSH key [1][3]. This allows subsequent git commands (such as git fetch or git push) run within the same job to be authenticated automatically [4][3]. This token is removed during the post-job cleanup process [4][3]. To opt out of this behavior, you can explicitly set persist-credentials to false in your workflow file: - uses: actions/checkout@v4 with: persist-credentials: false Note that in newer versions (v6.0.0 and later), the implementation of this feature was updated to store credentials in a file under $RUNNER_TEMP rather than directly in the local.git/config file, which improves security [3][5][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== exact checkout line and next lines =="
nl -ba .github/workflows/e2e-web-wallet-nightly.yml | sed -n '35,43p'

Repository: HathorNetwork/hathor-rpc-lib

Length of output: 247


🌐 Web query:

site:github.com/actions/checkout v4 persist-credentials default true README

💡 Result:

In the actions/checkout action, the persist-credentials input controls whether the authentication token (or SSH key) is configured in the local git repository's configuration [1][2]. As of the current version (v4), the default value for persist-credentials remains true [1][2]. When set to true, the action persists the credentials in the local git config, allowing subsequent steps in your workflow to execute authenticated git commands (e.g., git fetch, git push) [1][3]. These credentials are automatically removed during the post-job cleanup phase [1]. If you wish to opt out of this behavior for security reasons or because it is not required, you can explicitly set the input to false in your workflow YAML [1]: - name: Checkout uses: actions/checkout@v4 with: persist-credentials: false While there has been community discussion and proposed pull requests (such as PR #1687) to change this default to false to reduce the risk of credential exposure, the official action.yml and documentation for actions/checkout@v4 continue to list true as the default [1][2][4].

Citations:


Disable checkout credential persistence.

actions/checkout@v4 persists the read-only GITHUB_TOKEN in .git/config by default. This workflow’s remaining steps only install dependencies, build, install Playwright, and run/upload E2E artifacts, so authenticated Git commands are not needed.

Proposed fix
       - name: Checkout code
         uses: actions/checkout@v4
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.28.0)

[warning] 39-40: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/e2e-web-wallet-nightly.yml around lines 39 - 40, Update
the actions/checkout@v4 step in the workflow to disable credential persistence
by setting persist-credentials to false, leaving the checkout behavior and
subsequent E2E steps unchanged.

Source: Linters/SAST tools

Comment on lines +52 to +53
- name: Install dependencies
run: nix develop . -c yarn install

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files .github/workflows package.json yarn.lock | sed -n '1,120p'

echo
echo "== workflow context =="
if [ -f ".github/workflows/e2e-web-wallet-nightly.yml" ]; then
  nl -ba .github/workflows/e2e-web-wallet-nightly.yml | sed -n '45,95p'
fi

echo
echo "== main workflow searches =="
rg -n "yarn install|immutable|e2e-web-wallet-nightly|nix develop.*yarn install" .github/workflows || true

echo
echo "== root package scripts =="
if [ -f package.json ]; then nl -ba package.json | sed -n '1,140p'; fi

echo
echo "== package manager metadata =="
if [ -f .yarnrc.yml ]; then nl -ba .yarnrc.yml | sed -n '1,160p'; fi
if [ -f corepack/package.json ]; then nl -ba corepack/package.json | sed -n '1,120p'; fi

echo
echo "== deterministic config probe =="
python3 - <<'PY'
import json, pathlib, re
p=pl.Path('.github/workflows/e2e-web-wallet-nightly.yml')
if not p.exists():
    print("no nightly workflow")
else:
    text=p.read_text()
    for i,line in enumerate(text.splitlines(),1):
        if 'yarn install' in line:
            print(f"{i}: {line.strip()}")
PY

Repository: HathorNetwork/hathor-rpc-lib

Length of output: 427


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== read workflow file =="
awk '{printf "%4d\t%s\n", NR, $0}' .github/workflows/e2e-web-wallet-nightly.yml

echo
echo "== compare workflows for yarn installation =="
python3 - <<'PY'
import pathlib, re
for path in pathlib.Path(".github/workflows").glob("*.yml"):
    text = path.read_text()
    print(f"\n## {path}")
    for i, line in enumerate(text.splitlines(), 1):
        if "yarn install" in line or "immutable" in line or re.search(r"yarn\s+(install|set-version|enable-corepack)", line):
            print(f"{i}: {line}")
PY

echo
echo "== root package/config files =="
awk '{printf "%4d\t%s\n", NR, $0}' package.json
echo
if [ -f .yarnrc.yml ]; then awk '{printf "%4d\t%s\n", NR, $0}' .yarnrc.yml; else echo "no .yarnrc.yml"; fi

echo
echo "== lockfile first bytes =="
awk 'NR<=40 {printf "%4d\t%s\n", NR, $0}' yarn.lock

Repository: HathorNetwork/hathor-rpc-lib

Length of output: 7291


Enforce the workspace lockfile during dependency installation.

Yarn 4’s plain yarn install can update stale/missing entries from package.json while leaving the lockfile behind; this nightly job then runs from a different dependency graph than the committed lockfile. Use an immutable install, e.g. yarn install --immutable, or change the workflow spec if non-locked installs are intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/e2e-web-wallet-nightly.yml around lines 52 - 53, Update
the “Install dependencies” step in the nightly workflow to run Yarn with
immutable lockfile enforcement, using the existing yarn install command with the
--immutable option. Preserve the current Nix development-shell invocation while
ensuring installation fails instead of modifying or bypassing the committed
lockfile.

@raul-oliveira raul-oliveira moved this from In Progress (Done) to In Progress (WIP) in Hathor Network Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress (WIP)

Development

Successfully merging this pull request may close these issues.

1 participant