Post · 5 min read· pp. 270–273

Opening a pull request

DocsDevelop

How to get a change into Aerostack2, from the first commit to the merge.

Authored by

  • @alvgaona

Every change to Aerostack2 goes through a pull request against main. This page walks through one, from setting up your copy of the code to the merge.

diagram

Propose features before building them

New features, new packages, new messages and changes to how the core nodes connect start with a feature request or a discussion. Agree on the design and where it fits before you write the code. Pull requests for these changes without a prior agreement are closed.

Bug fixes and small improvements can go straight to a pull request. If an issue already exists for them, comment on it to say you're working on it.

diagram

Using AI tools

AI-assisted contributions are welcome. Disclose the tools you used, understand every change you submit, and only report tests you actually ran. The AI Usage Policy has the full rules.

Get the code

If you're not a member of the Aerostack2 organization, fork aerostack2/aerostack2 on GitHub and clone your fork into a workspace. Members can clone the main repository and push branches to it directly.

text
mkdir -p ~/aerostack2_ws/src && cd ~/aerostack2_ws/src
git clone https://github.com/<your-user>/aerostack2.git
cd aerostack2
git remote add upstream https://github.com/aerostack2/aerostack2.git

Then install the dependencies and build it as in Installation from source.

Install the git hooks

The repository checks code style and commit messages before each commit, with lefthook. The hooks run in a Pixi environment that holds the same linters CI uses, so install Pixi first, then install the hooks once per clone:

text
pixi run -e lint lefthook install

From then on, every commit runs uncrustify and cpplint on the C++ files you staged, flake8 and pep257 on the Python files, and xmllint on the XML files. It also checks the commit message. A commit that fails stops there, and the output says which file broke which rule.

Make a branch

Start from an up to date main, and give the branch a name that says what it does:

text
git fetch upstream
git switch -c fix/geozones-gps-origin upstream/main

Commit your change

Commit messages follow Conventional Commits. Each one starts with a type, then optionally the package in parentheses, then a short description in the imperative:

text
feat(as2_core): add a filterable TF listener
fix(as2_geozones): convert runtime GPS zones to the local frame
docs(as2_behavior): fix the service type in the README
TypeFor
featA new feature
fixA bug fix
docsDocumentation only
refactorA code change that neither fixes a bug nor adds a feature
perfA performance improvement
testAdding or fixing tests
styleFormatting that doesn't change behavior
build, ciThe build system, packaging or CI
choreAnything else, like dependency bumps
revertReverting an earlier commit

Keep each commit to one logical change. Add or update tests along with the code they cover. If an AI agent wrote the commit, end its message with a Co-authored-by: trailer naming the agent.

Build and test locally

Build and test the packages you touched before you push. With the Aerostack2 CLI:

text
as2 build as2_core
as2 test as2_core

as2 test runs the package's unit tests and its linters, which check more than the hooks do, like the copyright header. To lint the whole repository, not only what you staged, run:

text
pixi run -e lint lefthook run pre-commit --all-files

Open the pull request

Push the branch and open a pull request against main:

text
git push -u origin fix/geozones-gps-origin

The title follows the same convention as the commits. When a pull request with several commits is squashed, its title becomes the commit message on main, so it matters more than any single commit.

The description template asks for these.

SectionWhat to put in it
Issue(s) this addressesThe issue it fixes, written as Closes #123 so GitHub closes it on merge
ROS 2 version tested onHumble, Jazzy, or both
Aerial platform tested onWhere you flew it, like Gazebo or the multirotor simulator
AI tools usedNone, or the tool and what it did
Description of contributionWhat changed, in a few bullet points
Documentation updatesThe pages on this site that need to change with it
Future workAnything you left for later

If the work isn't ready for review yet, open it as a draft. Mark it ready when it is.

Pass the checks

Every pull request runs these checks, and runs them again on every push.

CheckWhat it does
humble, jazzyBuilds the packages and runs their tests on each ROS 2 distribution
pixiBuilds the Pixi environments on Linux and macOS
docker-buildBuilds the Docker images

A bot also labels the pull request with the packages it touches, and the code owners of those packages are asked to review it. If a check fails, open its log from the pull request, fix the cause and push again.

Respond to the review

Reviewers leave comments on the changes. Answer each one, push new commits with the fixes, and resolve the thread once it's addressed. Pushing more commits is fine, since a maintainer can squash them when merging.

Keep the branch up to date with main if it falls behind or conflicts:

text
git fetch upstream
git rebase upstream/main
git push --force-with-lease

Merge

Once the checks pass and the reviewers approve, a maintainer merges it, by squashing or rebasing it onto main. The branch is deleted after the merge.

If your change affects how Aerostack2 is used, update this documentation too, in aerostack2/aerostack2.org.

Last updated on November 23, 2026

[diagram

Opening an issue

Where to report a bug or ask for a feature, and how to write an issue the team can act on.](038_2026-12-05_issues.md)[diagram

Developing with Pixi

Build Aerostack2 from your clone with Pixi, change it, and run your changes in a project, on Linux or macOS.](040_2026-12-05_pixi-development.md)