Skip to content

Commit 413b0e8

Browse files
committed
feat: context selection for git diff
1 parent 9665967 commit 413b0e8

58 files changed

Lines changed: 15739 additions & 373 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ updates:
33
- package-ecosystem: "pip"
44
directory: "/"
55
schedule:
6-
interval: "daily"
6+
interval: "weekly"
7+
day: "saturday"
8+
time: "10:00"
9+
timezone: "Europe/Berlin"
710
labels:
811
- "dependencies"
912
assignees:
@@ -19,7 +22,10 @@ updates:
1922
- package-ecosystem: "github-actions"
2023
directory: "/"
2124
schedule:
22-
interval: "daily"
25+
interval: "weekly"
26+
day: "sunday"
27+
time: "10:00"
28+
timezone: "Europe/Berlin"
2329
labels:
2430
- "dependencies"
2531
assignees:

.github/workflows/cd.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
id: commit_version
7878
run: |
7979
git config user.name "github-actions[bot]"
80+
# 41898282 is GitHub's bot user ID for github-actions[bot]
8081
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
8182
git add src/treemapper/version.py
8283
if ! git diff --staged --quiet; then
@@ -86,7 +87,7 @@ jobs:
8687
fi
8788
COMMIT_SHA=$(git rev-parse HEAD)
8889
echo "Commit SHA: $COMMIT_SHA"
89-
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
90+
echo "commit_sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT"
9091
9192
- name: Check tag doesn't already exist
9293
run: |
@@ -112,7 +113,7 @@ jobs:
112113
git bundle create repo.bundle --all
113114
114115
- name: Upload bundle as artifact
115-
uses: actions/upload-artifact@v6
116+
uses: actions/upload-artifact@v4
116117
with:
117118
name: git-repo-bundle
118119
path: repo.bundle
@@ -121,8 +122,8 @@ jobs:
121122
- name: Set outputs
122123
id: set_outputs
123124
run: |
124-
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
125-
echo "tag_name=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
125+
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
126+
echo "tag_name=v${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
126127
127128
build-assets:
128129
name: Build Assets
@@ -143,7 +144,7 @@ jobs:
143144
runs-on: ${{ matrix.os }}
144145
steps:
145146
- name: Download git bundle
146-
uses: actions/download-artifact@v7
147+
uses: actions/download-artifact@v4
147148
with:
148149
name: git-repo-bundle
149150

@@ -218,7 +219,7 @@ jobs:
218219
echo "Detected ARM on macOS"
219220
fi
220221
echo "Determined ARCH: $ARCH"
221-
echo "arch=$ARCH" >> $GITHUB_OUTPUT
222+
echo "arch=$ARCH" >> "$GITHUB_OUTPUT"
222223
223224
- name: Rename asset with proper name
224225
shell: bash
@@ -234,7 +235,7 @@ jobs:
234235
fi
235236
236237
- name: Upload artifact
237-
uses: actions/upload-artifact@v6
238+
uses: actions/upload-artifact@v4
238239
with:
239240
name: ${{ matrix.asset_name }}-binary
240241
path: ./repo/dist/treemapper-*
@@ -252,7 +253,7 @@ jobs:
252253
id-token: write
253254
steps:
254255
- name: Download git bundle
255-
uses: actions/download-artifact@v7
256+
uses: actions/download-artifact@v4
256257
with:
257258
name: git-repo-bundle
258259

@@ -317,7 +318,7 @@ jobs:
317318
runs-on: ubuntu-latest
318319
steps:
319320
- name: Download git bundle
320-
uses: actions/download-artifact@v7
321+
uses: actions/download-artifact@v4
321322
with:
322323
name: git-repo-bundle
323324

@@ -342,6 +343,7 @@ jobs:
342343
working-directory: ./repo
343344
run: |
344345
git config user.name "github-actions[bot]"
346+
# 41898282 is GitHub's bot user ID for github-actions[bot]
345347
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
346348
347349
# Push the version bump commit to main
@@ -353,7 +355,7 @@ jobs:
353355
echo "Successfully pushed version commit and tag"
354356
355357
- name: Download all build artifacts
356-
uses: actions/download-artifact@v7
358+
uses: actions/download-artifact@v4
357359
with:
358360
path: ./artifacts
359361

.github/workflows/ci.yml

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ jobs:
5151
- name: Checkout Code
5252
uses: actions/checkout@v6
5353

54-
- name: Set up Python 3.11
54+
- name: Set up Python 3.10
5555
uses: actions/setup-python@v6
5656
with:
57-
python-version: '3.11'
57+
python-version: '3.10'
5858

