Compare commits

...

3 Commits

Author SHA1 Message Date
Otto
aab33c4e14 fix: make overlap check informational only (always green)
- Add continue-on-error: true to workflow
- Remove sys.exit(1) on conflicts
- Check is meant to inform contributors, not block merging
2026-02-13 13:07:45 +00:00
Otto
db77f6ef77 refactor: reorganize script functions top-down
- main() and high-level workflow functions at the top
- Comment formatting functions
- Overlap analysis functions
- Merge conflict testing functions
- Diff parsing functions
- GitHub API functions
- Utility functions
- Data classes and constants at the bottom

This makes the code read top-to-bottom, from high-level logic to implementation details.
2026-02-13 13:05:23 +00:00
Otto
6647c6615b ci: add PR overlap detection workflow
Automatically detects potential merge conflicts between open PRs:

- Triggered on PR open/push to dev or master
- Compares changed files and line ranges across open PRs
- Tests actual merge conflicts by attempting merges
- Posts a comment on the PR with:
  - 🔴 Confirmed merge conflicts (with file paths and conflict sizes)
  - 🟠 High risk overlaps (>20 lines overlap)
  - 🟡 Medium risk overlaps
  - 🟢 Low risk (file overlap only)
- Shows conflict types (content, added, deleted, etc.)
- Includes last-updated timestamps for each PR

This helps contributors coordinate and resolve conflicts proactively.
2026-02-13 12:51:18 +00:00
2 changed files with 1095 additions and 0 deletions

1056
.github/scripts/detect_overlaps.py vendored Normal file

File diff suppressed because it is too large Load Diff

39
.github/workflows/pr-overlap-check.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: PR Overlap Detection
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- dev
- master
permissions:
contents: read
pull-requests: write
jobs:
check-overlaps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for merge testing
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Configure git
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Run overlap detection
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Always succeed - this check informs contributors, it shouldn't block merging
continue-on-error: true
run: |
python .github/scripts/detect_overlaps.py ${{ github.event.pull_request.number }}