Problem Statement
There appears to be significant overlap between our pre-commit hooks and GitHub CI/CD workflows, particularly in the quality checks. This redundancy may be creating unnecessary maintenance overhead.
Current Redundancies
Quality Checks in Both Systems
Pre-commit hooks (.pre-commit-config.yaml):
- Ruff linting (
--fix --exit-non-zero-on-fix)
- Ruff formatting
- MyPy type checking
- MCP documentation compliance checks
GitHub CI/CD (.github/workflows/test.yml):
- Ruff linting (
ruff check src/ tests/)
- Ruff format check (
ruff format --check src/ tests/)
- MyPy type checking (
mypy src/databeak/)
- MCP documentation compliance checks (separate job)
Questions to Address
-
Should we simplify CI/CD? Could we replace the individual quality check steps with a single pre-commit run --all-files command?
-
What are the trade-offs?
- Pro: Single source of truth for quality checks, easier maintenance
- Con: Less granular GitHub Actions output, potentially slower feedback
- Con: Pre-commit uses
--fix mode, CI/CD should be read-only
-
What should remain separate?
- Test execution (unit/integration) - clearly separate concern
- Multi-version testing (Python 3.12, 3.13) - matrix strategy
- Coverage reporting to Codecov - CI/CD specific
-
Hybrid approach? Could we:
- Use
pre-commit run --all-files in CI/CD for most checks
- Override specific hooks to use read-only mode (e.g.,
--check for ruff)
- Keep tests as separate jobs
Proposed Investigation
Additional Context
Pre-commit strengths:
- Runs locally before commits (shift-left testing)
- Auto-fix capabilities
- Comprehensive hook ecosystem
- pre-commit.ci for automated PR fixes
GitHub Actions strengths:
- Matrix testing across Python versions
- Integration with GitHub UI
- Codecov integration
- Can run on different triggers (push, PR, schedule)
Expected Outcome
A clear strategy for:
- Which checks should run where
- How to minimize duplication while maintaining effectiveness
- Whether to adopt
pre-commit run --all-files in CI/CD or keep current approach
- Documentation of the rationale for our chosen approach
Labels: enhancement, ci/cd, maintenance, discussion
Problem Statement
There appears to be significant overlap between our pre-commit hooks and GitHub CI/CD workflows, particularly in the quality checks. This redundancy may be creating unnecessary maintenance overhead.
Current Redundancies
Quality Checks in Both Systems
Pre-commit hooks (
.pre-commit-config.yaml):--fix --exit-non-zero-on-fix)GitHub CI/CD (
.github/workflows/test.yml):ruff check src/ tests/)ruff format --check src/ tests/)mypy src/databeak/)Questions to Address
Should we simplify CI/CD? Could we replace the individual quality check steps with a single
pre-commit run --all-filescommand?What are the trade-offs?
--fixmode, CI/CD should be read-onlyWhat should remain separate?
Hybrid approach? Could we:
pre-commit run --all-filesin CI/CD for most checks--checkfor ruff)Proposed Investigation
pre-commit run --all-filesin CI environmentpre-commit.ciservice as alternativeAdditional Context
Pre-commit strengths:
GitHub Actions strengths:
Expected Outcome
A clear strategy for:
pre-commit run --all-filesin CI/CD or keep current approachLabels:
enhancement,ci/cd,maintenance,discussion