feat: update issue templates and workflows; add python compile check and sourcery integration
This commit is contained in:
4
.github/ISSUE_TEMPLATE/alpha-feature.yml
vendored
4
.github/ISSUE_TEMPLATE/alpha-feature.yml
vendored
@@ -50,7 +50,7 @@ body:
|
||||
- [ ] Task 2
|
||||
- [ ] Task 3
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -63,7 +63,7 @@ body:
|
||||
- [ ] Criteria 1
|
||||
- [ ] Criteria 2
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ body:
|
||||
- [ ] Task 2
|
||||
- [ ] Task 3
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -91,7 +91,7 @@ body:
|
||||
- [ ] Updates in real-time
|
||||
- [ ] Performance is acceptable
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ body:
|
||||
- [ ] Task 2
|
||||
- [ ] Task 3
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -90,7 +90,7 @@ body:
|
||||
- [ ] Security test 1
|
||||
- [ ] Security test 2
|
||||
value: |
|
||||
- [ ]
|
||||
- [ ]
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
2
.github/workflows/auto-label-issues.yml
vendored
2
.github/workflows/auto-label-issues.yml
vendored
@@ -69,6 +69,6 @@ jobs:
|
||||
issue_number: issue.number,
|
||||
labels: labels
|
||||
});
|
||||
|
||||
|
||||
console.log(`Added labels: ${labels.join(', ')}`);
|
||||
}
|
||||
|
||||
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -27,6 +27,9 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.dev.txt
|
||||
- name: Run pre-commit
|
||||
run: |
|
||||
pre-commit run --all-files
|
||||
- name: Run ruff
|
||||
run: |
|
||||
ruff check .
|
||||
|
||||
4
.github/workflows/create-labels.yml
vendored
4
.github/workflows/create-labels.yml
vendored
@@ -20,12 +20,12 @@ jobs:
|
||||
{ name: 'high', color: 'D93F0B', description: 'Important feature, should be included' },
|
||||
{ name: 'medium', color: 'FBCA04', description: 'Nice to have, can be deferred' },
|
||||
{ name: 'low', color: '0E8A16', description: 'Future enhancement, not urgent' },
|
||||
|
||||
|
||||
// Milestone labels
|
||||
{ name: 'alpha', color: '5319E7', description: 'Part of initial alpha release' },
|
||||
{ name: 'beta', color: '0052CC', description: 'Part of beta release' },
|
||||
{ name: 'post-beta', color: '006B75', description: 'Post-beta enhancement' },
|
||||
|
||||
|
||||
// Category labels
|
||||
{ name: 'architecture', color: 'C5DEF5', description: 'System design and structure' },
|
||||
{ name: 'backend', color: '1D76DB', description: 'Server-side code' },
|
||||
|
||||
1
.github/workflows/propagate-changes.yml
vendored
1
.github/workflows/propagate-changes.yml
vendored
@@ -93,4 +93,3 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SOURCE_BRANCH: ${{ steps.branches.outputs.source }}
|
||||
TARGET_BRANCH: ${{ steps.branches.outputs.target }}
|
||||
|
||||
|
||||
@@ -5,22 +5,19 @@ repos:
|
||||
- id: black
|
||||
language_version: python3
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.15.0
|
||||
rev: v0.14.5
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix"]
|
||||
- repo: https://github.com/sourcery-ai/sourcery
|
||||
rev: v1.22.0
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: sourcery
|
||||
args: ["--diff=git diff HEAD", "--no-summary", "--min-level=medium"]
|
||||
# Only flag critical, high, and medium severity issues
|
||||
# Low severity issues are excluded as they may be intentional
|
||||
- repo: https://github.com/pre-commit/mirrors-isort
|
||||
rev: v5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
name: isort (python)
|
||||
- id: python-compile
|
||||
name: python compile check
|
||||
entry: tools/python_compile_check.sh
|
||||
language: script
|
||||
files: ".*\\.py$"
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
hooks:
|
||||
@@ -28,8 +25,3 @@ repos:
|
||||
- id: trailing-whitespace
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.6
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: []
|
||||
|
||||
4
.sourcery.yml
Normal file
4
.sourcery.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
version: 1
|
||||
exclude:
|
||||
- frontend/dist/**
|
||||
- frontend/node_modules/**
|
||||
@@ -5,4 +5,4 @@
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,11 +148,11 @@ User actions:
|
||||
1. **Handler Tests** (`backend/internal/api/handlers/*_test.go`)
|
||||
- RemoteServer CRUD tests mirroring `proxy_host_handler_test.go`
|
||||
- Import workflow tests (upload, preview, commit, cancel)
|
||||
|
||||
|
||||
2. **Service Tests** (`backend/internal/services/*_test.go`)
|
||||
- Uniqueness validation tests
|
||||
- Domain conflict detection
|
||||
|
||||
|
||||
3. **Importer Tests** (`backend/internal/caddy/importer_test.go`)
|
||||
- Caddyfile parsing with fixtures in `testdata/`
|
||||
- Host extraction edge cases
|
||||
|
||||
@@ -25,6 +25,8 @@ pre-commit install
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
The `pre-commit` configuration now includes a `python compile check` hook (backed by `python -m compileall`) so syntax errors are caught locally before hitting CI.
|
||||
|
||||
Development notes
|
||||
- Branching model: `development` is the main working branch; create `feature/**` branches from `development`.
|
||||
- CI enforces lint and coverage (75% fail-under) in `.github/workflows/ci.yml`.
|
||||
|
||||
@@ -32,7 +32,7 @@ create_issue() {
|
||||
local title="$1"
|
||||
local labels="$2"
|
||||
local body="$3"
|
||||
|
||||
|
||||
echo "Creating: $title"
|
||||
gh issue create \
|
||||
--repo "$REPO" \
|
||||
|
||||
@@ -12,7 +12,6 @@ pre-commit>=3.4
|
||||
bandit>=1.8
|
||||
tox>=4.11
|
||||
pytest-timeout==2.4.0
|
||||
sourcery>=1.22.0
|
||||
|
||||
|
||||
# Add more dev tools as required
|
||||
|
||||
5
tools/python_compile_check.sh
Executable file
5
tools/python_compile_check.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Run python -m compileall quietly to catch syntax errors in the repo.
|
||||
python -m compileall -q .
|
||||
28
tools/sourcery_precommit_wrapper.sh
Executable file
28
tools/sourcery_precommit_wrapper.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Wrapper for Sourcery pre-commit hook.
|
||||
# Run Sourcery if the CLI is available or a token is provided.
|
||||
# This supports both interactive `sourcery login` and token-based CI usage.
|
||||
|
||||
if command -v sourcery >/dev/null 2>&1; then
|
||||
exec sourcery "$@"
|
||||
fi
|
||||
|
||||
# Try python -m sourcery as a fallback
|
||||
if python -m sourcery --version >/dev/null 2>&1; then
|
||||
exec python -m sourcery "$@"
|
||||
fi
|
||||
|
||||
# If CLI not found but token env var present, try to run via 'sourcery' anyway
|
||||
if [ -n "${SOURCERY_TOKEN:-}" ] || [ -n "${SOURCERY_API_TOKEN:-}" ] || [ -n "${SOURCERY_API_KEY:-}" ]; then
|
||||
if command -v sourcery >/dev/null 2>&1; then
|
||||
exec sourcery "$@"
|
||||
fi
|
||||
if python -m sourcery --version >/dev/null 2>&1; then
|
||||
exec python -m sourcery "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Sourcery CLI not available and no token detected; skipping sourcery pre-commit check."
|
||||
exit 0
|
||||
Reference in New Issue
Block a user