Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 11 additions & 28 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
# golangci-lint configuration
# See: https://golangci-lint.run/usage/configuration/
# GolangCI-Lint configuration for LeafLock backend
# Centralized under .github/linters for CI reuse

# This version is required for golangci-lint v2.x+
version: "2"

run:
timeout: 5m
tests: true
# Use issues.exclude-dirs instead of skip-dirs (deprecated)

issues:
# Exclude directories from linting
exclude-dirs:
- .gomod
- vendor
- node_modules
- frontend
exclude-files:
- ".*_test.go"
- ".*.pb.go"
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

linters:
default: none
enable:
- errcheck
- govet
- staticcheck
- ineffassign
- staticcheck
- unused
- errcheck
# Note: Only using core linters compatible with all golangci-lint versions

linters-settings:
govet:
check-shadowing: true
gofmt:
simplify: true
staticcheck:
checks: ["all"]
issues:
max-issues-per-linter: 0
max-same-issues: 0

severity:
default: error
19 changes: 1 addition & 18 deletions .github/linters/.sqlfluff
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
# SQLFluff Configuration
# SQLFluff configuration centralized for CI
# See: https://docs.sqlfluff.com/en/stable/configuration.html

[sqlfluff]
# Set dialect to PostgreSQL
dialect = postgres

# Exclude directories
exclude_rules = L034,L031

# Templater configuration
templater = raw

# File encoding
encoding = utf-8

[sqlfluff:indentation]
# Indentation rules
indented_joins = false
indented_using_on = true
template_blocks_indent = true

[sqlfluff:layout:type:comma]
# Comma placement
spacing_before = touch
line_position = trailing

[sqlfluff:rules]
# Allow longer lines for complex queries
max_line_length = 120

# Disable overly strict rules
# L034: Select wildcards (SELECT *) - common in migrations
# L031: Avoid aliases in FROM/JOIN - too strict for complex queries

[sqlfluff:rules:L010]
# Capitalisation of keywords
capitalisation_policy = upper

[sqlfluff:rules:L014]
# Unquoted identifiers
extended_capitalisation_policy = lower

[sqlfluff:rules:L030]
# Function names
capitalisation_policy = upper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Claude Code (on mention - extended)
name: Automation - Claude Assistant

on:
issue_comment:
Expand All @@ -21,39 +21,41 @@ jobs:
# - Issue assigned (body)
# - Manual dispatch
if: >
(
github.event_name == 'issue_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review' &&
github.event.review.body != null &&
contains(toLower(github.event.review.body), '@claude')
) ||
(
github.event_name == 'issues' &&
secrets.CLAUDE_CODE_OAUTH_TOKEN != '' && (
(
github.event_name == 'issue_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review' &&
github.event.review.body != null &&
contains(toLower(github.event.review.body), '@claude')
) ||
(
github.event_name == 'issues' &&
(
github.event.action == 'opened' &&
(
(github.event.issue.body != null && contains(toLower(github.event.issue.body), '@claude')) ||
contains(toLower(github.event.issue.title), '@claude')
github.event.action == 'opened' &&
(
(github.event.issue.body != null && contains(toLower(github.event.issue.body), '@claude')) ||
contains(toLower(github.event.issue.title), '@claude')
)
) ||
(
github.event.action == 'assigned' &&
github.event.issue.body != null &&
contains(toLower(github.event.issue.body), '@claude')
)
) ||
(
github.event.action == 'assigned' &&
github.event.issue.body != null &&
contains(toLower(github.event.issue.body), '@claude')
)
)
) ||
(github.event_name == 'workflow_dispatch')
) ||
(github.event_name == 'workflow_dispatch')
)
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Claude Code Review (on mention - extended)
name: Automation - Claude Code Review

