All jobs

Review Pull Requests in a Deno App

Yes. For each pull request the agent runs fmt, lint, type-check and tests on base and head, checks imports and permission flags, and posts one review.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent reads what CI enforces before it reads the diff, because in a Deno project the gap between the two is where reviews earn their keep. In an app like ryo-ma/github-profile-trophy, .github/workflows/testing.yml runs deno fmt --check, then deno lint || true, then deno task test. The || true means a lint finding has never failed a build, and deno task test is ENV_TYPE=test deno test --allow-env, which type-checks only what the four test files import. Neither api/index.ts, the request handler, nor main.ts is imported by a test. A pull request can break the handler's types or add lint errors and still show green.

So it runs more than CI does, on both sides. It checks out the base branch in a second directory and runs deno fmt --check, deno lint, deno check main.ts render_svg.ts and deno task test on base and on the pull request's head, using the Deno version the workflow pins. The review reports the difference: lint problems the diff adds, type errors it introduces in the entry points, tests that passed before and fail now. A problem that was already on the base is listed apart and not held against the author.

Then it reads the diff for things only a Deno reviewer looks for. A new import should go through deps.ts or the import map in deno.json, with a version: a bare https://deno.land/x/name/mod.ts floats to whatever is newest. Code that reads a file, opens a socket or spawns a process needs a permission, and this repository grants them in three places with three different lists: -A in the start task, --allow-env alone in the test task, and --allow-net --allow-env --allow-read --allow-write in the composite action in action.yml. The agent says which list a change outgrows. A test that needs --allow-read fails under the test task, and widening that task is a decision for the review to name.

It also checks what a user of the deployed card would see. vercel.json gives each function 5 seconds, and GithubApiService makes one combined GraphQL query for that reason, so a second upstream call in the request path is flagged. A changed requiredScore in src/trophy.ts changes the rank on existing profiles. A new entry in the COLORS map in src/theme.ts is rendered: the agent builds a UserInfo from src/Services/__mocks__/successGithubResponse.json, calls Card.render with the new theme and confirms the SVG parses. Anything from the request that is written into the SVG or the HTML error page must be escaped.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Review this pull request to our Deno app. Read deno.json, deps.ts, .github/workflows/testing.yml, action.yml, vercel.json, the Dockerfile and CONTRIBUTING.md first, and note what CI enforces and what it only reports. Install the Deno version the workflow pins. Check out the base branch in a second directory and run deno fmt --check, deno lint, deno check on main.ts and render_svg.ts, and deno task test on both base and head; report only what the pull request changes, and list problems that already exist on the base separately. Then read the diff. Flag: an import that bypasses deps.ts or the import map, or has no version; code that needs a permission the test task, the start task or the action's flag list does not grant, and say which list; a new upstream call in the request path, given the function time limit in vercel.json; a changed rank threshold or cache constant, as a change users will see; request data written into SVG or HTML without escaping; a token or Authorization header that could reach a log; and a new test that depends on the order of the shared stub in the API service tests. If the diff adds a theme, render the card with it from the mocked GitHub response and confirm the SVG parses. Post one review on the pull request with the command differences first, then findings by file and line. Do not push commits and do not call the GitHub API with a real token.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app/pull/42"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

One review on the pull request. It opens with a small table: the four commands, their result on base and on head, and one line each on what changed. A pull request that adds a theme and nothing else gets a short review that says all four are unchanged and the card rendered with the new colours. One that touches the handler gets the type-check result for main.ts first, since that is the check CI does not make.

Findings follow by file and line, each with the reason in one sentence: the import that has no version, the Deno.readTextFile that the test task's --allow-env will not permit, the second GraphQL call against a 5-second limit. Where a finding depends on a number in the repository, the review quotes the line it came from. The full output of every command is in the session's transcript at GET /o/{org}/sessions/{id}/messages.

The review comments and leaves the decision to a maintainer. Whether lint should start failing the build, whether a rank threshold should move, and whether a new permission is acceptable in a published action are choices for the people who own the project. The agent states that no card was rendered from live GitHub data and that the Vercel build was not run.

Run it on every pull request

Create an automation in the Project that holds the repository with this prompt, read-only switched on, and a github trigger on pull_request.opened and pull_request.synchronize. A review then starts when a pull request opens and again on each push. The trigger places the pull request after the prompt and fills in nothing. With read-only on, the run can read the repository and comment and cannot push.

The trigger fires for owners, members and collaborators, never for forks or bots, and a public Deno project gets most of its theme and trophy contributions from forks. For those, a maintainer pushes the contributor's commits to a branch in the repository itself and opens a pull request from it, which starts the review. A team that wants reviews only on request uses pull_request.labeled with a label in labels.

The use case this job follows, with its automation and trigger: Review every pull request.

Why run it on Rush?

Comparing base and head is the part people skip. It takes two checkouts, the pinned Deno version and four commands run twice, and a reviewer with one terminal runs the tests once on whatever Deno is installed. That is how a lint problem gets blamed on the wrong pull request, or goes unnoticed because the step ends in || true. The agent builds both sides fresh in its sandbox for every pull request, so the review reports a difference and can show the output behind it.

Permission flags are the other reason. Deno's sandbox is only as good as the lists in deno.json and action.yml, and a diff that adds one file read looks harmless until the test task refuses it or the published action needs a wider flag in everyone's workflow. The agent reads those lists on every review, and several pull requests are reviewed at once, each in a separate sandbox with its own two checkouts.

Frequently asked questions

Which Deno version does the review use?

The one the test workflow pins, read from the deno-version matrix, so the results match what CI would say. If the Dockerfile or the published action would run a different major, the review notes that once. It does not re-run everything on a second version unless the prompt asks.

CI ignores lint failures. Does the review ignore them too?

No. It runs deno lint on both branches and reports the problems the pull request adds, by rule and line. It does not ask the author to fix what was already there, and it does not edit the workflow. Whether to drop the || true is raised once as a question for maintainers.

Can it review pull requests from forks?

A github trigger does not fire for a fork's pull request. A maintainer pushes the contributor's commits to a branch in the repository and opens a pull request from that, which fires the trigger, or starts a run by hand with that new pull request's URL in resources.

Does it need a GitHub token to test the card?

No. The API service tests already stub soxa.post, and the theme check builds its input from the mocked response in src/Services/__mocks__. The request tells the agent not to call the GitHub API with a real token, so no secret needs to be in the Project for a review.

Will it approve or request changes?

It posts a review with findings and the command results, and the prompt decides how firm it is. Most teams have it comment only, so a person still approves. If you want a failing type-check on the entry points to block, say so in the prompt and require the review in your branch rules.

More Deno jobs

The same job on other stacks

Keep reading