Skip to content

ci: add CI (compile/lint/tests/audit) + Dependabot - #25

Merged
jhamon merged 2 commits into
mainfrom
chore/add-ci
Aug 28, 2026
Merged

jhamon merged 2 commits into
mainfrom
chore/add-ci

Conversation

@jhamon

@jhamon jhamon commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Adds CI to a repo that had tests (tests/test_query.py, 10 mocked unit tests) but no CI. Jobs: compile + ruff error-lint + mocked unit tests (dummy PINECONE_API_KEY; live tests excluded) + pip-audit. Plus least-privilege permissions and Dependabot (pip + github-actions). Verified locally: 10 tests pass, ruff clean, pip-audit clean.


Note

Low Risk
Changes are limited to GitHub workflow and Dependabot config; no application or dependency version changes in this diff.

Overview
Introduces GitHub Actions CI and Dependabot for a repo that already had mocked unit tests but no automation.

The ci.yml workflow now runs on pushes to main and on PRs, with concurrency so in-flight runs cancel when a newer commit lands. The test job upgrades the runner to Python 3.12 (with pip cache), sets a dummy PINECONE_API_KEY so mocked tests can run without secrets, and adds byte-compile, Ruff checks (error-level rules only), and verbose pytest on tests/test_query.py instead of only running pytest. A separate audit job runs pip-audit against requirements.txt.

dependabot.yml schedules weekly updates for pip (minor/patch grouped, cap of 10 open PRs) and github-actions (cap of 5).

Reviewed by Cursor Bugbot for commit 117efdd. Bugbot is set up for automated code reviews on this repo. Configure here.

This repo had tests (tests/test_query.py) but no CI ran them. Add a merge gate:
- Install deps, byte-compile, ruff error-level lint.
- Run the mocked unit tests (pytest tests/test_query.py) with a dummy
  PINECONE_API_KEY (query.py constructs a Pinecone client at import). The live
  tests in tests/test_live.py are excluded — they need real keys and an index.
- pip-audit gate (currently 0 vulnerabilities).
Plus least-privilege permissions and Dependabot (pip + github-actions).

Verified locally: 10 unit tests pass, ruff clean, pip-audit clean.
Resolves add/add conflict in .github/workflows/ci.yml. Main's workflow
(2d4991d) ran the offline unit tests; this branch's workflow runs the same
pytest tests/test_query.py plus compile, ruff, and pip-audit, so the
branch version is kept in full.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 117efdd. Configure here.

Comment thread .github/workflows/ci.yml
ruff check --select E9,F63,F7,F82 .

- name: Run mocked unit tests
run: pytest tests/test_query.py -v

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI pytest hardcodes test filename

Medium Severity

CI invokes pytest on the hardcoded file tests/test_query.py instead of auto-discovering unit tests. Offline unit tests and live integration tests are not split with pytest markers or directories, so the workflow cannot use a stable command such as pytest tests/ -m "not live" and will miss new unit tests unless the workflow is edited.

Fix in Cursor Fix in Web

Triggered by learned rule: CI pytest must auto-discover unit tests

Reviewed by Cursor Bugbot for commit 117efdd. Configure here.

@jhamon
jhamon merged commit 334d490 into main Aug 28, 2026
6 of 7 checks passed
@jhamon
jhamon deleted the chore/add-ci branch August 28, 2026 16:57
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.

1 participant