Skip to content

feat: enhance GHA to publish reports to GH pages#2552

Open
callMeTheQA wants to merge 7 commits intodevelopfrom
LF-17125-e2e-improve-reporting-on-github
Open

feat: enhance GHA to publish reports to GH pages#2552
callMeTheQA wants to merge 7 commits intodevelopfrom
LF-17125-e2e-improve-reporting-on-github

Conversation

@callMeTheQA
Copy link
Copy Markdown
Contributor

@callMeTheQA callMeTheQA commented Dec 22, 2025

Summary by CodeRabbit

  • New Features
    • HTML Playwright test reports are automatically published to GitHub Pages.
    • Workflow summaries now include a "View Report" link to the deployed HTML report.
    • Pull request comments include the report link when available; a clear fallback message is shown until deployment completes.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
jumper-exchange Ready Ready Preview, Comment Jan 27, 2026 10:46am
jumper-exchange-storybook Canceled Canceled Jan 27, 2026 10:46am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 22, 2025

Walkthrough

Adds a publish-report GitHub Actions job that downloads Playwright HTML artifacts, deploys them to GitHub Pages, exposes a page_url output, grants pages and id-token Write permissions, and makes post-comment depend on publish-report to conditionally include the deployed report link.

Changes

Cohort / File(s) Summary
GitHub Actions workflow
./.github/workflows/playwright.yml
Adds a publish-report job that downloads HTML report artifacts, determines destination (PR number or run_id), prepares and deploys content to GitHub Pages, sets a page_url output, grants pages and id-token Write permissions, and updates post-comment to depend on publish-report and conditionally include a "View HTML Test Report" link.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant WF as GitHub Actions Workflow
  participant Runner as Actions Runner
  participant Artifacts as Job Artifacts
  participant Pages as GitHub Pages
  participant PR as Post-comment Job

  WF->>Runner: run test jobs (produce HTML artifact)
  Runner->>Artifacts: upload HTML report artifact
  WF->>Runner: run publish-report job (needs: merge-reports)
  Runner->>Artifacts: download HTML report artifact
  Runner->>Pages: configure & deploy report (uses pages/id-token perms)
  Pages-->>WF: return deployed page URL (page_url)
  WF->>PR: run post-comment job (needs: publish-report)
  PR->>WF: post PR comment including conditional link to page_url
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through logs and gathered the light,

Packed tiny reports for a Pages-bound flight,
A shining link now greets each PR's sight,
Tests tucked in pages, cozy and bright.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding functionality to publish Playwright reports to GitHub Pages within the GitHub Actions workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 22, 2025

✅ All snapshot tests passed

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/playwright.yml (1)

194-195: Consider improving the fallback message clarity.

The fallback message "HTML Test Report will be available after deployment" may be misleading since at this point in the workflow, the publish-report job has already completed (successfully or not). If deployment failed, users would see this message indefinitely.

Consider a more accurate fallback:

🔎 Suggested improvement
-            ${{ needs.publish-report.outputs.page_url != '' && needs.publish-report.outputs.page_url != null && format('📊 [View HTML Test Report]({0})', needs.publish-report.outputs.page_url) || '📊 HTML Test Report will be available after deployment' }}
+            ${{ needs.publish-report.outputs.page_url != '' && needs.publish-report.outputs.page_url != null && format('📊 [View HTML Test Report]({0})', needs.publish-report.outputs.page_url) || '📊 HTML Test Report deployment was skipped or failed' }}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bfff16 and 55dc5b2.

📒 Files selected for processing (1)
  • .github/workflows/playwright.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test (5 / 6)
  • GitHub Check: Test (1 / 6)
  • GitHub Check: Test (2 / 6)
  • GitHub Check: Test (6 / 6)
  • GitHub Check: Test (4 / 6)
  • GitHub Check: Test (3 / 6)
🔇 Additional comments (2)
.github/workflows/playwright.yml (2)

9-10: LGTM!

The added permissions are correctly required for GitHub Pages deployment. pages: write enables the deployment, and id-token: write is needed for OIDC authentication with the Pages environment.


