Contribution Guidelines

Thank you for your interest in contributing to the Petal Stack! This guide will help you understand the dependency architecture and version management across all repositories.

Dependency Architecture

Understanding the Petal Stack Dependencies

The Petal Stack consists of multiple repositories with specific dependency relationships:

digraph dependency_structure {
    rankdir=TB;
    node [shape=box, style=filled];

    // Core components
    pam [label="Petal App Manager\n(pyproject.toml)\nDefault: main", fillcolor=lightblue];
    pymavlink [label="pymavlink\n(mavlink/pymavlink/__init__.py)\nDefault: dev-sitl", fillcolor=orange];
    leafsdk [label="LeafSDK\n(pyproject.toml)\nDefault: main", fillcolor=lightgreen];

    // Petals
    flight_log [label="petal-flight-log\n(pyproject.toml)\nDefault: master", fillcolor=palegreen];
    warehouse [label="petal-warehouse\n(pyproject.toml)\nDefault: main", fillcolor=palegreen];
    leafsdk_petal [label="petal-leafsdk\n(pyproject.toml)\nDefault: main\n⚠️ Depends on LeafSDK", fillcolor=palegreen];
    journey [label="petal-user-journey-coordinator\n(pyproject.toml)\nDefault: main", fillcolor=palegreen];
    qgc [label="petal-qgc-mission-server\n(pyproject.toml)\nDefault: main", fillcolor=palegreen];

    // Dependencies
    pam -> pymavlink [label="PROD: PyPI\nSITL: file://", color=blue, style=bold];
    pam -> flight_log [label="PROD: git tag\nSITL: editable", color=blue, style=bold];
    pam -> warehouse [label="PROD: git tag\nSITL: editable", color=blue, style=bold];
    pam -> leafsdk_petal [label="PROD: git tag\nSITL: editable", color=blue, style=bold];
    pam -> journey [label="PROD: git tag\nSITL: editable", color=blue, style=bold];
    pam -> qgc [label="PROD: git tag\nSITL: editable", color=blue, style=bold];

    leafsdk_petal -> leafsdk [label="PROD: PyPI\nSITL: editable", color=green, style=bold];

    // Legend
    subgraph cluster_legend {
        label="Legend";
        style=filled;
        color=lightgray;
        rankdir=TB;

        leg_note [label="Version stored in pyproject.toml (except pymavlink: __init__.py)\nPROD = Production deployment | SITL = Development environment", shape=plaintext];
    }
}

Petal Stack Dependency Architecture

Key Points:

  • PAM (Petal App Manager): Only depends on pymavlink and the petals

  • petal-leafsdk: Special case - depends on LeafSDK

  • Production (PROD): Uses PyPI packages or git tags for stable releases

  • SITL (Development): Uses editable installs for live development

  • CI/CD: Does not install petals (framework testing only)

Version Management by Repository

Petal App Manager

Repository: petal-app-manager

Default Branch: main

Version Location: pyproject.toml

Deployment Modes:

  • Production: Installs petals directly from git tags (versions specified in pyproject.toml)

  • CI/CD: Does not install petals (framework testing only)

  • SITL: Installs petals in editable mode + LeafSDK (editable)

Release Process:

  1. Update version in pyproject.toml

  2. Update petal versions in pyproject.toml under [project.optional-dependencies]

  3. Commit changes

  4. Create and push git tag: git tag v0.1.x && git push origin v0.1.x

Individual Petals

All petals follow the same versioning pattern:

petal-flight-log

Default Branch: master

Version Location: pyproject.toml

Release Process:

  1. Bump version in pyproject.toml

  2. Commit changes

  3. Create and push git tag: git tag v0.1.x && git push origin v0.1.x

  4. PAM will install in production directly from this git tag

petal-warehouse

Default Branch: main

Version Location: pyproject.toml

Release Process: Same as petal-flight-log

petal-user-journey-coordinator

Default Branch: main

Version Location: pyproject.toml

Release Process: Same as petal-flight-log

petal-qgc-mission-server

Default Branch: main

Version Location: pyproject.toml

Release Process: Same as petal-flight-log

petal-leafsdk (Special Case)

Default Branch: main

Version Location: pyproject.toml

⚠️ Important: This petal depends on LeafSDK

Release Process:

  1. First, ensure LeafSDK is updated and published to PyPI (see below)

  2. Bump LeafSDK version in petal-leafsdk’s pyproject.toml dependencies

  3. Bump petal-leafsdk version in pyproject.toml

  4. Commit changes

  5. Create and push git tag: git tag v0.1.x && git push origin v0.1.x

Non-Petal Packages

LeafSDK

Repository: LeafSDK

Default Branch: main

Version Location: pyproject.toml

Deployment:

  • Production: Installed from PyPI (due to dependency from petal-leafsdk)

  • SITL: Installed in editable mode

Release Process:

  1. Commit all changes

  2. Bump version in pyproject.toml

  3. Create and push git tag: git tag v0.2.x && git push origin v0.2.x

  4. This triggers a CI/CD workflow to publish to PyPI

Version Summary Table

Repository Version Management

Repository

Default Branch

Version File

Installation Method

petal-app-manager

main

pyproject.toml

PROD: git tag | SITL: editable

petal-flight-log

master

pyproject.toml

PROD: git tag | SITL: editable

petal-warehouse

main

pyproject.toml

PROD: git tag | SITL: editable

petal-user-journey-coordinator

main

pyproject.toml

PROD: git tag | SITL: editable

petal-qgc-mission-server

main

pyproject.toml

PROD: git tag | SITL: editable

petal-leafsdk

main

pyproject.toml

PROD: git tag | SITL: editable (⚠️ depends on LeafSDK)

LeafSDK

main

pyproject.toml

PROD: PyPI | SITL: editable

leaf-mavlink (pymavlink)

dev-sitl

pymavlink/__init__.py

PROD: PyPI | CI/CD: PyPI | SITL: file://

Getting Help

Communication Channels

  • GitHub Issues: For bug reports and feature requests

  • GitHub Discussions: For questions and general discussion

  • Pull Request Comments: For code-specific questions

Resources

Thank you for contributing to the Petal Stack! 🚁✨