PR Gate

The PR Gate is a GitHub App that runs Asondy's code gates on every pull request and reports the result as a check on the pull request. It reads the changed files through the GitHub API, so the code in a pull request is never executed.

Install

Sign in to the dashboard, open the PR Gate card and press Install the GitHub App. Pick the organization and the repositories, then approve. Each repository you add gets the check on its next pull request.

Configure a repository

A repository may carry a .asondy.yml file with two top-level keys: mode and gates. gates maps a gate name to an action. Any other key stops the check with a "Gate config unreadable" run that names the line.

The file is read at the pull request's base commit, never from the pull request's own copy, so a pull request that edits it is still judged by the file already on the base branch. A repository with no file takes the defaults.

mode: evaluate
gates:
  placeholder: off
  ai-writing: enforce

Evaluate and enforce

The mode is evaluate or enforce. Without a file it is evaluate. A gate named under gates takes its own action instead of the mode:

  • enforce: a finding from this gate fails the check.
  • off: the gate is dropped and its findings are not counted.

A gate with no entry takes the repository mode. In evaluate the result follows the hosted PR Gate's own mode, which is enforce unless the server runs in evaluate. With enforce a finding fails the check on its own. The check is neutral when findings remain but none resolve to enforce, and it succeeds when none remain.

Suppress a finding

A pull request suppresses one gate with a line in its description:

asondy:ignore ai-writing: the quoted text is a verbatim customer sentence

The reason must be at least 8 characters. A shorter one refuses the run with a "Suppression refused" check that names the line. A suppression drops that gate's findings for the pull request and is recorded with the repository, the pull request number, the gate and the reason. The check summary lists each suppression and each gate set off.

What it reads and runs

Pull request code is never executed. The PR Gate reads the diff and the changed files through the GitHub API and runs its own checks over that text. The check summary escapes HTML and markdown, so a file name or finding that carries a tag shows as text.

A pull request over the changed-file cap, or with a file or diff over the byte caps, gets a neutral check that names the cap and no gate runs.

Continue readingWebhooks