Skip to content

feat: add git hooks and related changes#5

Merged
xernobyl merged 9 commits intomainfrom
feat/git-hooks2
Jan 24, 2026
Merged

feat: add git hooks and related changes#5
xernobyl merged 9 commits intomainfrom
feat/git-hooks2

Conversation

@xernobyl
Copy link
Contributor

Summary

This PR expands the CI workflow with comprehensive quality checks and adds git hooks for local development. It also improves the Makefile with better tool detection and separates unit tests from integration tests.

Changes

CI Workflow Enhancements

  • Removed API_KEY secret requirement - Uses hardcoded test key for CI
  • Added dependency verification - Verifies go.mod and go.sum are in sync
  • Added code quality checks:
    • Code formatting check (make fmt-check)
    • Linter (make lint)
    • Security vulnerability scan (govulncheck)
  • Added comprehensive testing:
    • Unit tests (make test-unit) - Fast, no database required
    • Integration tests (make tests) - Full database tests
  • Removed operation exclusion - All endpoints now tested by Schemathesis

Git Hooks

  • Added pre-commit hook (.githooks/pre-commit):
    • Secret detection (warning only)
    • Automatic code formatting with gofumpt
    • Linting with golangci-lint
    • Blocks commits if checks fail
  • Added make install-hooks target to install hooks
  • Updated make dev-setup to automatically install hooks

Makefile Improvements

  • Added test-unit target - Runs unit tests only (fast)
  • Improved tool detection - Uses command -v instead of hardcoded paths
  • Updated fmt and fmt-check - Better error messages and tool detection
  • Updated schemathesis - Removed operation exclusion

Test Updates

  • Fixed config tests to handle required API_KEY environment variable

Testing

The CI workflow now runs:

  1. Dependency verification
  2. Code formatting check
  3. Linter
  4. Security scan
  5. Unit tests
  6. Integration tests
  7. Build verification
  8. API contract tests

All checks must pass for PRs to be merged.

@xernobyl xernobyl marked this pull request as ready for review January 23, 2026 15:22
@xernobyl xernobyl enabled auto-merge January 23, 2026 16:22
Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@xernobyl thank you for the PR :-) It looks good and I love the new checks that we now have. I'll also make them mandatory for every PR to pass once the PR is merged.

I made a few smaller updates including pinning all versions of the go tools used.

@xernobyl xernobyl added this pull request to the merge queue Jan 24, 2026
Merged via the queue into main with commit c571c5a Jan 24, 2026
5 checks passed
@mattinannt mattinannt deleted the feat/git-hooks2 branch January 29, 2026 08:43
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