Skip to content

Commit 430caaa

Browse files
zeevdrclaude
andcommitted
CI hardening, org migration to opendecree
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d007e36 commit 430caaa

13 files changed

Lines changed: 148 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 101 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# CI pipeline for the OpenDecree Python SDK.
2+
#
3+
# Jobs: lint, typecheck, test (matrix: 3.11-3.13), examples → check (alls-green gate)
4+
# The check job aggregates all results for branch protection.
5+
16
name: CI
27

38
on:
@@ -7,37 +12,120 @@ on:
712
branches: [main]
813
workflow_call:
914

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
17+
cancel-in-progress: true
18+
1019
jobs:
1120
lint:
21+
name: Lint
1222
runs-on: ubuntu-latest
23+
timeout-minutes: 10
1324
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
with:
28+
persist-credentials: false
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
1632
with:
1733
python-version: "3.12"
18-
- run: pip install ruff
19-
- run: ruff check sdk/src/ sdk/tests/
20-
- run: ruff format --check sdk/src/ sdk/tests/
34+
35+
- name: Install ruff
36+
run: pip install ruff
37+
38+
- name: Check lint
39+
run: ruff check sdk/src/ sdk/tests/
40+
41+
- name: Check formatting
42+
run: ruff format --check sdk/src/ sdk/tests/
2143

2244
typecheck:
45+
name: Typecheck
2346
runs-on: ubuntu-latest
47+
timeout-minutes: 10
2448
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-python@v5
49+
- name: Checkout
50+
uses: actions/checkout@v6
51+
with:
52+
persist-credentials: false
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v5
2756
with:
2857
python-version: "3.12"
29-
- run: pip install -e "sdk[dev]"
30-
- run: cd sdk && mypy src/
58+
cache: pip
59+
cache-dependency-path: sdk/pyproject.toml
60+
61+
- name: Install SDK with dev dependencies
62+
run: pip install -e "sdk[dev]"
63+
64+
- name: Run mypy
65+
run: cd sdk && mypy src/
3166

3267
test:
68+
name: Test (Python ${{ matrix.python-version }})
3369
runs-on: ubuntu-latest
70+
timeout-minutes: 15
3471
strategy:
72+
fail-fast: false
3573
matrix:
3674
python-version: ["3.11", "3.12", "3.13"]
3775
steps:
38-
- uses: actions/checkout@v4
39-
- uses: actions/setup-python@v5
76+
- name: Checkout
77+
uses: actions/checkout@v6
78+
with:
79+
persist-credentials: false
80+
81+
- name: Set up Python ${{ matrix.python-version }}
82+
uses: actions/setup-python@v5
4083
with:
4184
python-version: ${{ matrix.python-version }}
42-
- run: pip install -e "sdk[dev]"
43-
- run: cd sdk && pytest --cov --cov-report=term-missing
85+
cache: pip
86+
cache-dependency-path: sdk/pyproject.toml
87+
88+
- name: Install SDK with dev dependencies
89+
run: pip install -e "sdk[dev]"
90+
91+
- name: Run tests with coverage
92+
run: cd sdk && pytest --cov --cov-report=term-missing
93+
94+
examples:
95+
name: Examples
96+
runs-on: ubuntu-latest
97+
timeout-minutes: 10
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v6
101+
with:
102+
persist-credentials: false
103+
104+
- name: Set up Python
105+
uses: actions/setup-python@v5
106+
with:
107+
python-version: "3.12"
108+
cache: pip
109+
cache-dependency-path: sdk/pyproject.toml
110+
111+
- name: Install SDK
112+
run: pip install -e sdk/
113+
114+
- name: Compile-check all examples
115+
run: |
116+
python -m py_compile examples/quickstart/main.py
117+
python -m py_compile examples/async-client/main.py
118+
python -m py_compile examples/live-config/main.py
119+
python -m py_compile examples/error-handling/main.py
120+
python -m py_compile examples/setup.py
121+
122+
check:
123+
name: CI check
124+
if: always()
125+
needs: [lint, typecheck, test, examples]
126+
runs-on: ubuntu-latest
127+
timeout-minutes: 5
128+
steps:
129+
- uses: re-actors/alls-green@release/v1
130+
with:
131+
jobs: ${{ toJSON(needs) }}

