Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing to Airflow API Client

Thank you for your interest in contributing. This document covers how to set up a development
environment, the coding standards we follow, and the process for submitting changes.

> **Note:** This file has been reviewed and approved by Rackspace Legal. Do not modify the
> DCO section or the contribution process without seeking Legal review again.

## Developer Certificate of Origin (DCO)

This project uses the [Developer Certificate of Origin (DCO)](https://developercertificate.org/)
rather than a Contributor Licence Agreement (CLA). By submitting a pull request you certify that
you have the right to contribute the code and that you agree to the DCO terms.

Every commit must include a `Signed-off-by` trailer with your real name and email address:

```
Signed-off-by: Jane Smith <jane.smith@example.com>
```

Add it automatically with:

```bash
git commit -s -m "your commit message"
```

If you forget on a previous commit:

```bash
git commit --amend -s --no-edit
```

Pull requests with unsigned commits will not be merged.

## Development setup

Requires Python 3.10+ and [uv](https://github.com/astral-sh/uv).

```bash
git clone https://github.com/rackerlabs/airflow-api-client.git
cd airflow-api-client
uv sync --extra dev
```

Install pre-commit hooks (runs Black, isort, and Pylint before each commit):

```bash
uv run pre-commit install
```

## Code style

| Tool | Purpose |
|---|---|
| [Black](https://black.readthedocs.io/) | Formatting (line length 100) |
| [isort](https://pycqa.github.io/isort/) | Import ordering |
| [Pylint](https://pylint.readthedocs.io/) | Linting |
| [Flake8](https://flake8.pycqa.org/) | Additional style checks |

Run all checks manually:

```bash
uv run black airflow_api_client/ tests/
uv run isort airflow_api_client/ tests/
uv run pylint --rcfile=pyproject.toml airflow_api_client/
uv run flake8 airflow_api_client/ tests/
```

The pre-commit hooks run Black, isort, and Pylint automatically on `git commit`.

## Running tests

```bash
uv run pytest tests/
```

## Submitting a pull request

1. Fork the repository and create a branch from `main`.
2. Make your changes with signed-off commits (see DCO above).
3. Ensure all tests pass and linters report no errors.
4. Open a pull request against `main`. CI must pass before the PR can be merged.
5. A maintainer will review your PR and may request changes.

Please keep pull requests focused — one logical change per PR makes review faster.

The current maintainers are listed in [MAINTAINERS](MAINTAINERS).

## Reporting bugs

Open a GitHub issue with steps to reproduce, the command you ran, and the full error output.
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The following people are responsible for reviewing and merging pull requests, triaging issues,
and cutting releases.

| Name | GitHub |
|---|---|
| Erik Ljungstrom | @eljrax |
| Ed Velez | @ed-velez |
| Dimitar Filipov | @dimitarfilipov |
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Airflow API Client
Copyright 2026 Rackspace Technology, Inc.

This product includes software developed at
Rackspace Technology, Inc. (https://www.rackspace.com/).
1 change: 1 addition & 0 deletions airflow_api_client/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
1 change: 1 addition & 0 deletions airflow_api_client/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Authentication provider for Airflow API client that supports JWT tokens.
AirflowAPIClientAuthProvider is the default authentication provider for Airflow API client. Custom
providers can be implemented by subclassing AirflowAPIClientAuthProvider and overriding the
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Base class for CLI commands."""

from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/create_payload.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Command to construct a payload for a DAG run by prompting for values for each parameter defined
in the DAG's parameters.
"""
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Get command module"""

from airflow_api_client.commands.get.main import GetCommand
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/dag.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Get DAG details"""

from airflow_api_client.log import logger
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/dag_run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Get DAG run details"""

from airflow_api_client.log import logger
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/log.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Get task instance log"""

from airflow_client.client.exceptions import NotFoundException
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Main get command with subcommand dispatch"""

import json
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/get/task_instance.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Get task instance details"""

from airflow_api_client.log import logger
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""List command module"""

from airflow_api_client.commands.list.main import ListCommand
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Base class for list commands"""

from typing import Any, List
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/dag_runs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""List DAG runs command"""

from airflow_api_client.filters import filter_obj
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/dags.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""List DAGs command"""

from airflow_api_client.filters import filter_obj
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Main list command with subcommand dispatch"""

from airflow_api_client.commands.list.base import ListCommandBase
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/list/task_instances.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""List task instances command"""

from airflow_api_client.filters import filter_obj
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/pause.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the `pause` sub-command."""

from airflow_api_client.commands import Command
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the `profile` sub-command."""

import configparser
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/raw.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the `raw` sub-command."""

import json
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the `run` sub-command."""

import json
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/unpause.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the `unpause` sub-command."""

from airflow_api_client.commands import Command
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/commands/xcom.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to the xcom sub-command"""

from airflow_api_client.commands import Command
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/filters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Code related to filtering objects based on user-provided criteria"""

import json
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Utility functions for outputting data in various formats (JSON, YAML, human-readable tables)."""

import json
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/log.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Logging configuration for the application, using structlog for structured logging with
pretty-printed collections in the console output.
"""
Expand Down
3 changes: 2 additions & 1 deletion airflow_api_client/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0

"""Airflow API Client"""

# This is a client for Airflow 3.1 and the RAW environment
# This is a client for Airflow 3.1
import argparse
import configparser
import importlib
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""A module for interacting with Airflow DAGs, DAG runs, task instances, XCom and any other
Airflow entities via the Airflow API.
"""
Expand Down
1 change: 1 addition & 0 deletions airflow_api_client/typedefs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 Rackspace Technology, Inc. SPDX-License-Identifier: Apache-2.0
"""Types used across the application."""


Expand Down
Loading