Skip to content

Add automated Wasp code review - #4554

Open
infomiho wants to merge 4 commits into
miho/wasp-review-skill-onlyfrom
miho/wasp-review-skill
Open

Add automated Wasp code review#4554
infomiho wants to merge 4 commits into
miho/wasp-review-skill-onlyfrom
miho/wasp-review-skill

Conversation

@infomiho

@infomiho infomiho commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

Adds automated PR review.

The workflow runs /wasp-review skill with gpt-5.6-sol. It reviews trusted same-repository PRs in a read-only Codex job, converts structured output to RDJSON, publishes inline findings through Reviewdog, and updates one summary comment. Draft and fork PRs are skipped.

Alternative

CodeRabbit is a reasonable replacement if we no longer want to maintain this workflow. It handles incremental reviews and comment cleanup for us, and it is free for public open-source repositories. The tradeoff is less control: it can read our review skill as instructions, but it cannot run the skill directly or let us choose the exact model.

Type of change

  • 🔧 Just code/docs improvement
  • 🐞 Bug fix
  • 🚀 New/improved feature
  • 💥 Breaking change

Checklist

  • I tested my change in a Wasp app to verify that it works as intended.

  • 🧪 Tests and apps:

    • I added unit tests for my change.
    • (if you fixed a bug) I added a regression test for the bug I fixed.
    • (if you added/updated a feature) I added/updated e2e tests in examples/kitchen-sink/e2e-tests.
    • (if you added/updated a feature) I updated the starter templates in waspc/data/Cli/templates, as needed.
    • (if you added/updated a feature) I updated the example apps in examples/, as needed.
      • (if you updated examples/tutorials) I updated the tutorial in the docs (and vice versa).
  • 📜 Documentation:

    • (if you added/updated a feature) I added/updated the documentation in web/docs/.
  • 🆕 Changelog: (if change is more than just code/docs improvement)

    • I updated waspc/ChangeLog.md with a user-friendly description of the change.
    • (if you did a breaking change) I added a step to the current migration guide in web/docs/migration-guides/.
    • I bumped the version in waspc/waspc.cabal to reflect the changes I introduced.

No Wasp app, e2e, starter, documentation, changelog, or version changes are needed for this repository automation.

@infomiho infomiho changed the title Add project code review skill Add Wasp code review skill Jul 27, 2026
@infomiho
infomiho temporarily deployed to railway-deploy-test July 27, 2026 10:25 — with GitHub Actions Inactive
@infomiho
infomiho temporarily deployed to fly-deploy-test July 27, 2026 10:25 — with GitHub Actions Inactive
@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wasp.sh/spec

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/spec@4554

@wasp.sh/wasp-cli

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli@4554

@wasp.sh/wasp-cli-darwin-arm64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-arm64-unknown@4554

@wasp.sh/wasp-cli-darwin-x64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-x64-unknown@4554

@wasp.sh/wasp-cli-linux-arm64-glibc

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-arm64-glibc@4554

@wasp.sh/wasp-cli-linux-x64-glibc

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-glibc@4554

@wasp.sh/wasp-cli-linux-x64-musl

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-musl@4554

commit: ebe43d8

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying wasp-docs-on-main with  Cloudflare Pages  Cloudflare Pages

Latest commit: 317ab30
Status: ✅  Deploy successful!
Preview URL: https://41b0fc72.wasp-docs-on-main.pages.dev
Branch Preview URL: https://miho-wasp-review-skill-only.wasp-docs-on-main.pages.dev

View logs

@infomiho
infomiho temporarily deployed to fly-deploy-test July 27, 2026 10:45 — with GitHub Actions Inactive
@infomiho
infomiho temporarily deployed to railway-deploy-test July 27, 2026 10:45 — with GitHub Actions Inactive
@infomiho
infomiho marked this pull request as ready for review July 27, 2026 12:59
@infomiho
infomiho requested a review from a team as a code owner July 27, 2026 12:59
@infomiho
infomiho requested review from sodic and removed request for a team July 27, 2026 12:59
@infomiho

Copy link
Copy Markdown
Member Author