184-184: LGTM!

Adding publish-report to the needs array ensures the comment includes the deployed report URL. Combined with !cancelled(), the comment will still be posted even if the Pages deployment fails.

Comment thread .github/workflows/playwright.yml
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 22, 2025

Playwright test results

failed  1 failed
passed  40 passed
flaky  1 flaky
skipped  8 skipped

Details

stats  50 tests across 10 suites
duration  6 minutes, 1 second
commit  83035db

Failed tests

chromium › portfolioPage.spec.ts › Portfolio page › Verify elements and filters on portfolio page › verify portfolio page elements and filters on Tokens and DeFi Protocols tabs (Qase ID: 53)

Flaky tests

chromium › landingPage.spec.ts › Landing page and navigation › Should navigate to the homepage and change tabs (Qase ID: 2)

Skipped tests

chromium › swapActions.spec.ts › On chain swaps [Viewport: Mobile] › ETH chain swap pair (Qase ID: 23)
chromium › swapActions.spec.ts › On chain swaps [Viewport: Mobile] › ARB chain swap pairs (Qase ID: 24)
chromium › swapActions.spec.ts › On chain swaps [Viewport: Mobile] › Hyperliquid chain swap pairs (Qase ID: 25)
chromium › swapActions.spec.ts › On chain swaps [Viewport: Desktop] › ETH chain swap pair (Qase ID: 26)
chromium › swapActions.spec.ts › On chain swaps [Viewport: Desktop] › ARB chain swap pairs (Qase ID: 27)
chromium › swapActions.spec.ts › On chain swaps [Viewport: Desktop] › Hyperliquid chain swap pairs (Qase ID: 28)
chromium › themeManipulation.spec.ts › Switch between dark and light theme and check the background color › Should able to change the theme color to Dark (Qase ID: 30)
chromium › themeManipulation.spec.ts › Switch between dark and light theme and check the background color › Should able to change the theme color to Light (Qase ID: 31)

📋 View Detailed Qase Report

📊 Download HTML Test Report - Available in the workflow artifacts

Comment thread .github/workflows/playwright.yml Outdated
echo "Report will be published to: $DEST_DIR"
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
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.

For actions that are not github's, it's recommended to pin those to the full length sha
ref: https://docs.github.com/en/actions/reference/security/secure-use#:~:text=Pin%20actions%20to%20a%20full%2Dlength%20commit%20SHA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also would prefer to use actions/configure-pages@v5 and actions/upload-pages-artifact@v3 as peaceiris/actions-gh-pages seems unmaintained since 1y+

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/playwright.yml (1)

226-238: Fallback message is misleading.

