Skip to content

Action: post the selection report as a sticky PR comment - #7

Merged
baronunread merged 3 commits into
mainfrom
action-sticky-comment
Sep 27, 2026
Merged

baronunread merged 3 commits into
mainfrom
action-sticky-comment

Conversation

@baronunread

Copy link
Copy Markdown
Owner

Closes #4.

  • The CLI writes its report to LEANEST_REPORT_FILE as well as the job summary. SKIP rows fold into <details>.
  • When the judge is down (bad key, API error, unknown provider), the report opens with a warning that gives the reason and says the full suite ran. An unknown provider used to crash before writing anything; it now falls back like any other judge error.
  • The Action edits the comment whose first line matches the report's marker (<!-- leanest-report <framework> <dir> -->), or posts a new one. On by default, off with comment: false. A failed post (missing pull-requests: write, fork PR) only logs a warning.
  • CI's action job gets pull-requests: write, so this PR should show the comment.

🤖 Generated with Claude Code

baronunread and others added 2 commits September 26, 2026 03:22
The CLI writes its report to LEANEST_REPORT_FILE as well as the job
summary, with a hidden marker at the top. The Action finds the comment
carrying that marker and edits it, or posts a new one. On by default,
off with `comment: false`. A failed post (missing permission, fork PR)
only logs a warning.

SKIP rows fold into <details>. When the judge is down, the report opens
with a warning that gives the reason and says every test still ran.

Closes #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unknown LEANEST_PROVIDER threw in the constructor, so the CLI crashed
before writing any report. It now fails at evaluate() like any other
judge error: full suite, yellow warning with the reason.

The comment marker now carries the framework and dir, and the Action
reads it from the report's first line. A job running the Action for
both Playwright and Vitest keeps two comments instead of one overwriting
the other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2b7c15cf-f357-4fb0-ab91-71d1fb6ffb1f


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.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

leanest: 2 of 7 playwright test files selected

Test Decision Reason
src/cli.test.ts RUN test file changed
fixtures/action/price.pw.ts RUN imports a changed file
5 skipped
Test Decision Reason
src/selection-policy.test.ts SKIP judge p=0.13 c=0.62
src/route-heuristic.test.ts SKIP judge p=0.10 c=0.69
src/import-graph.test.ts SKIP judge p=0.07 c=0.72
src/runner.test.ts SKIP judge p=0.06 c=0.74
src/test-discovery.test.ts SKIP judge p=0.05 c=0.77

From a cold review of this PR:
- Sharded jobs raced to create the comment on a PR's first push and left
  duplicates. Only shard 1 (or an unsharded run) posts now.
- The lookup matched any comment starting with the marker; it now only
  matches github-actions[bot]'s, so a quoted marker can't hijack it.
- Pipes, newlines and backticks in paths, reasons or judge errors broke
  the table or the warning block. They're flattened and escaped.
- Bodies over GitHub's 65,536-character limit failed to post. They fall
  back to the summary lines and point to the job summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@baronunread
baronunread merged commit 23cfbca into main Sep 27, 2026
3 checks passed
@baronunread
baronunread deleted the action-sticky-comment branch September 27, 2026 21:58
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.

Action: post a sticky PR comment with the selection report

1 participant