Testing the review action by marking the PR ready for review.

Comment thread .github/workflows/automation-wasp-review.yaml
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Wasp review

The workflow has two trust-boundary flaws and does not rerun reviews when a PR’s base changes.

@infomiho
infomiho temporarily deployed to railway-deploy-test July 27, 2026 13:07 — with GitHub Actions Inactive
@infomiho
infomiho temporarily deployed to fly-deploy-test July 27, 2026 13:07 — with GitHub Actions Inactive
env:
REVIEW_JSON: ${{ needs.review.outputs.review }}
run: |
printf '%s' "$REVIEW_JSON" | node .github/wasp-review/to-rdjson.mjs \

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.

🚫 [wasp-review] reported by reviewdog 🐶
Do not execute PR-controlled code in the publisher

This executes the converter from the PR checkout in a job that later exposes a write-scoped token. Run the converter from the trusted base commit or an immutable action outside the privileged job.

safety-strategy: drop-sudo
output-schema-file: .github/wasp-review/output-schema.json
prompt: |
Use $wasp-review to review 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.

⚠️ [wasp-review] reported by reviewdog 🐶
Keep review instructions outside the reviewed tree

The invoked skill comes from the PR checkout, allowing a change to suppress or reshape its own review. Load the skill and output schema from the trusted base revision while exposing the PR only as review data.


on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

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.

⚠️ [wasp-review] reported by reviewdog 🐶
Rerun reviews after base-branch changes

Changing a PR’s base emits pull_request.edited, which this trigger excludes, leaving the review based on the old diff. Add edited and gate it on github.event.changes.base.

@infomiho
infomiho temporarily deployed to railway-deploy-test July 27, 2026 13:40 — with GitHub Actions Inactive
@infomiho
infomiho temporarily deployed to fly-deploy-test July 27, 2026 13:40 — with GitHub Actions Inactive
@infomiho infomiho changed the title Add Wasp code review skill Add automated Wasp code review Jul 27, 2026
@infomiho
infomiho changed the base branch from main to miho/wasp-review-skill-only July 27, 2026 13:44
@infomiho infomiho mentioned this pull request Jul 27, 2026
15 tasks

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.

Why not part of the existing ci workflow?

Comment on lines +20 to +23
contains(
fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.pull_request.author_association
)

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.

In the "label PRs as external", I tried doing stuff with these tags but they don't straightforwardly signal what I think we'd like them to. I ended up using only the github.event.pull_request.head.repo.full_name == github.repository check, and I think here you can do it too.

review: ${{ steps.review.outputs.final-message }}
steps:
- name: Checkout pull request
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

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.

We don't use sha-pinned actions anywhere else. (Yes they are good for security but they need an autoupdater too so we don't miss out on important improvements)

- name: Checkout pull request
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge

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.

I'm quite sure this is already the ref when using the checkout action inside a PR trigger, i think

ref: refs/pull/${{ github.event.pull_request.number }}/merge
persist-credentials: false

- name: Fetch pull request refs

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.

What's this for?

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.

If it's to bound the agent to review base and head refs, why don't we use the same SHAs here as you do in the message to the agent?

publish:
name: Publish review
needs: review
if: ${{ needs.review.result == 'success' }}

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.

Suggested change
if: ${{ needs.review.result == 'success' }}

This is already the default

Comment on lines +119 to +121
with:
github-token: ${{ github.token }}
script: |

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.

you're looking for this instead gh pr comment --edit-last --create-if-none ...

env:
REVIEW_JSON: ${{ needs.review.outputs.review }}
run: |
printf '%s' "$REVIEW_JSON" | node .github/wasp-review/to-rdjson.mjs \

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.

is there a meaningful difference?

Suggested change
printf '%s' "$REVIEW_JSON" | node .github/wasp-review/to-rdjson.mjs \
echo "$REVIEW_JSON" | node .github/wasp-review/to-rdjson.mjs \

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.

I think this might be much simpler if we define the schema in zod and then write it to this file with z.toJsonSchema(), so we can use the same values and types everywhere

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.

you're lucky i didn't find any process.exit() here 🫡

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.

2 participants