LabsThis feature is in Labs.
--persona reviewer. The persona bundles the Astro and Airflow review prompt, a read-only tool allowlist, plan-mode permissions, and a structured verdict schema, so Otto returns review results tuned for Airflow projects rather than generic code review. See Personas.
The action supports both GitHub and GitLab:
- GitHub: A composite GitHub Action that runs on
pull_requestand posts the review to the pull request. - GitLab: A CI/CD template and Docker image that run on merge request events and post the review to the merge request.
What Otto reviews
Otto reviews changes against three layers of knowledge, so it catches issues that generic code review misses:- Astronomer compatibility knowledge: Version-specific operator behavior, provider compatibility, deprecated patterns, and failure signatures drawn from the Astronomer compatibility knowledge base. This is the same knowledge base that powers Airflow upgrades with Otto.
- Airflow community standards: Current Dag patterns, testing approaches, and structure recommendations from the Apache Airflow community.
- Your team’s conventions: Standards, retry policies, approved operators, and patterns captured in Otto Memory. Otto surfaces deviations from your conventions before they reach a human reviewer.
How it works
On each run, the action:- Checks out the changed code and gathers the pull request or merge request metadata, the diff, and the prior review conversation.
- Runs
astro otto --mode json --persona revieweragainst the gathered context. - Posts the result back to the pull request or merge request.
verdict:approve,comment, orrequest_changes.summary: A one-sentence summary of the change.reasoning: One to three sentences on the change as a whole.comments: Line-anchored findings, each with a severity ofhigh,medium, orlowand an optional commit suggestion.
Prerequisites
- An Astro Organization API token. The token only needs the Organization member permission.
- A GitHub repository or GitLab project that contains an Airflow project.
Set up the review action
- GitHub
- GitLab
On GitHub, the review runs as the Otto Review action from the GitHub Marketplace. Add it to a workflow that runs on pull requests. To get the latest version, click Use latest version on the Marketplace listing.
1
Add the workflow
In your repository, create a workflow file at
.github/workflows/otto-review.yml with the following content:.github/workflows/otto-review.yml
2
Add the required secrets
In your repository, go to Settings > Secrets and variables > Actions and add the following repository secrets:
ASTRO_API_TOKEN: Your Astro Organization API token.ASTRO_ORGANIZATION: Your Astronomer Organization ID.
3
Open a pull request
Open a pull request against the
main branch. The action runs Otto, posts a sticky summary comment, and adds inline comments where it finds issues.Run a review on demand
Code review also works outside a CI/CD pipeline. Run the reviewer persona from your terminal to review changes before you push, or to audit existing pipelines that haven’t been through a structured review:astro otto for the full persona reference.
Configure the review
Both platforms accept settings that change how the review runs. On GitHub, pass them as action inputs underwith:. On GitLab, set them as CI/CD variables. The most common settings are:
For the complete list of inputs, variables, and outputs, see the otto-review-action repository.