Skip to content

Comments

Fix not reporting test results on push to main#921

Merged
eliykat merged 2 commits intomainfrom
report-test-results
Nov 17, 2025
Merged

Fix not reporting test results on push to main#921
eliykat merged 2 commits intomainfrom
report-test-results

Conversation

@eliykat
Copy link
Member

@eliykat eliykat commented Nov 15, 2025

🎟️ Tracking

N/A

📔 Objective

Test results are only uploaded to Github if github.event.pull_request.head.repo.full_name == github.repository. The intention of that conditional is to skip PRs from forks. However, when this triggers for other events (push and workflow_dispatch in this case), github.event.pull_request is undefined and the job is incorrectly skipped.

This adds an explicit allowlist of other events that may trigger this job. As discussed on Slack, they do not pose the same concerns about permissions as you generally need write permissions in the repo to trigger them.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@eliykat eliykat requested a review from a team as a code owner November 15, 2025 04:19
@eliykat eliykat requested a review from JimmyVo16 November 15, 2025 04:19
@claude
Copy link

claude bot commented Nov 15, 2025

Claude finished @eliykat's task —— View job


Code Review Complete

  • Read changed workflow files
  • Evaluate PR title and description
  • Review technical implementation
  • Check for issues and improvements
  • Post final review

Summary of Changes

This PR fixes a bug where test results were not being uploaded for push and workflow_dispatch events. The original condition github.event.pull_request.head.repo.full_name == github.repository evaluates to false for non-PR events because github.event.pull_request is undefined, preventing test result uploads.

The fix adds an explicit allowlist of event types (push, workflow_dispatch) that can safely upload test results, alongside the existing PR repository check.

Critical Issues Found

Finding 1: Potential security consideration documented but implementation looks correct (💭)

The comment states "PRs from the repository and all other events are OK" - this is technically accurate given the conditional logic. However, the phrase "all other events" could be misleading since the workflow only triggers on specific events defined at the top (workflow_dispatch, push, pull_request). The implementation correctly allowlists only safe events.

Good Practices Observed

  • Consistent application of the fix across both workflow files
  • Clear inline comments explaining the security reasoning
  • Proper use of parentheses for logical grouping in the conditional

PR Metadata Quality

Title: Clear and descriptive ✓

Description:

  • Tracking section: N/A noted (acceptable for small fixes)
  • Objective: Well-written, clearly explains the bug and the fix ✓
  • Screenshots: N/A (appropriate for workflow changes)
  • Reminders checklist: Present ✓

Verdict

This is a clean, straightforward fix that correctly addresses the reported issue. The implementation is sound and the logic properly handles the security concern about fork PRs while allowing safe event types to upload test results.


@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.01%. Comparing base (9ecfc29) to head (b6841d6).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #921   +/-   ##
=======================================
  Coverage   16.01%   16.01%           
=======================================
  Files          67       67           
  Lines        2791     2791           
  Branches      481      481           
=======================================
  Hits          447      447           
  Misses       2306     2306           
  Partials       38       38           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Detailscf3b615c-3018-4a65-b113-a61570fe9446

Great job! No new security vulnerabilities introduced in this pull request

@eliykat eliykat requested a review from withinfocus November 15, 2025 04:25
@eliykat eliykat merged commit 6abfdd8 into main Nov 17, 2025
28 checks passed
@eliykat eliykat deleted the report-test-results branch November 17, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants