Skip to content

Commit 45e71e3

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/typescript-7.0.2
2 parents 32634f6 + 94bd4b3 commit 45e71e3

58 files changed

Lines changed: 2080 additions & 2779 deletions

Some content is hidden

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

.github/WORKFLOWS.md

Lines changed: 36 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,21 @@ All workflows have been enhanced with:
2525

2626
**Jobs:**
2727

28-
- **Build and Test** (Matrix: Node.js 18.x, 20.x):
28+
- **Build and Test** (Matrix: Node.js 20.x, 22.x)*skipped for Dependabot*:
2929
- ✅ Install dependencies with npm ci
3030
- ✅ TypeScript type checking via `npm run typecheck`
3131
-**Run Vitest tests** with `npm run test:run`
3232
- ✅ Frontend build verification (Vite)
3333
- ✅ C++ server compilation with Make
3434
- ✅ Binary verification
35-
- ✅ Upload build artifacts (dist/ and omnigrid_server)
36-
- **Code Quality Check**:
35+
- ✅ Upload build artifacts (dist/ and omnigrid_server) for Node 20.x
36+
- **Dependabot Smoke** (Node 20 only) — *only for Dependabot PRs*:
37+
- ✅ Typecheck + unit tests (lightweight gate; no matrix / C++ / coverage)
38+
- **Code Quality Check** (always runs, including Dependabot — **Prettier gate**):
3739
-**ESLint** validation with `npm run lint`
38-
-**Prettier** format checking with `npm run format:check`
39-
- ✅ Console.log detection (fails build if found in source)
40+
-**Prettier** format checking with `npm run format:check` (fails CI on drift)
4041
- ✅ TODO/FIXME comment detection (warning only)
41-
- **Test Coverage**:
42+
- **Test Coverage***skipped for Dependabot*:
4243
- ✅ Run tests with coverage reporting
4344
- ✅ Upload coverage artifacts
4445
-**Post coverage report as PR comment**
@@ -188,7 +189,7 @@ All workflows have been enhanced with:
188189

189190
**Schedule:** Weekly on Monday at 09:00 UTC
190191

191-
**Purpose:** Automated dependency updates
192+
**Purpose:** Automated dependency updates with grouped PRs to reduce noise
192193

193194
**Ecosystems:**
194195

@@ -199,25 +200,43 @@ All workflows have been enhanced with:
199200

200201
- Automatic PR creation for updates
201202
- Weekly schedule to minimize noise
202-
- Labels: `dependencies`, `automated`
203+
- Labels: `dependencies`, `npm` / `github-actions`, `automated`
203204
- Auto-reviewers assigned
205+
- **Grouped updates** (noise reduction):
206+
- `production-dependencies` — minor/patch production deps
207+
- `development-dependencies` — minor/patch dev deps
208+
- `eslint-stack` — eslint, @eslint/*, @typescript-eslint/*
209+
- `vitest-stack` — vitest, @vitest/*
210+
- `testing-library`@testing-library/*
211+
- `github-actions` — all Actions minor/patch bumps
212+
- Major updates still open as individual PRs for review
204213

205214
---
206215

207216
### Auto-merge Dependabot (`auto-merge-dependabot.yml`)
208217

209218
**Triggers:** Pull Request events from Dependabot
210219

211-
**Purpose:** Automatically merge safe dependency updates
220+
**Purpose:** Automatically merge safe dependency updates and apply metadata labels
212221

213222
**Jobs:**
214223

215224
- **Auto-merge**:
216-
- ✅ Fetch Dependabot metadata
225+
- ✅ Fetch Dependabot metadata (`dependabot/fetch-metadata@v2`)
226+
-**Ensure metadata labels exist** (`semver-major`, `semver-minor`, `semver-patch`, `production`, `development`, `npm`, `github-actions`)
227+
-**Apply metadata labels** based on update-type, dependency-type, and package-ecosystem
217228
- ✅ Check update type (major/minor/patch)
218229
- ✅ Auto-approve minor and patch updates
219230
- ✅ Enable auto-merge for safe updates
220-
- ✅ Comment on major updates requiring manual review
231+
- ✅ Comment on major updates requiring manual review (with `semver-major` label)
232+
233+
**Metadata labels applied:**
234+
235+
| Label | Source |
236+
|-------|--------|
237+
| `semver-major` / `semver-minor` / `semver-patch` | `update-type` |
238+
| `production` / `development` | `dependency-type` |
239+
| `npm` / `github-actions` | `package-ecosystem` |
221240

222241
**Safety:** Only auto-merges minor and patch updates
223242

@@ -430,7 +449,7 @@ File: `.github/labeler.yml`
430449

431450
**Automatic Labels:**
432451

433-
- `documentation`: Changes to docs/\*_ or _.md files
452+
- `documentation`: Changes to docs/\*_ or \*.md files
434453
- `frontend`: Changes to components/, widgets/, \*.tsx files
435454
- `backend`: Changes to server/ or C++ files
436455
- `services`: Changes to services/
@@ -444,71 +463,14 @@ File: `.github/labeler.yml`
444463
- `size/S`: 10-49 lines changed
445464
- `size/M`: 50-199 lines changed
446465
- `size/L`: 200-499 lines changed
447-
- `size/XL`: 500+ lines changed
448-
449-
---
450-
451-
## 🛠️ Development Commands
452-
453-
### New Scripts Added
454-
455-
```bash
456-
# Testing
457-
npm test # Run tests in watch mode
458-
npm run test:run # Run tests once
459-
npm run test:ui # Run tests with UI
460-
npm run test:coverage # Run tests with coverage report
461-
462-
# Linting & Formatting
463-
npm run lint # Run ESLint
464-
npm run lint:fix # Fix ESLint issues
465-
npm run format # Format all files with Prettier
466-
npm run format:check # Check formatting without changing files
467-
468-
# Type Checking
469-
npm run typecheck # Run TypeScript type checking
470-
471-
# Building
472-
npm run build # Build frontend
473-
npm run build:server # Build C++ server
474-
npm run build:all # Build both frontend and server
475-
npm run assets:generate # Generate screenshot asset manifest locally
476-
npm run artifacts:generate # Generate build artifact manifest locally (requires prior `npm run build`)
477-
```
466+
- `size/XL`: ≥ 500 lines changed
478467

479468
---
480469

481-
## 🎯 Best Practices
482-
483-
### For Contributors
484-
485-
1. ✅ Run `npm run lint` and `npm run format:check` before committing
486-
2. ✅ Run `npm run test:run` to ensure all tests pass
487-
3. ✅ Keep PRs focused and reasonably sized (< 500 lines when possible)
488-
4. ✅ Update documentation for new features
489-
5. ✅ Add tests for bug fixes and new features
490-
6. ✅ Follow the PR template guidelines
491-
7. ✅ Ensure all CI checks pass before requesting review
492-
493-
### For Maintainers
494-
495-
1. ✅ Review security alerts from CodeQL and Dependabot promptly
496-
2. ✅ Monitor workflow performance reports
497-
3. ✅ Keep dependencies up to date
498-
4. ✅ Review and merge Dependabot PRs regularly
499-
5. ✅ Use workflow badges in README to communicate project health
500-
6. ✅ Check test coverage trends
501-
502-
---
503-
504-
## 🔧 Maintenance
505-
506-
### Regular Tasks
470+
## 🔄 Maintenance Schedule
507471

508-
- **Daily**: Automated dependency audits and stale issue checks
509-
- **Weekly**:
510-
- Review Dependabot PRs
511-
- Check CodeQL security scan results
472+
- **Daily**: Stale bot, dependency audit (scheduled)
473+
- **Weekly**: Dependabot version updates (Monday 09:00 UTC), CodeQL
512474
- **Monthly**: Review stale issues and PRs manually
513475
- **Quarterly**:
514476
- Review and update workflow configurations
@@ -537,5 +499,5 @@ npm run artifacts:generate # Generate build artifact manifest locally (requires
537499

538500
---
539501

540-
_Last Updated: 2026-05-28_
502+
_Last Updated: 2026-08-20_
541503
_For questions or issues with workflows, please open an issue with the `ci-cd` label._

.github/dependabot.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,44 @@ updates:
1212
- 'GizzZmo'
1313
labels:
1414
- 'dependencies'
15+
- 'npm'
1516
- 'automated'
1617
commit-message:
1718
prefix: 'chore(deps):'
1819
include: 'scope'
20+
# Group updates to reduce PR noise
21+
groups:
22+
production-dependencies:
23+
dependency-type: 'production'
24+
update-types:
25+
- 'minor'
26+
- 'patch'
27+
development-dependencies:
28+
dependency-type: 'development'
29+
update-types:
30+
- 'minor'
31+
- 'patch'
32+
eslint-stack:
33+
patterns:
34+
- 'eslint*'
35+
- '@eslint/*'
36+
- '@typescript-eslint/*'
37+
update-types:
38+
- 'minor'
39+
- 'patch'
40+
vitest-stack:
41+
patterns:
42+
- 'vitest*'
43+
- '@vitest/*'
44+
update-types:
45+
- 'minor'
46+
- 'patch'
47+
testing-library:
48+
patterns:
49+
- '@testing-library/*'
50+
update-types:
51+
- 'minor'
52+
- 'patch'
1953

2054
# Enable version updates for GitHub Actions
2155
- package-ecosystem: 'github-actions'
@@ -34,3 +68,10 @@ updates:
3468
commit-message:
3569
prefix: 'chore(actions):'
3670
include: 'scope'
71+
groups:
72+
github-actions:
73+
patterns:
74+
- '*'
75+
update-types:
76+
- 'minor'
77+
- 'patch'

.github/workflows/assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v6
2929

3030
- name: Setup Node.js
31-
uses: actions/setup-node@v6
31+
uses: actions/setup-node@v7
3232
with:
3333
node-version: 20.x
3434

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v6
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v6
27+
uses: actions/setup-node@v7
2828
with:
2929
node-version: 20.x
3030
cache: 'npm'

.github/workflows/auto-merge-dependabot.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions:
88
contents: write
99
pull-requests: write
10+
issues: write
1011

1112
jobs:
1213
auto-merge:
@@ -21,6 +22,64 @@ jobs:
2122
with:
2223
github-token: '${{ secrets.GITHUB_TOKEN }}'
2324

25+
- name: Ensure metadata labels exist
26+
run: |
27+
# Create SemVer + dependency-type labels if missing (idempotent)
28+
declare -A LABELS=(
29+
["semver-major"]="Major version bump — requires manual review"
30+
["semver-minor"]="Minor version bump"
31+
["semver-patch"]="Patch version bump"
32+
["production"]="Production / runtime dependency"
33+
["development"]="Development / tooling dependency"
34+
["npm"]="npm package ecosystem"
35+
["github-actions"]="GitHub Actions ecosystem"
36+
)
37+
for name in "${!LABELS[@]}"; do
38+
gh label create "$name" \
39+
--description "${LABELS[$name]}" \
40+
--color "0366d6" \
41+
--force 2>/dev/null || true
42+
done
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Apply Dependabot metadata labels
47+
run: |
48+
PR_URL="${{ github.event.pull_request.html_url }}"
49+
LABELS=()
50+
51+
# SemVer labels from update-type
52+
case "${{ steps.metadata.outputs.update-type }}" in
53+
version-update:semver-major) LABELS+=("semver-major") ;;
54+
version-update:semver-minor) LABELS+=("semver-minor") ;;
55+
version-update:semver-patch) LABELS+=("semver-patch") ;;
56+
esac
57+
58+
# Dependency type (direct:production / direct:development / indirect)
59+
DEP_TYPE="${{ steps.metadata.outputs.dependency-type }}"
60+
if [[ "$DEP_TYPE" == *"production"* ]]; then
61+
LABELS+=("production")
62+
elif [[ "$DEP_TYPE" == *"development"* ]]; then
63+
LABELS+=("development")
64+
fi
65+
66+
# Package ecosystem
67+
case "${{ steps.metadata.outputs.package-ecosystem }}" in
68+
npm) LABELS+=("npm") ;;
69+
github_actions) LABELS+=("github-actions") ;;
70+
esac
71+
72+
# Apply any collected labels
73+
if [ ${#LABELS[@]} -gt 0 ]; then
74+
LABEL_ARGS=$(printf -- '--add-label %s ' "${LABELS[@]}")
75+
gh pr edit "$PR_URL" $LABEL_ARGS
76+
echo "Applied labels: ${LABELS[*]}"
77+
else
78+
echo "No additional metadata labels to apply"
79+
fi
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
2483
- name: Check if safe to auto-merge
2584
id: check_safe
2685
run: |
@@ -55,5 +114,5 @@ jobs:
55114
issue_number: context.issue.number,
56115
owner: context.repo.owner,
57116
repo: context.repo.repo,
58-
body: '⚠️ **Major version update detected!** Please review this PR manually before merging.'
117+
body: '⚠️ **Major version update detected!** Please review this PR manually before merging.\n\nLabel `semver-major` has been applied for triage.'
59118
})

0 commit comments

Comments
 (0)