.github/workflows/project.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Project automation
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
permissions:
10+
issues: read
11+
pull-requests: read
12+
13+
jobs:
14+
add-to-project:
15+
name: Add to project
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/add-to-project@v1.0.2
19+
with:
20+
project-url: https://github.com/orgs/opendecree/projects/1
21+
github-token: ${{ secrets.PROJECT_TOKEN }}
22+

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This project follows the [Contributor Covenant v2.1](https://www.contributor-cov
44

55
## Reporting
66

7-
If you experience or witness unacceptable behavior, please email **via GitHub Issues**.
7+
If you experience or witness unacceptable behavior, please [open an issue](https://github.com/opendecree/decree-python/issues/new?labels=conduct) or contact a maintainer directly.
88

99
All reports will be reviewed and investigated promptly and fairly.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ DOCKER_RUN_ROOT := docker run --rm -v $(CURDIR):/workspace -v $(CURDIR)/../decre
66
PROTO_DIR := /proto
77
GEN_DIR := sdk/src/opendecree/_generated
88

9-
.PHONY: all generate lint format typecheck test build clean tools docs help
9+
.PHONY: all generate lint format typecheck test build clean tools docs pre-commit help
1010

1111
all: generate lint typecheck test
1212

13+
## pre-commit: Run local checks before committing (skip codegen)
14+
pre-commit: lint typecheck test
15+
1316
## tools: Build the tools Docker image (only when Dockerfile.tools changes)
1417
tools: $(TOOLS_SENTINEL)
1518
$(TOOLS_SENTINEL): build/Dockerfile.tools

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# OpenDecree Python SDK
22

3-
[![CI](https://github.com/zeevdr/decree-python/actions/workflows/ci.yml/badge.svg)](https://github.com/zeevdr/decree-python/actions/workflows/ci.yml)
3+
[![CI](https://github.com/opendecree/decree-python/actions/workflows/ci.yml/badge.svg)](https://github.com/opendecree/decree-python/actions/workflows/ci.yml)
44
[![PyPI](https://img.shields.io/pypi/v/opendecree)](https://pypi.org/project/opendecree/)
55
[![Python](https://img.shields.io/pypi/pyversions/opendecree)](https://pypi.org/project/opendecree/)
6-
[![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)](https://github.com/zeevdr/decree-python)
7-
[![License](https://img.shields.io/github/license/zeevdr/decree-python)](LICENSE)
6+
[![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)](https://github.com/opendecree/decree-python)
7+
[![License](https://img.shields.io/github/license/opendecree/decree-python)](LICENSE)
88

9-
Python SDK for [OpenDecree](https://github.com/zeevdr/decree) — schema-driven configuration management.
9+
Python SDK for [OpenDecree](https://github.com/opendecree/decree) — schema-driven configuration management.
1010

1111
> **Alpha** — This SDK is under active development. APIs and behavior may change without notice between versions.
1212
@@ -78,7 +78,7 @@ Runnable examples in the [`examples/`](examples/) directory:
7878
- [Watching](sdk/docs/watching.md)
7979
- [Async Usage](sdk/docs/async.md)
8080

81-
For detailed concepts (schemas, typed values, versioning, auth), see the [main OpenDecree docs](https://github.com/zeevdr/decree).
81+
For detailed concepts (schemas, typed values, versioning, auth), see the [main OpenDecree docs](https://github.com/opendecree/decree).
8282

8383
## Requirements
8484

SECURITY.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ If you discover a security vulnerability in the OpenDecree Python SDK, please re
66

77
**Do not open a public GitHub issue for security vulnerabilities.**
88

9-
Instead, please email **via GitHub Security Advisories** with:
10-
11-
1. A description of the vulnerability
12-
2. Steps to reproduce
13-
3. The potential impact
14-
4. Any suggested fix (optional)
9+
Instead, please [report it via GitHub Security Advisories](https://github.com/opendecree/decree-python/security/advisories/new).
1510

1611
You should receive a response within 48 hours. We will work with you to understand and address the issue before any public disclosure.
1712

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ make down
6060
## Learn more
6161

6262
- [Python SDK on PyPI](https://pypi.org/project/opendecree/)
63-
- [OpenDecree docs](https://github.com/zeevdr/decree)
63+
- [OpenDecree docs](https://github.com/opendecree/decree)

examples/error-handling/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
InvalidArgumentError,
2020
NotFoundError,
2121
RetryConfig,
22-
UnavailableError,
2322
)
2423

2524

examples/fastapi-integration/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from datetime import timedelta
2020
from pathlib import Path
2121

22-
from opendecree import AsyncConfigClient, AsyncConfigWatcher
22+
from opendecree import AsyncConfigClient
2323

2424
# Watcher fields — populated during lifespan startup.
2525
rate_limit: object = None

examples/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def main() -> None:
3636
tenant_id = line.split()[1]
3737
tenant_id_file.write_text(tenant_id)
3838
print(result.stdout, end="")
39-
print(f"Tenant ID written to .tenant-id")
39+
print("Tenant ID written to .tenant-id")
4040
return
4141

4242
print(f"Could not parse tenant ID from output:\n{result.stdout}", file=sys.stderr)

0 commit comments

Comments
 (0)