5959
- name: Cache pip Dependencies
6060
uses: actions/cache@v5
6161
with:
6262
path: ~/.cache/pip
63-
key: ${{ runner.os }}-lint-pip-${{ hashFiles('**/pyproject.toml') }}
63+
key: ${{ runner.os }}-lint-pip-3.10-${{ hashFiles('**/pyproject.toml') }}
6464
restore-keys: |
65-
${{ runner.os }}-lint-pip-
65+
${{ runner.os }}-lint-pip-3.10-
6666
6767
- name: Install Linters and Type Checker
6868
run: |
@@ -87,7 +87,7 @@ jobs:
8787
fail-fast: false
8888
matrix:
8989
os: [ubuntu-latest, macos-latest, windows-latest]
90-
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
90+
python-version: ['3.10', '3.11', '3.12', '3.13']
9191

9292
runs-on: ${{ matrix.os }}
9393

@@ -112,7 +112,7 @@ jobs:
112112
- name: Install Dependencies
113113
run: |
114114
python -m pip install --upgrade pip
115-
pip install -e .[dev]
115+
pip install -e ".[dev,full]"
116116
117117
- name: Run Tests with Coverage
118118
shell: bash
@@ -121,9 +121,8 @@ jobs:
121121
--cov-report=term-missing --cov-branch --junitxml=test-results.xml
122122
123123
- name: Coverage report with threshold
124-
if: runner.os == 'Linux' && matrix.python-version == '3.12'
125124
run: |
126-
coverage report --fail-under=80 --skip-covered --show-missing
125+
coverage report --fail-under=80
127126
128127
- name: Upload coverage reports to Codecov
129128
if: runner.os == 'Linux' && matrix.python-version == '3.12'
@@ -136,7 +135,7 @@ jobs:
136135
verbose: true
137136

138137
- name: Upload coverage for SonarCloud
139-
uses: actions/upload-artifact@v6
138+
uses: actions/upload-artifact@v4
140139
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
141140
with:
142141
name: coverage-report
@@ -154,7 +153,7 @@ jobs:
154153
strategy:
155154
fail-fast: false
156155
matrix:
157-
python-version: [pypy-3.9, pypy-3.10]
156+
python-version: [pypy-3.10, pypy-3.11]
158157

159158
steps:
160159
- name: Checkout Code
@@ -177,11 +176,10 @@ jobs:
177176
run: |
178177
python -m pip install --upgrade pip
179178
pip install -e .
180-
pip install pytest pytest-cov
179+
pip install pytest
181180
182181
- name: Run Tests
183-
run: |
184-
pytest -v
182+
run: pytest -v
185183

186184
# ============================================================================
187185
# Mutation Testing (test effectiveness validation)
@@ -210,9 +208,8 @@ jobs:
210208
211209
- name: Run mutation testing
212210
run: |
213-
mutmut run . || true
211+
mutmut run || true
214212
mutmut results || true
215-
continue-on-error: true
216213
217214
# ============================================================================
218215
# Complexity & Maintainability Metrics
@@ -297,51 +294,3 @@ jobs:
297294
298295
- name: Check import contracts
299296
run: lint-imports
300-
continue-on-error: true
301-
302-
# ============================================================================
303-
# SonarCloud Quality Gate
304-
# Evidence: Complexity/duplication metrics correlate with defect density
305-
# ============================================================================
306-
sonarcloud:
307-
name: SonarCloud Analysis
308-
runs-on: ubuntu-latest
309-
needs: test
310-
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
311-
312-
steps:
313-
- uses: actions/checkout@v6
314-
with:
315-
fetch-depth: 0
316-
317-
- name: Download coverage reports
318-
uses: actions/download-artifact@v7
319-
with:
320-
name: coverage-report
321-
path: .
322-
323-
- name: Verify coverage files exist
324-
run: |
325-
echo "=== Checking for coverage files ==="
326-
ls -lh coverage.xml test-results.xml || true
327-
echo "=== Coverage.xml source paths ==="
328-
head -10 coverage.xml || true
329-
330-
- name: Create sonar-project.properties
331-
run: |
332-
cat > sonar-project.properties <<EOF
333-
sonar.projectKey=nikolay-e_treemapper
334-
sonar.organization=nikolay-e
335-
sonar.sources=src/treemapper
336-
sonar.tests=tests
337-
sonar.python.coverage.reportPaths=coverage.xml
338-
sonar.python.xunit.reportPath=test-results.xml
339-
sonar.python.version=3.9,3.10,3.11,3.12,3.13
340-
EOF
341-
342-
- name: SonarCloud Scan
343-
uses: SonarSource/sonarcloud-github-action@ba3875ecf642b2129de2b589510c81a8b53dbf4e # master
344-
env:
345-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
347-
continue-on-error: true

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ __pycache__/
55

66
# C extensions
77
*.so
8-
8+
tree.yaml
99
# Distribution / packaging
1010
.Python
1111
build/

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/

0 commit comments

Comments
 (0)