-
Notifications
You must be signed in to change notification settings - Fork 0
Analyze the-watchman and propose new improvements #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,185 @@ | ||||
| name: CI/CD Pipeline | ||||
|
|
||||
| on: | ||||
| push: | ||||
| branches: [ main, develop, 'claude/**' ] | ||||
| pull_request: | ||||
| branches: [ main, develop ] | ||||
|
|
||||
| env: | ||||
| PYTHON_VERSION: "3.11" | ||||
|
|
||||
| jobs: | ||||
| code-quality: | ||||
| name: Code Quality Checks | ||||
| runs-on: ubuntu-latest | ||||
|
|
||||
| steps: | ||||
| - name: Checkout code | ||||
| uses: actions/checkout@v4 | ||||
|
|
||||
| - name: Set up Python | ||||
| uses: actions/setup-python@v5 | ||||
| with: | ||||
| python-version: ${{ env.PYTHON_VERSION }} | ||||
| cache: 'pip' | ||||
|
|
||||
| - name: Install dependencies | ||||
| run: | | ||||
| python -m pip install --upgrade pip | ||||
| pip install -r requirements.txt | ||||
| pip install -r requirements-dev.txt | ||||
|
|
||||
| - name: Run Black (Code Formatting Check) | ||||
| run: | | ||||
| black --check --diff app/ domains/ tests/ scripts/ | ||||
|
|
||||
| - name: Run Ruff (Linting) | ||||
| run: | | ||||
| ruff check app/ domains/ tests/ scripts/ | ||||
|
|
||||
| - name: Run mypy (Type Checking) | ||||
| run: | | ||||
| mypy app/ domains/ scripts/ | ||||
| continue-on-error: true # Allow failures initially during migration | ||||
|
|
||||
| - name: Check import sorting (isort) | ||||
| run: | | ||||
| isort --check-only --diff app/ domains/ tests/ scripts/ | ||||
|
|
||||
| test: | ||||
| name: Run Tests | ||||
| runs-on: ubuntu-latest | ||||
| needs: code-quality | ||||
|
||||
| needs: code-quality |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The needs: test dependency on line 130 creates unnecessary serialization. The Docker build test is independent of test results and could run in parallel with the test job. This would reduce total CI time. Consider removing this dependency to improve CI performance.
| needs: test |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safety check on line 177 may fail in CI without proper authentication. Safety 3.0+ requires an API key for full functionality. Since this is set to continue-on-error: true, failures will be silent. Consider either:
- Adding a SAFETY_API_KEY secret to the repository
- Downgrading to Safety 2.x in requirements-dev.txt
- Removing this check if API key management is not desired
This aligns with the issue identified in requirements-dev.txt regarding Safety version.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # Pre-commit hooks for The Watchman project | ||
| # Install: pip install pre-commit && pre-commit install | ||
| # Run manually: pre-commit run --all-files | ||
|
|
||
| repos: | ||
| # General file checks | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.5.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| args: [--markdown-linebreak-ext=md] | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| args: [--unsafe] # Allow custom tags in docker-compose.yml | ||
| - id: check-toml | ||
| - id: check-json | ||
| - id: check-added-large-files | ||
| args: [--maxkb=1000] | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
| - id: detect-private-key | ||
| - id: mixed-line-ending | ||
| args: [--fix=lf] | ||
|
|
||
| # Code formatting with Black | ||
| - repo: https://github.com/psf/black | ||
| rev: 23.12.1 | ||
| hooks: | ||
| - id: black | ||
| language_version: python3.11 | ||
| args: [--line-length=100] | ||
|
|
||
| # Import sorting with isort | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.13.2 | ||
| hooks: | ||
| - id: isort | ||
| args: [--profile=black, --line-length=100] | ||
|
|
||
| # Linting with Ruff (fast Python linter) | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.1.9 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --exit-non-zero-on-fix] | ||
|
|
||
| # Type checking with mypy | ||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.8.0 | ||
| hooks: | ||
| - id: mypy | ||
| additional_dependencies: | ||
| - types-requests | ||
| - types-PyYAML | ||
| - types-python-dateutil | ||
| - pydantic | ||
| args: [--ignore-missing-imports, --show-error-codes] | ||
| exclude: ^(tests/|scripts/comfy_inventory_watcher.py) | ||
|
|
||
| # Security linting with Bandit | ||
| - repo: https://github.com/PyCQA/bandit | ||
| rev: 1.7.6 | ||
| hooks: | ||
| - id: bandit | ||
| args: [-c, pyproject.toml] | ||
| additional_dependencies: ["bandit[toml]"] | ||
| exclude: ^tests/ | ||
|
|
||
| # Dockerfile linting | ||
| - repo: https://github.com/hadolint/hadolint | ||
| rev: v2.12.0 | ||
| hooks: | ||
| - id: hadolint-docker | ||
| args: [--ignore, DL3008, --ignore, DL3013] | ||
|
|
||
| # Markdown linting | ||
| - repo: https://github.com/igorshubovych/markdownlint-cli | ||
| rev: v0.38.0 | ||
| hooks: | ||
| - id: markdownlint | ||
| args: [--fix] | ||
|
|
||
| # YAML linting | ||
| - repo: https://github.com/adrienverge/yamllint | ||
| rev: v1.33.0 | ||
| hooks: | ||
| - id: yamllint | ||
| args: [-c=.yamllint.yml] | ||
|
|
||
| # Run on commit by default | ||
| default_install_hook_types: [pre-commit, pre-push] | ||
| default_stages: [commit] | ||
|
|
||
| # Faster parallel execution | ||
| fail_fast: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| extends: default | ||
|
|
||
| rules: | ||
| line-length: | ||
| max: 120 | ||
| level: warning | ||
| indentation: | ||
| spaces: 2 | ||
| indent-sequences: true | ||
| comments: | ||
| min-spaces-from-content: 1 | ||
| document-start: disable | ||
| truthy: | ||
| allowed-values: ['true', 'false', 'on', 'off'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow introduced in this commit only triggers on pushes to
main,develop, orclaude/**and on PRs targetingmain/develop. However, the repository’s current work happens on theworkbranch (this commit itself is onwork), so developers pushing to the branch they actively collaborate on will never get any CI feedback. That defeats the purpose of adding this pipeline because regressions can land onworkunchecked until someone happens to open a PR tomain. Please include theworkbranch (or broaden the glob) in both thepushandpull_requesttriggers so every change in this repo actually runs the new checks.Useful? React with 👍 / 👎.