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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Default owners for everything in the repo
* @mlevkov

# Sensitive files require explicit review
Cargo.toml @mlevkov
Cargo.lock @mlevkov
.github/ @mlevkov
deny.toml @mlevkov
32 changes: 24 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,34 @@ jobs:

- name: Check PR size
run: |
# Get changed files excluding lockfiles and generated files
FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path' | grep -v -E '(Cargo\.lock|package-lock\.json|yarn\.lock)$' || true)

if [ -z "$FILES" ]; then
echo "Only lockfiles changed, skipping size check."
exit 0
fi

# Get the number of changed lines
ADDITIONS=$(gh pr view ${{ github.event.pull_request.number }} --json additions -q '.additions')
DELETIONS=$(gh pr view ${{ github.event.pull_request.number }} --json deletions -q '.deletions')
TOTAL=$((ADDITIONS + DELETIONS))

echo "PR changes: +$ADDITIONS -$DELETIONS (total: $TOTAL lines)"

# Warn if PR is large (>500 lines)
# For cleanup PRs (mostly deletions), use additions only
if [ "$DELETIONS" -gt "$ADDITIONS" ]; then
echo "Cleanup PR detected (more deletions than additions). Using additions for size check."
TOTAL=$ADDITIONS
fi

# Warn if PR is large (>500 lines, excluding lockfiles)
if [ "$TOTAL" -gt 500 ]; then
echo "::warning::Large PR detected ($TOTAL lines). Consider breaking into smaller PRs."
fi

# Fail if PR is very large (>1000 lines)
if [ "$TOTAL" -gt 1000 ]; then
echo "::error::PR is too large ($TOTAL lines). Please break into smaller PRs."
exit 1
fi
# Don't fail on size - just warn. Lockfiles can be huge.
# Maintainers can use their judgment.
env:
GH_TOKEN: ${{ github.token }}

Expand All @@ -59,14 +70,17 @@ jobs:

- name: Check commit messages
run: |
# Get all commits in this PR
COMMITS=$(git log --format="%s" origin/${{ github.base_ref }}..HEAD)
# Get all commits in this PR (exclude merge commits)
COMMITS=$(git log --format="%s" --no-merges origin/${{ github.base_ref }}..HEAD)

# Regex for conventional commits
PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+"

FAILED=0
while IFS= read -r commit; do
# Skip empty lines
[ -z "$commit" ] && continue

if [[ ! "$commit" =~ $PATTERN ]]; then
echo "::error::Non-conventional commit: '$commit'"
echo "Expected format: type(scope): description"
Expand Down Expand Up @@ -203,6 +217,8 @@ jobs:
name: PR Checklist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check PR description
run: |
BODY="${{ github.event.pull_request.body }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
name: Create Release
runs-on: ubuntu-latest
needs: [validate, build]
environment: release # Requires manual approval in GitHub settings
steps:
- uses: actions/checkout@v4
with:
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Rust
/target/
**/*.rs.bk
Cargo.lock
# Note: Cargo.lock IS committed for applications (not libraries)
# See: https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control

# IDE
.idea/
Expand All @@ -24,3 +25,9 @@ Thumbs.db

# Test artifacts
*.profraw

# Fuzz testing
fuzz/target/
fuzz/corpus/
fuzz/artifacts/
fuzz/Cargo.lock
Loading
Loading