Skip to content

ci: add CI workflow and refresh the dependency lock - #26

Open
willleeney wants to merge 1 commit into
mainfrom
ci/add-workflow-and-refresh-lock
Open

willleeney wants to merge 1 commit into
mainfrom
ci/add-workflow-and-refresh-lock

Conversation

@willleeney

@willleeney willleeney commented Sep 14, 2026

Copy link
Copy Markdown

Summary

This repo had no CI — no .github directory, nothing running on a pull request. This adds a workflow gating lint, type check and tests across the supported 3.10–3.13 matrix, and refreshes a lockfile that had gone stale.

Lockfile drift

uv.lock was pinned to stackone-ai 2.8.0 (2.10.1 released) and google-adk 1.31.1 (2.9.0 released). Both are refreshed here.

Nothing broke on the newer versions — all 32 tests pass on the upgraded stack, including across a major google-adk bump. The drift was stale pinning, not an incompatibility. The workflow uses uv sync --locked, so a dependency change that was not re-locked can no longer merge silently.

Two fixes needed to make CI green on arrival

Adding gates that fail immediately would be pointless, so:

Three pre-existing ruff violations — a 113-char line in plugin.py, an unsorted import block, and an unused google.genai.types import in tests/test_tools.py.

mypy's hardcoded python_version = "3.10". This one is worth reading. It forced mypy to parse dependency stubs with 3.10 grammar while the environment can legitimately contain 3.12-only packages. numpy ≥2.5 (requires-python >=3.12, reached transitively via stackone-ai) uses type statements, so mypy died on a syntax error inside numpy's own .pyi:

numpy/__init__.pyi:737: error: Type statement is only supported in Python 3.12 and greater  [syntax]

The pin was incoherent — it asserted "check as 3.10" while the installed tree could be 3.12-only. Unsetting it targets the running interpreter, so each matrix job checks against its own version. That is also broader coverage than the pin gave. Verified end to end:

Python numpy resolved ruff mypy pytest
3.10 2.2.6 pass pass 32 passed
3.11 2.2.6 pass pass 32 passed
3.12 2.5.3 pass pass 32 passed
3.13 2.5.3 pass pass 32 passed

Integration smoke test — documented, not wired

The suite here replaces StackOneToolSet with a MagicMock; the real SDK is imported exactly once, for an exception class. It therefore passes regardless of SDK behaviour and cannot catch an SDK regression.

sdk-conformance carries a smoke script that drives the real SDK through the real plugin against a mock StackOne API. I ran it against this branch's refreshed dependencies — it passes, including that the plugin's declaration carries a raw JSON Schema rather than a lossy rebuild.

It is not wired into CI: sdk-conformance is a private repository and this repo has no secret configured to clone it (gh secret list is empty, and I do not have admin here to add one). Wiring it needs a deploy key or PAT added first. Until then the README documents how to run it locally.

Deliberately not done

ruff format is not gated — two files carry pre-existing formatting drift, and reformatting them is unrelated to adding CI. Worth a separate pass if you want formatting enforced.

🤖 Generated with Claude Code


Summary by cubic

Adds CI to this repo (previously none) and refreshes a stale uv.lock. The workflow gates ruff, mypy, and pytest on Python 3.10–3.13 with uv sync --locked, so a dependency change that isn't re-locked can no longer merge.

Dependencies

  • uv.lock had drifted to stackone-ai 2.8.0 and google-adk 1.31.1; both are refreshed to 2.10.1 and 2.9.0, and all 32 tests pass on the newer stack.

Notes

  • Removes mypy's hardcoded python_version = "3.10" (it broke on numpy ≥2.5's type statements) and fixes three pre-existing ruff violations so the gates are green on arrival.
  • The integration smoke test is documented in the README but not wired into CI; this repo has no credential to clone sdk-conformance.
  • ruff format is not gated; two files carry pre-existing formatting drift.

Written for commit dde8c1c. Summary will update on new commits.

Review in cubic

There was no CI in this repo — nothing ran on a pull request. Adds a workflow
gating lint, type check and tests across the supported 3.10-3.13 matrix.

`uv sync --locked` is used so a dependency change that was not re-locked cannot
merge. That immediately mattered: uv.lock had drifted to stackone-ai 2.8.0 while
2.10.1 was released, and google-adk 1.31.1 while 2.9.0 was released. Both are
refreshed here and the suite passes on the new versions, so the drift was stale
pinning rather than an incompatibility.

Two fixes were needed to make the gates green rather than red on arrival:

- Three pre-existing ruff violations (a 113-char line, an unsorted import block,
  an unused `google.genai.types` import).

- mypy's hardcoded `python_version = "3.10"`. It made mypy parse dependency
  stubs with 3.10 grammar while the environment can hold 3.12-only packages —
  numpy >=2.5 (requires-python >=3.12, reached transitively via stackone-ai)
  uses `type` statements, which failed as a syntax error. Unsetting it targets
  the running interpreter instead, so each matrix job checks against its own
  version. Verified on 3.10 (numpy 2.2.6) through 3.13 (numpy 2.5.3).

