Overview
RecBot is a feature of the nOps GitHub App that reviews pull requests that change infrastructure as code. When a pull request touches a resource with an open nOps recommendation, RecBot comments on it, so the engineer making the change sees the savings opportunity while they’re already working on that resource. The nOps GitHub App carries every nOps feature for your repositories, and you choose which ones are on for each GitHub account you install it on. RecBot’s comments come from the nOps GitHub App and say Reviewed by nOps RecBot. On each pull request, RecBot posts:- A summary comment listing the recommendations the change touches, with their estimated monthly savings, followed by other open recommendations on resources the repository manages.
- Inline comments on the changed lines that a recommendation applies to.
- A
nOps RecBotcheck with the result. The check is informational: it finishes as success, neutral, or skipped, and never blocks a merge.
It also says how sure it is that the code and the recommendation are about the same resource: Exact match, Likely match (the name is built from variables or modules only known when Terraform runs), or Judged related.
RecBot is in early access. If you don’t see the nOps GitHub App card in nOps, contact your
nOps account team.
What RecBot reads
RecBot reads Terraform (including.tfvars, local modules, and YAML or JSON config read with yamldecode(file(...))), CloudFormation, AWS CDK, and Kubernetes manifests.
- For each pull request: the diff, plus the infrastructure files the diff only shows part of, such as the rest of a changed module, the variables it sets, and the config files it reads.
- Once per repository, and again after each merge to the default branch: the infrastructure files on the default branch. From these, nOps stores only the list of resources the repository declares (names, IDs, file, and line), not the code.
Permissions
The nOps GitHub App requests these GitHub App permissions, which cover all of its features:
The App never pushes code, opens pull requests, approves or requests changes, or changes repository settings. You choose which repositories it can see when you install it on GitHub.
Connect RecBot
You need permission to manage integrations in nOps, and permission to install GitHub Apps on the GitHub organization (usually an organization owner).- In nOps, go to Settings → Integrations → Notifications and click the nOps GitHub App card.
- GitHub opens. Choose the organization, then All repositories or the repositories you want reviewed, and click Install.
- GitHub returns you to nOps, which links the installation to your nOps account. A dialog lists the App’s features for that GitHub account; RecBot is on. Click Done.
Turn RecBot on or off
Click the nOps GitHub App card (Manage →) and use the RecBot switch for each GitHub account. While RecBot is off for an account, it posts no comments and no check on that account’s pull requests, and the App’s other features keep working. Turn it back on to resume reviews on new commits.When RecBot reviews
RecBot reviews a pull request when it’s opened, updated with new commits, reopened, or marked ready for review. It skips:- Draft pull requests, until they’re marked ready for review.
- Pull requests from forks, since anyone can open those.
nops run (or /nops run, or nops review) on it, or click Re-run on the nOps RecBot check. Both need write access to the repository.
Disconnect
To stop only RecBot, turn it off as described above. To remove the App and every nOps feature from a GitHub organization, uninstall it on GitHub (your organization’s Settings → GitHub Apps → nOps → Uninstall). nOps marks the connection disconnected and the App stops working there.Troubleshooting
- No comment on a pull request: Check the
nOps RecBotcheck on the pull request. Skipped gives the reason (draft, fork, or not linked to nOps). No open recommendations touched means nothing in the change has an open nOps recommendation. - “Installation is not linked”: The App was installed from GitHub, not from nOps. Click the nOps GitHub App card in nOps to link it.
- “RecBot is off”: Someone pressed Re-run while RecBot is switched off for that GitHub account. Turn it on from the card’s Manage dialog.
- A recommendation you expected is missing: RecBot only shows open recommendations. Check that the recommendation is open in nOps and that the resource’s name in the code can be resolved from the repository, not only from values passed in at deploy time.
- The check doesn’t appear at all: Make sure RecBot is on for that GitHub account, and that the repository is one of the repositories you chose when installing the App on GitHub.