Mendloop Docs Request access

GitHub

Connect GitHub as a GitHub App to read code for root causes and, after an approval, open fix pull requests.

Mendloop connects to GitHub as a GitHub App. It reads code, history, pull requests and CODEOWNERS to find root causes. After a code owner approves a fix, it opens a pull request on a new branch.

What Mendloop can do, and when#

Read (always) Write (only after an approval)
Permissions on the token contents, metadata, pull requests, checks: read contents, pull requests: write
Which repositories the ones you installed the app on (or the list you set) one, the repository in the approved plan
Token lifetime under an hour, in memory under an hour, in memory, audit-logged
  • Write access is a separate grant: an Admin turns on fixes for the connection. Until then, Mendloop asks GitHub only for read-only tokens, even if the app itself has write permissions.
  • Even with fixes on, every write token needs a recorded approval of the fix. No approval, no token.
  • Mendloop never pushes to the default branch or a protected branch. Each fix gets its own branch, cut from the default branch GitHub reports, and reaches the default branch only through your normal review.

Connect in two clicks#

  1. Integrations → GitHub → Connect. Choose Read only, or Read and write if you want fixes now (write is used only after an owner approves a fix, and never on the default or a protected branch). Optionally enter a GitHub organization to own the app; you need to be one of its owners. Then Create the app on GitHub.
  2. GitHub shows the new app's settings, filled in. Click Create GitHub App.
  3. GitHub asks where to install it. Pick the account and the repositories.
  4. You land back on the connection's page in Mendloop. The checklist runs; when it passes, open Project mapping to say which repository holds each Mendloop project's code.

If GitHub doesn't finish (an expired or reused link, or you aren't an owner of the organization), you land back on the Connect GitHub page with the reason and a Try again button.

Check What it proves
The app's key signs in the App ID and private key match
The app is installed the installation exists and isn't suspended
Permissions read is granted (and write, if fixes are on)
Read a repository's default branch a read-only token works and can see a repository
Read CODEOWNERS owners can be routed from it (no file is fine: Mendloop teams are used instead)
Webhook round trip signed deliveries reach Mendloop (optional)
Note:

Running Mendloop as a hosted service for other teams? You can own one GitHub App that every customer installs instead. See GitHub cloud mode.

Connect by pasting values#

If you already have a GitHub App, or use GitHub Enterprise Server, choose Use an app you already have on the Connect GitHub page and paste:

  • App ID and the private key (.pem): the app's settings page, "Generate a private key";
  • Installation id: the number at the end of the installation's URL (…/settings/installations/987654);
  • Webhook secret (optional, for the round-trip check);
  • API URL for GitHub Enterprise Server: https://ghe.example.com/api/v3.

The private key can be pasted or picked as the .pem file. A connection made this way starts read only; an Admin turns on fixes for it later.

Webhook events#

The app's webhook must send push, pull_request, check_run and check_suite events (the app Mendloop creates does). Push events keep Mendloop's read-only mirror of your code fresh; the others follow fix pull requests through CI to the merge.

Project mapping#

Root-cause analysis reads code only for projects mapped to a repository (owner/name). Without a mapping, the RCA still runs on the event, and its report says no code was read.

Fix branch names#

The default is mendloop/fix-{short_id}-{slug}, for example mendloop/fix-mob-123-npe-in-checkout. Change it with the connection's branch template, using {short_id}, {slug} (from the issue title) and {run}. The template must contain {short_id} or {run}, so that each fix gets its own branch.

Troubleshooting#

You see Do this
"The app's key didn't sign in" The key was regenerated, or belongs to another app. Paste the current key.
"Missing permissions" In the app's settings → Permissions, grant them. GitHub then asks the account owner to accept the new permissions on the installation.
"Write access isn't turned on" An Admin turns on fixes for the connection.
Webhook check waiting Set the app's webhook URL to the one shown in the checklist, with the same secret.
"No repository is mapped to this project" Add the mapping in Integrations → GitHub.
"Couldn't read owner/name" The connection isn't verified, or GitHub was unreachable. Run verify.
"Code was read at the default branch head" The release commit wasn't found. Tag your releases, or send the commit with the event.