on:
issue_comment:
Expand All @@ -17,23 +17,25 @@ jobs:
# - Submitted PR review body containing @claude
# - Manual dispatch
if: >
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review' &&
github.event.review.body != null &&
contains(toLower(github.event.review.body), '@claude')
) ||
(github.event_name == 'workflow_dispatch')
secrets.CLAUDE_CODE_OAUTH_TOKEN != '' && (
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review_comment' &&
github.event.comment.body != null &&
contains(toLower(github.event.comment.body), '@claude')
) ||
(
github.event_name == 'pull_request_review' &&
github.event.review.body != null &&
contains(toLower(github.event.review.body), '@claude')
) ||
(github.event_name == 'workflow_dispatch')
)
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🏷️ Issue Title Labeler
name: Automation - Issue Labeler

on:
issues:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🔖 Sync Labels
name: Automation - Label Sync

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🏷️ PR Title Labeler
name: Automation - PR Labeler

on:
pull_request_target:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Go Linting with golangci-lint
# Go linting with golangci-lint
# Runs golangci-lint on the backend directory
# Separate from MegaLinter due to Go version requirements (1.25+)
name: 🔍 Go Lint
name: CI - Backend Lint

on:
push:
Expand All @@ -10,15 +10,15 @@ on:
- 'backend/**/*.go'
- 'backend/go.mod'
- 'backend/go.sum'
- 'backend/.golangci.yml'
- '.github/workflows/golangci-lint.yml'
- '.github/linters/.golangci.yml'
- '.github/workflows/ci-backend-lint.yml'
pull_request:
paths:
- 'backend/**/*.go'
- 'backend/go.mod'
- 'backend/go.sum'
- 'backend/.golangci.yml'
- '.github/workflows/golangci-lint.yml'
- '.github/linters/.golangci.yml'
- '.github/workflows/ci-backend-lint.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -43,11 +43,11 @@ jobs:
with:
version: latest
working-directory: backend
args: --config .golangci.yml --timeout 5m
args: --config ../.github/linters/.golangci.yml --timeout 5m

- name: 📊 Report Results
if: always()
run: |
echo "✅ Go linting completed"
echo "Configuration: backend/.golangci.yml"
echo "Configuration: .github/linters/.golangci.yml"
echo "Go version: 1.25"
105 changes: 105 additions & 0 deletions .github/workflows/ci-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI - Code Coverage

on:
pull_request:
push:
branches:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
backend-coverage:
name: Backend Coverage
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: backend

steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version-file: backend/go.mod
cache: true

- name: Install dependencies
run: go mod download

- name: Run coverage suite
run: make test-coverage

- name: Capture coverage summary
run: |
TOTAL_LINE_COVERAGE=$(go tool cover -func=coverage.out | awk '/total:/ {print $3}')
echo "## Backend Coverage" >> "$GITHUB_STEP_SUMMARY"
echo "- Line coverage: ${TOTAL_LINE_COVERAGE}" >> "$GITHUB_STEP_SUMMARY"
echo "- Threshold: 72%" >> "$GITHUB_STEP_SUMMARY"

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: backend-coverage
path: |
backend/coverage.out
backend/coverage.html
retention-days: 14

frontend-coverage:
name: Frontend Coverage
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: frontend

steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.3

- name: Set up Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 20
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run coverage suite
run: pnpm run test:coverage

- name: Capture coverage summary
run: |
SUMMARY_FILE="coverage/coverage-summary.json"
if [ -f "$SUMMARY_FILE" ]; then
LINES=$(jq -r '.total.lines.pct' "$SUMMARY_FILE")
STATEMENTS=$(jq -r '.total.statements.pct' "$SUMMARY_FILE")
echo "## Frontend Coverage" >> "$GITHUB_STEP_SUMMARY"
echo "- Lines: ${LINES}%" >> "$GITHUB_STEP_SUMMARY"
echo "- Statements: ${STATEMENTS}%" >> "$GITHUB_STEP_SUMMARY"
else
echo "## Frontend Coverage" >> "$GITHUB_STEP_SUMMARY"
echo "- Coverage summary not found (expected at coverage/coverage-summary.json)" >> "$GITHUB_STEP_SUMMARY"
fi

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-coverage
path: |
frontend/coverage/**
retention-days: 14
Loading
Loading