The message "HTML Test Report will be available after deployment" is shown when page_url is empty/null, but at this point the publish-report job has already completed (it's in the needs array). If the URL is missing, it means deployment failed, not that it's pending.

🔧 Suggested fix
-            ${{ needs.publish-report.outputs.page_url != '' && needs.publish-report.outputs.page_url != null && format('📊 [View HTML Test Report]({0})', needs.publish-report.outputs.page_url) || '📊 HTML Test Report will be available after deployment' }}
+            ${{ needs.publish-report.outputs.page_url != '' && needs.publish-report.outputs.page_url != null && format('📊 [View HTML Test Report]({0})', needs.publish-report.outputs.page_url) || '📊 HTML Test Report deployment failed or unavailable' }}
🤖 Fix all issues with AI agents
In @.github/workflows/playwright.yml:
- Around line 210-224: The step named "Add report link to summary" currently
uses if: always(), which can add a broken Pages link when the "Deploy to GitHub
Pages" step fails; change the condition to only run after a successful
deployment (e.g., use if: success() or guard with the specific step/job outcome)
so the PAGES_URL echoing logic only executes when the deploy step (named "Deploy
to GitHub Pages") succeeded and the REPORT_PATH/GITHUB_PAGES URL is valid; keep
the REPORT_PATH and PAGES_URL construction but gate the step on deploy success.
🧹 Nitpick comments (3)
.github/workflows/playwright.yml (3)

174-183: Consider DRY: report path logic is repeated three times.

The same conditional logic for determining DEST_DIR/REPORT_PATH appears at lines 177-181, 200-204, and 213-217. Since the value is already computed and stored in steps.report-dest.outputs.destination, reuse it in subsequent steps.

♻️ Suggested refactor for lines 200-204
       - name: Set page URL
         id: set-url
         run: |
-          if [ "${{ github.event_name }}" = "pull_request" ]; then
-            REPORT_PATH="${{ github.event.pull_request.number }}"
-          else
-            REPORT_PATH="${{ github.run_id }}"
-          fi
+          REPORT_PATH="${{ steps.report-dest.outputs.destination }}"
           # Extract repo name from github.repository (format: owner/repo)
           REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
           PAGE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${REPORT_PATH}/"

Apply the same pattern to lines 213-217.


197-209: URL construction could use deployment output.

The actions/deploy-pages action already outputs page_url at steps.deployment.outputs.page_url. You could simplify the URL construction:

♻️ Suggested simplification
       - name: Set page URL
         id: set-url
         run: |
-          if [ "${{ github.event_name }}" = "pull_request" ]; then
-            REPORT_PATH="${{ github.event.pull_request.number }}"
-          else
-            REPORT_PATH="${{ github.run_id }}"
-          fi
-          # Extract repo name from github.repository (format: owner/repo)
-          REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
-          PAGE_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${REPORT_PATH}/"
+          REPORT_PATH="${{ steps.report-dest.outputs.destination }}"
+          BASE_URL="${{ steps.deployment.outputs.page_url }}"
+          PAGE_URL="${BASE_URL}${REPORT_PATH}/"
           echo "page_url=$PAGE_URL" >> "$GITHUB_OUTPUT"
           echo "Report URL: $PAGE_URL"

184-196: GitHub Pages deployment replaces all site content each time.

The actions/deploy-pages@v4 action deplaces the artifact you upload and replaces the entire GitHub Pages site with it. This is expected behavior—previous reports are overwritten with each deployment.

If you need to preserve historical reports, consider:

  • Deploying to a branch with incremental commits instead of artifact-based deployments
  • Using external storage (e.g., artifact links, cloud bucket) for report history
  • Fetching existing Pages content and merging with new reports before deployment

Note: If multiple workflow runs execute concurrently, there is a potential race condition where deployments could overwrite each other's reports. Consider adding concurrency controls if this is a concern.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3899c43 and 759a0be.

📒 Files selected for processing (1)
  • .github/workflows/playwright.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test (1 / 6)
  • GitHub Check: Test (6 / 6)
  • GitHub Check: Test (4 / 6)
  • GitHub Check: Test (3 / 6)
  • GitHub Check: Test (5 / 6)
  • GitHub Check: Test (2 / 6)
🔇 Additional comments (2)
.github/workflows/playwright.yml (2)

9-10: Permissions look correct for GitHub Pages deployment.

The pages: write and id-token: write permissions are required for the actions/deploy-pages action to work with OIDC authentication. These are appropriately scoped for the new functionality.


158-173: Job configuration looks good.

The job is appropriately gated with !cancelled() to publish reports even when tests fail, and the environment configuration for GitHub Pages is correct.

Comment on lines +210 to +224
- name: Add report link to summary
if: always()
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
REPORT_PATH="${{ github.event.pull_request.number }}"
else
REPORT_PATH="${{ github.run_id }}"
fi
# Extract repo name from github.repository (format: owner/repo)
REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
PAGES_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${REPORT_PATH}/"
echo "## 📊 Playwright Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "🔗 **[View Report](${PAGES_URL})**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
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.

⚠️ Potential issue | 🟡 Minor

always() may add broken links if deployment fails.

Using if: always() means this step runs even when Deploy to GitHub Pages fails, potentially adding a broken link to the summary. Consider conditioning on deployment success:

🔧 Suggested fix
       - name: Add report link to summary
-        if: always()
+        if: ${{ steps.deployment.outcome == 'success' }}
         run: |
📝 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: Add report link to summary
if: always()
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
REPORT_PATH="${{ github.event.pull_request.number }}"
else
REPORT_PATH="${{ github.run_id }}"
fi
# Extract repo name from github.repository (format: owner/repo)
REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
PAGES_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${REPORT_PATH}/"
echo "## 📊 Playwright Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "🔗 **[View Report](${PAGES_URL})**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Add report link to summary
if: ${{ steps.deployment.outcome == 'success' }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
REPORT_PATH="${{ github.event.pull_request.number }}"
else
REPORT_PATH="${{ github.run_id }}"
fi
# Extract repo name from github.repository (format: owner/repo)
REPO_NAME=$(echo "${{ github.repository }}" | cut -d'/' -f2)
PAGES_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${REPORT_PATH}/"
echo "## 📊 Playwright Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "🔗 **[View Report](${PAGES_URL})**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
🤖 Prompt for AI Agents
In @.github/workflows/playwright.yml around lines 210 - 224, The step named "Add
report link to summary" currently uses if: always(), which can add a broken
Pages link when the "Deploy to GitHub Pages" step fails; change the condition to
only run after a successful deployment (e.g., use if: success() or guard with
the specific step/job outcome) so the PAGES_URL echoing logic only executes when
the deploy step (named "Deploy to GitHub Pages") succeeded and the
REPORT_PATH/GITHUB_PAGES URL is valid; keep the REPORT_PATH and PAGES_URL
construction but gate the step on deploy success.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/playwright.yml:
- Around line 222-224: The post-comment job is being skipped on PRs because it
lists publish-report in its needs but publish-report is intentionally gated to
non‑PR events and thus skipped; update the post-comment job (post-comment) to
remove publish-report from its needs array (keep create-qase-run and
merge-reports) so post-comment can run on PRs, or alternatively change
publish-report's gating if post-comment must depend on it.
🧹 Nitpick comments (1)
.github/workflows/playwright.yml (1)

5-10: Scope Pages permissions to the publish-report job.

pages and id-token are only needed for deployment; keeping them at workflow scope widens privileges unnecessarily.

♻️ Suggested refactor
 permissions:
   checks: write
   pull-requests: write
   contents: write
-  pages: write
-  id-token: write

  publish-report:
+   permissions:
+     pages: write
+     id-token: write
    if: ${{ !cancelled() && github.event_name != 'pull_request' }}

Also applies to: 158-167

Comment on lines 222 to 224
post-comment:
needs: [create-qase-run, merge-reports]
needs: [create-qase-run, merge-reports, publish-report]
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
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.

⚠️ Potential issue | 🟠 Major

Post-comment will be skipped on PRs due to skipped dependency.

publish-report is gated to non‑PR events, but post-comment needs it. On PRs, publish-report is skipped and GitHub Actions will skip post-comment, so no PR comment is posted.

🔧 Suggested fix (remove unnecessary dependency)
  post-comment:
-   needs: [create-qase-run, merge-reports, publish-report]
+   needs: [create-qase-run, merge-reports]
    if: ${{ !cancelled() && github.event_name == 'pull_request' }}
📝 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
post-comment:
needs: [create-qase-run, merge-reports]
needs: [create-qase-run, merge-reports, publish-report]
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
post-comment:
needs: [create-qase-run, merge-reports]
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
🤖 Prompt for AI Agents
In @.github/workflows/playwright.yml around lines 222 - 224, The post-comment
job is being skipped on PRs because it lists publish-report in its needs but
publish-report is intentionally gated to non‑PR events and thus skipped; update
the post-comment job (post-comment) to remove publish-report from its needs
array (keep create-qase-run and merge-reports) so post-comment can run on PRs,
or alternatively change publish-report's gating if post-comment must depend on
it.

@oktapodia
Copy link
Copy Markdown
Member

@callMeTheQA what is the state of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants