Respond
GitHub
Connect repositories to see suspect commits on errors and the commits in each release.
The GitHub integration reads your repositories to show which commit likely caused an error and which commits went into a release. It needs two things: the GitHub App installed on your account, and a code mapping that links a project to a repository.
Connect an account
Only owners and admins can connect GitHub.
- Open Settings → Integrations.
- In the Source code group, click Connect in the GitHub row.
- On GitHub, choose the account or organization and the repositories the app can read, then install the app.
- You return to the GitHub page in OpenPerf and see GitHub connected.
Finish the installation within 10 minutes, or OpenPerf shows The connection link expired. Try again.
If you are not an owner of the GitHub organization, GitHub sends the owners a request instead of installing the app. OpenPerf shows The installation is waiting for an owner of the GitHub account to approve it. After the request is approved, an owner of the GitHub organization clicks Connect in OpenPerf.
You can connect an installation only when you are an admin of every repository it covers, and it covers at least one. Otherwise OpenPerf shows Only an admin of every repository in this GitHub installation can connect it.
If the GitHub row is dimmed and has no Connect button, GitHub is not configured on your OpenPerf server.
Repositories
The Repositories section lists the repositories the app can read, each with its default branch. Click a repository to open it on GitHub.
OpenPerf loads the list after you connect. Click Sync to load it again, for example after you change the repository access of the app on GitHub.
Add a code mapping
A code mapping tells OpenPerf where the files of a project live in a repository. Without a mapping, the project shows no suspect commits and no release commits.
- In the Code mappings section, click Add mapping.
- Pick the Project and the Repository.
- Fill in the roots and click Add mapping.
| Field | What to enter |
|---|---|
| Stack root | The start of file paths in stack traces, such as /app/ or webpack://app/. Leave it empty to match every path. |
| Source root | The folder in the repository that the stack root points to, such as packages/api/. Leave it empty for the repository root. |
With the stack root /app/ and the source root packages/api/, the frame /app/src/orders.ts maps to packages/api/src/orders.ts. A project can have several mappings with different stack roots; the longest matching stack root wins. The project of a mapping cannot be changed later.
What you get
Suspect commit on an error
On an error page, a Suspect commit line appears under the stack trace. It shows the commit, its message, author and time, and a link to the file and line on GitHub.
OpenPerf takes the first three app frames that match a code mapping and looks up who last changed each line. It shows the most recent of those commits that was made before the error first appeared.
The lookup uses the commit of the release the error came from: the --ref you passed to openperf releases create, or the vcs.ref.head.revision resource attribute. When neither is known, it uses the default branch of the repository. See Releases & source maps.
Commits in a release
On a release page, the Commits block lists the commits between the previous release of the project and this one. Click a commit to open it on GitHub.
The block needs a known commit for both releases. Otherwise it explains what is missing:
- This is the first release of the project. Commits show up from the next release on.
- No commit is known for this release. Set the ref of the release or send the
vcs.ref.head.revisionresource attribute. - The project isn't linked to a repository. Add a code mapping.
Disconnect
On the GitHub page, under Danger zone, click Disconnect. Releases and errors stop linking to the repositories. The app stays installed on GitHub: uninstall it there to revoke its access.
Limits
- The dashboard offers Connect only while no account is connected.
- No Suspect commit line appears when no app frame with a line number matches a code mapping, or when every matching line was last changed after the error first appeared.
- Stack frames in the stack trace are not links. The link to the code is in the Suspect commit line.