`ruff format` is deliberately not gated: two files carry pre-existing formatting
drift, and reformatting them is unrelated to adding CI.
Copilot AI lite review requested due to automatic review settings September 14, 2026 07:32
Comment thread .github/workflows/ci.yaml
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Action actions/checkout persist Git credentials in workflow - low severity
This actions/checkout step relies on the action's default persist-credentials behavior (true) instead of explicitly configuring it. With that unsafe default, actions/checkout v2 and above persists the GITHUB_TOKEN in the repository's local git config (or, on more recent versions, in a file under $RUNNER_TEMP) for the rest of the workflow run. Subsequent workflow steps or third-party actions can read this token, increasing the risk of credential theft or misuse within the pipeline. This finding is only raised when the step relies on the implicit default; a step that explicitly sets persist-credentials: true because the workflow performs an authenticated git push is not flagged.

Show fix

Remediation: Explicitly set persist-credentials: false on actions/checkout steps that do not need to push commits back to the repository, rather than relying on the unsafe default. If the workflow does perform an authenticated git push, explicitly set persist-credentials: true so the intent is documented and this step won't be re-flagged.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds CI checks across Python 3.10–3.13 and refreshes dependency locking.

Changes:

  • Adds locked dependency installation, linting, mypy, and pytest workflow.
  • Updates dependencies and mypy configuration.
  • Documents integration smoke-test execution and fixes lint issues.
File summaries
File Description
tests/test_tools.py Updated as part of this pull request.
stackone_adk/plugin.py Updated as part of this pull request.
README.md Updated as part of this pull request.
pyproject.toml Updated as part of this pull request.
.github/workflows/ci.yaml Updated as part of this pull request.
Review details
  • Files reviewed: 5/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment on lines +274 to +276
git clone git@github.com:StackOneHQ/sdk-conformance.git
cd sdk-conformance && pnpm install
./scripts/run_smoke.sh adk

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/ci.yaml">

<violation number="1" location=".github/workflows/ci.yaml:20">
P3: The `ci` job has no `timeout-minutes`, so with GitHub's 6-hour per-job default a hung step (blocked package download or a non-terminating test) keeps the runner busy for up to 6 hours across each of the 4 matrix legs. Set a job-level `timeout-minutes: 15` (or similar) relative to install/lint/type/test times.</violation>

<violation number="2" location=".github/workflows/ci.yaml:27">
P3: Set `persist-credentials: false` for this checkout. The action defaults to persisting the GitHub token for the rest of the job, which exposes a credential to later workflow steps that do not need repository write authentication.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:274">
P3: Clone the smoke-test repositories as siblings before running the script. The current example puts `sdk-conformance` inside `stackone-adk-plugin` and never creates the required `stackone-ai-python` checkout, so a fresh run cannot resolve the documented paths.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread .github/workflows/ci.yaml

jobs:
ci:
runs-on: ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The ci job has no timeout-minutes, so with GitHub's 6-hour per-job default a hung step (blocked package download or a non-terminating test) keeps the runner busy for up to 6 hours across each of the 4 matrix legs. Set a job-level timeout-minutes: 15 (or similar) relative to install/lint/type/test times.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yaml, line 20:

<comment>The `ci` job has no `timeout-minutes`, so with GitHub's 6-hour per-job default a hung step (blocked package download or a non-terminating test) keeps the runner busy for up to 6 hours across each of the 4 matrix legs. Set a job-level `timeout-minutes: 15` (or similar) relative to install/lint/type/test times.</comment>

<file context>
@@ -0,0 +1,47 @@
+
+jobs:
+  ci:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
</file context>

Comment thread README.md
Comment on lines +274 to +276
git clone git@github.com:StackOneHQ/sdk-conformance.git
cd sdk-conformance && pnpm install
./scripts/run_smoke.sh adk

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Clone the smoke-test repositories as siblings before running the script. The current example puts sdk-conformance inside stackone-adk-plugin and never creates the required stackone-ai-python checkout, so a fresh run cannot resolve the documented paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 274:

<comment>Clone the smoke-test repositories as siblings before running the script. The current example puts `sdk-conformance` inside `stackone-adk-plugin` and never creates the required `stackone-ai-python` checkout, so a fresh run cannot resolve the documented paths.</comment>

<file context>
@@ -262,6 +262,27 @@ ruff check stackone_adk/ tests/
+plugin exposes exactly the tool catalog the server listed:
+
+```bash
+git clone git@github.com:StackOneHQ/sdk-conformance.git
+cd sdk-conformance && pnpm install
+./scripts/run_smoke.sh adk
</file context>
Suggested change
git clone git@github.com:StackOneHQ/sdk-conformance.git
cd sdk-conformance && pnpm install
./scripts/run_smoke.sh adk
git clone git@github.com:StackOneHQ/sdk-conformance.git ../sdk-conformance
git clone git@github.com:StackOneHQ/stackone-ai-python.git ../stackone-ai-python
cd ../sdk-conformance && pnpm install
./scripts/run_smoke.sh adk

Comment thread .github/workflows/ci.yaml
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Set persist-credentials: false for this checkout. The action defaults to persisting the GitHub token for the rest of the job, which exposes a credential to later workflow steps that do not need repository write authentication.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yaml, line 27:

<comment>Set `persist-credentials: false` for this checkout. The action defaults to persisting the GitHub token for the rest of the job, which exposes a credential to later workflow steps that do not need repository write authentication.</comment>

<file context>
@@ -0,0 +1,47 @@
+        python-version: ["3.10", "3.11", "3.12", "3.13"]
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+      - name: Set up uv
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants