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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
# A hung install or test fails in minutes rather than holding a runner for GitHub's 6-hour default.
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Comment thread
aikido-autofix[bot] marked this conversation as resolved.
Resolved
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
with:
# No later step pushes, so the token is not left in the git config for them.
persist-credentials: false

- name: Set up uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

# --locked fails if uv.lock has drifted from pyproject.toml, so a
# dependency change that was not re-locked cannot merge.
- name: Install dependencies
run: uv sync --extra dev --locked

- name: Lint
run: uv run ruff check .

- name: Type check
run: uv run mypy stackone_adk

- name: Test
run: uv run pytest -v
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,30 @@ ruff check stackone_adk/ tests/
mypy stackone_adk/
```

### Integration smoke test

The test suite replaces `StackOneToolSet` with a `MagicMock`, so it passes regardless of how
the SDK behaves — it cannot catch an SDK regression. The
[sdk-conformance](https://github.com/StackOneHQ/sdk-conformance) repo carries a smoke script
that drives the real SDK through the real plugin against a mock StackOne API, asserting the
plugin exposes exactly the tool catalog the server listed:

It expects `stackone-adk-plugin` and `stackone-ai-python` checked out beside it. From the
directory that holds this checkout:

```bash
git clone [email protected]:StackOneHQ/sdk-conformance.git
git clone [email protected]:StackOneHQ/stackone-ai-python.git
cd sdk-conformance && pnpm install
./scripts/run_smoke.sh adk
Comment on lines +277 to +280
Comment thread
willleeney marked this conversation as resolved.
Resolved
```

To use checkouts elsewhere, set `ADK=` and `SDK_PY=` to their paths.

This is not wired into CI because `sdk-conformance` is a private repository and this repo has
no credential configured to clone it. Wiring it up needs a deploy key or PAT secret added
here first.

Try an example (requires at least one provider connected in your [StackOne Dashboard](https://app.stackone.com), e.g. Workday):

```bash
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ target-version = "py310"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "C4", "UP"]

# python_version is deliberately unset so mypy targets the running interpreter.
# Pinning it to 3.10 made mypy parse dependency stubs with 3.10 grammar while the
# environment could hold 3.12-only packages (numpy >=2.5 uses `type` statements),
# which fails on a syntax error. The CI matrix covers 3.10-3.13 instead.
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
Expand Down
3 changes: 2 additions & 1 deletion stackone_adk/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def __init__(
resolved_api_key = api_key if api_key is not None else os.getenv("STACKONE_API_KEY", "")
if not resolved_api_key:
raise ValueError(
"StackOne API key is required. Set the STACKONE_API_KEY environment variable or pass api_key=..."
"StackOne API key is required. Set the STACKONE_API_KEY environment "
"variable or pass api_key=..."
)
resolved_base_url = base_url or DEFAULT_BASE_URL

Expand Down
2 changes: 0 additions & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
from unittest.mock import MagicMock

import pytest
from google.genai import types

from stackone_adk.tools import StackOneAdkTool


# --- Helper ---


Expand Down
Loading
Loading