Skip to main content

Overview

nOps RecBot is a 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. 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 RecBot check with the result. The check is informational: it finishes as success, neutral, or skipped, and never blocks a merge.
Every recommendation links to its page in nOps, where you can see the details, mark it implemented, or create a ticket. RecBot labels what the change does to each recommendation: 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 RecBot 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.
RecBot matches resources against your existing nOps recommendations. It doesn’t create new recommendations, and it can only comment on resources that have open recommendations in nOps.

Permissions

RecBot requests these GitHub App permissions: RecBot 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).
  1. In nOps, go to Settings → Integrations → Notifications and click the nOps RecBot card.
  2. GitHub opens. Choose the organization, then All repositories or the repositories you want reviewed, and click Install.
  3. GitHub returns you to nOps, which links the installation to your nOps account. The card shows GitHub connected.
To connect another GitHub organization, click the card again (Add account →).
Start the install from nOps. An install started directly on GitHub isn’t linked to any nOps account, so RecBot can’t review anything. If that happens, click the nOps RecBot card in nOps and finish the link from there; you don’t need to uninstall the App first.
Reviews run as the nOps user who connected RecBot, using that user’s access to your nOps data. If that user loses access to your nOps account, reviews stop until someone else connects RecBot again.

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.
To review a pull request again, comment clara run (or /clara run, or clara review) on it, or click Re-run on the nOps RecBot check. Both need write access to the repository.

Disconnect

Uninstall the App on GitHub (your organization’s Settings → GitHub Apps → nOps RecBot → Uninstall). nOps marks the connection disconnected and RecBot stops reviewing.

Troubleshooting

  • No comment on a pull request: Check the nOps RecBot check 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 RecBot card in nOps to link it.
  • 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 the repository is one of the repositories you chose when installing the App on GitHub.