Skip to content

chore: enable ruff security rules and update dependencies (CLIM-1536) - #153

Merged
mortenoh merged 3 commits into
mainfrom
chore/ruff-security-rules
Oct 28, 2026
Merged

mortenoh merged 3 commits into
mainfrom
chore/ruff-security-rules

Conversation

@mortenoh

@mortenoh mortenoh commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Enable the ruff S (flake8-bandit) rules.
  • Product code fixes: replace control-flow asserts in chapkit artifact with explicit checks (asserts vanish under python -O), and narrow a bare except Exception: pass in project discovery to OSError/TOMLDecodeError.
  • Inline suppressions with reasons where the pattern is intended: unpickling the service's own training workspace (ml/manager.py), exec of the project's main.py in chapkit mlproject export, the random data seed in chapkit test.
  • Per-file ignores for tests, scripts/, examples/ and the seeded data generator.
  • Update servicekit to 3.1.0 (minimum raised to >=3.1.0).
  • uv lock --upgrade ahead of the release (fastapi 0.162, starlette 1.10, pandas 3.1, polars 2.1, sqlalchemy 2.1.6, python-dateutil 3.0, among others).

Note: run_shell (utils.py) uses asyncio.create_subprocess_shell, which the S rules do not cover; that belongs with the review findings rather than this change.

Test plan

  • make lint (ruff, mypy, pyright)
  • uv run pytest with all extras (1103 passed)

Jira: CLIM-1536

Fix the findings in product code (asserts used for control flow, a bare
except-pass) and suppress the intended ones (pickle of the service's own
training workspace, exec in export, seeded random data). Tests, scripts
and examples ignore the rules that only matter for product code.
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mortenoh mortenoh changed the title chore: enable ruff security rules and update servicekit (CLIM-1536) chore: enable ruff security rules and update dependencies (CLIM-1536) Oct 28, 2026
@mortenoh
mortenoh merged commit a05d972 into main Oct 28, 2026
5 checks passed
@mortenoh
mortenoh deleted the chore/ruff-security-rules branch October 28, 2026 14:04
@mortenoh mortenoh mentioned this pull request Oct 28, 2026
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