Skip to content

ci: report test results inline instead of via a separate workflow - #2017

Merged
edusperoni merged 1 commit into
mainfrom
ci/inline-test-report
Aug 20, 2026
Merged

ci: report test results inline instead of via a separate workflow#2017
edusperoni merged 1 commit into
mainfrom
ci/inline-test-report

Conversation

@edusperoni

@edusperoni edusperoni commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

What

Replaces the workflow_run-based Test Report workflow with an inline mikepenz/action-junit-report step (pinned to v6.4.2) in the test jobs of both pull_request.yml and npm_release.yml, and deletes test_report.yml.

Why

The separate workflow existed only because fork PRs get a read-only GITHUB_TOKEN, so the test job itself could not post a check run — workflow_run was the standard workaround to get a checks: write token. But the security value of that split is essentially nil here:

  • The JUnit XML it renders is produced by the untrusted PR run, so the published check has no integrity — a fork PR can upload fabricated all-green results.
  • The report workflow used no secrets, so the isolation protected nothing except a checks: write token whose only power (writing that check) the PR author already controlled through the artifact.

Meanwhile it was the one workflow in the repo holding a write-scoped token that processes untrusted input.

How the replacement works

annotate_only: true makes the reporter use workflow commands (inline annotations on the run / Files changed view) instead of the Checks API, and detailed_summary: true writes the per-test table to the run's step summary. Both work with a read-only token, so the report now works identically for fork PRs, with zero write permissions anywhere.

The android-unit-test-results artifact upload is kept for debugging red runs.

What changes for reviewers

The "Android Runtime Tests" check run disappears from the PR checks list (it could never be a trusted/required check anyway). The report now lives on the workflow run's summary page, and failures annotate the run directly. The real gate remains the Test job's own exit code from runtestsAndVerifyResults.

Validation

This PR itself exercises the new step: the Test job on this run should end with a "Test report summary" step that writes the results table to the job summary. Note the summary step runs the PR's copy of pull_request.yml, so it validates live here; the npm_release.yml change is identical.

Summary by CodeRabbit

  • Tests

    • Added detailed summaries and workflow annotations for Android unit-test results in release and pull request checks.
    • Improved visibility into test outcomes directly within workflow runs.
  • Chores

    • Removed the separate test-reporting workflow in favor of reporting within existing checks.

The workflow_run-based Test Report workflow existed only because fork
PRs get a read-only GITHUB_TOKEN, so the test job could not post a
check run. But the JUnit XML it renders is produced by the untrusted
PR run itself, so the resulting check carries no integrity, and the
report workflow held the repo's only write-scoped token that processes
untrusted input.

Replace it with mikepenz/action-junit-report in annotate_only mode
directly in the test jobs: it reports through workflow commands and
the step summary, which work with a read-only token, including from
fork PRs. The results artifact upload stays for debugging.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 400172dd-ff1a-4e17-bad5-4de64204da82

📥 Commits

Reviewing files that changed from the base of the PR and between e4c72eb and d883acc.

📒 Files selected for processing (3)
  • .github/workflows/npm_release.yml
  • .github/workflows/pull_request.yml
  • .github/workflows/test_report.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/test_report.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The Pull Request and NPM Release test jobs now generate Android JUnit report annotations and summaries. The separate Test Report workflow was deleted.

Changes

Android test reporting

Layer / File(s) Summary
Inline JUnit reporting
.github/workflows/pull_request.yml, .github/workflows/npm_release.yml
The test jobs now process android_unit_test_results.xml after testing. They publish annotations and detailed summaries under their respective completion conditions.
Remove legacy report workflow
.github/workflows/test_report.yml
The workflow that reported results after Pull Request and NPM Release completion was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d883a

This change moves test reporting inline while preserving the test job’s existing pass/fail gate, with no actionable merge-blocking risk remaining after normal checks and review.

Suggested reviewers: nathanwalker

Poem

A rabbit checks the tests at night,
JUnit stars now shine bright.
Reports hop into each run,
The old workflow’s work is done.
Annotations bloom in sight.

🚥 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: reporting test results inline instead of through a separate 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.

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.

@edusperoni
edusperoni merged commit 786c486 into main Aug 20, 2026
8 checks passed
@edusperoni
edusperoni deleted the ci/inline-test-report branch August 20, 2026 01:44
edusperoni added a commit to NativeScript/ios that referenced this pull request Aug 20, 2026
Add an inline mikepenz/action-junit-report step (annotate_only +
detailed_summary) to the test jobs of pull_request.yml and
npm_release.yml, mirroring NativeScript/android#2017. annotate_only
reports via workflow commands and the step summary, so it works with a
read-only token — fork PRs included.

The xcparse extraction moves out of Validate Test Results into its own
!cancelled() step so a red test run still gets its junit report when the
xcresult carries the attachments. junit-cli-report-viewer stays as the
full per-test log and verify-junit-xml remains the gate.

Also set explicit least-privilege permissions (contents: read) on
pull_request.yml, the one workflow without a permissions block.
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.

1 participant