Skip to content

Commit b165a51

Browse files
authored
Merge pull request #17 from SillyLittleTech/kr/cleanup+docu
Cleanup Repo and Fix stray instances of old URL
2 parents 779a239 + 0aa9468 commit b165a51

44 files changed

Lines changed: 966 additions & 2624 deletions

Some content is hidden

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

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
- type: markdown
99
attributes:
1010
value: |
11-
Thanks for logging a bug! Fill out the details below so future-you can knock it out fast.
11+
Thanks for logging a bug! Fill out the details below so I can review it and knock it out fast.
1212
- type: input
1313
id: scope
1414
attributes:

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
- type: markdown
88
attributes:
99
value: |
10-
Outline the problem and desired outcome. Future-you will thank you for the clarity.
10+
Outline the problem and desired outcome. I will thank you for the clarity.
1111
- type: textarea
1212
id: problem
1313
attributes:

.github/copilot-instructions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,9 @@ If any section is unclear or you want more repo file examples, say which area to
9393
- Keep the macOS Swift companion `DashCam!` in `$DashCam!/`: it manages `npm run dev` and `npx playwright codegen` processes, so update `DashboardViewModel`/`ProcessController` plus the packaged `DashCam.app` or `dashcam_swift.tgz` whenever those workflows change.
9494
- Route-level additions should flow through `src/AppRouter.tsx` with helpers from `src/utils/navigation.ts`; render privacy/legal pages inside React rather than shipping standalone static HTML.
9595
- When you adjust repository guidance, update both `AGENTS.md` and this file so instructions stay in sync.
96+
## Security & ZAP Scanning
97+
98+
- All security headers are centrally configured in `security-headers.config.ts` and deployed via `public/_headers` (Cloudflare Pages), `firebase.json` (Firebase Hosting), and `vite.config.ts` (local preview).
99+
- The ZAP workflow scans `https://your.website` nightly; check `.zap-ignore` for known/accepted alerts.
100+
- When ZAP reports issues, verify headers are in `public/_headers` and deployed properly before adding to `.zap-ignore`.
101+
- Use `safeConsoleWarn()` and `safeConsoleError()` from `src/utils/errorSanitizer.ts` instead of raw console methods to prevent information disclosure.

.github/workflows/ImportEnvVar.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/README.md

Lines changed: 124 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,124 @@
1-
# Project Board Automation Workflow
2-
3-
This workflow automates issue and pull request management in the "Portfolio Devmt" GitHub project.
4-
5-
## Quick Reference
6-
7-
### Triggers
8-
9-
| Event | Action | Result |
10-
|-------|--------|--------|
11-
| New Issue Created | `issues: opened` | ✅ Added to "Backlog" |
12-
| PR Opened (links issue) | `pull_request: opened` | ✅ Linked issues → "In Progress" |
13-
| PR Converted to Draft | `pull_request: converted_to_draft` | ✅ Linked issues → "In Progress" |
14-
| PR Ready for Review | `pull_request: ready_for_review` | ✅ Linked issues → "In Review" |
15-
| PR Merged | `pull_request: closed` (merged=true) | ✅ Linked issues → "In Review" |
16-
| PR Closed (not merged) | `pull_request: closed` (merged=false) | ⏭️ No status change |
1+
# GitHub Actions Workflows
2+
3+
This directory contains automated workflows for the portfolio project. Workflows have been consolidated for better efficiency and ease of maintenance.
4+
5+
## Active Workflows (10)
6+
7+
### Core Automation
8+
- **`automation-suite.yml`** - Comprehensive issue & PR automation
9+
- Adds new issues to project board with "Backlog" status
10+
- Updates issue status based on linked PR state (In Progress → In Review)
11+
- Syncs labels between linked issues and PRs
12+
- Syncs milestones between linked issues and PRs
13+
- Auto-labels ZAP security scan issues
14+
15+
### Quality & Testing
16+
- **`pr-screenshot.yml`** - E2E Testing Suite
17+
- Generates screenshots (web & mobile, light & dark themes)
18+
- Runs accessibility tests using axe-core
19+
- Publishes results to GitHub Pages
20+
- Comments on PRs with visual results
21+
22+
- **`lhci.yml`** - Lighthouse CI & Comment Cleanup
23+
- Runs Lighthouse performance/accessibility audits
24+
- Creates review comments with audit results
25+
- Cleans up outdated SonarQube comments
26+
- Removes stale Lighthouse review comments
27+
28+
- **`lychee.yml`** - Link Checker
29+
- Validates all links in repository
30+
- Checks links in built site (dist/)
31+
32+
### Security
33+
- **`codeql.yml`** - CodeQL Security Scanning
34+
- Scans JavaScript/TypeScript code
35+
- Scans Swift code (macOS dashboard)
36+
- Only runs when relevant files change
37+
38+
- **`zap.yml`** - ZAP Security Baseline Scan
39+
- Runs nightly at 06:00 UTC
40+
- Scans production site (https://your.website)
41+
- Creates issues for security findings
42+
43+
- **`security-headers-parity.yml`** - Security Headers Verification
44+
- Verifies security headers are synchronized across:
45+
- `security-headers.config.ts`
46+
- `vite.config.ts`
47+
- `public/_headers`
48+
- `firebase.json`
49+
50+
### Build & Deployment
51+
- **`swift-dashboard-build.yml`** - macOS Dashboard Build
52+
- Builds the Swift DashCam! companion app
53+
- Only runs when Swift files change
54+
55+
### Maintenance
56+
- **`dependabot-automerge.yml`** - Dependabot Auto-merge
57+
- Automatically merges Dependabot PRs
58+
- Uses squash merge strategy
59+
60+
- **`restyled.yml`** - Code Style Reformatting
61+
- Manual trigger only (workflow_dispatch)
62+
- Applies consistent code formatting
63+
64+
## Consolidation Summary
65+
66+
**Original:** 23 workflows
67+
**Current:** 10 workflows
68+
**Reduction:** 57% fewer workflows
69+
70+
### Merged Workflows
71+
72+
The following workflows were consolidated into existing workflows:
73+
74+
| Removed Workflow | Merged Into | Reason |
75+
|-----------------|-------------|--------|
76+
| `sync-issue-labels.yml` | `automation-suite.yml` | Duplicate label syncing logic |
77+
| `project-automation.yml` | `automation-suite.yml` | Duplicate project board logic |
78+
| `github-projects-integration.yml` | `automation-suite.yml` | Incomplete implementation |
79+
| `project-board-automation.yml` | `automation-suite.yml` | Contains actual GraphQL implementation |
80+
| `label-zap-issues.yml` | `automation-suite.yml` | Issue automation fits suite pattern |
81+
| `cleanup-sonar-comments.yml` | `lhci.yml` | Both clean up PR comments |
82+
| `a11y-axe.yml` | `pr-screenshot.yml` | Both use Playwright, can run together |
83+
84+
### Removed Workflows
85+
86+
The following workflows were removed as they were disabled or incomplete:
87+
88+
- `firebase-hosting-merge.yml` - Disabled (Cloudflare Pages handles deploys)
89+
- `firebase-hosting-pull-request.yml` - Disabled (Cloudflare Pages handles previews)
90+
- `cloudflare-pages-preview.yml` - Disabled (temporarily paused)
91+
- `cloudflare-pages-merge.yml` - Disabled (temporarily paused)
92+
- `ImportEnvVar.yml` - Incomplete (no name or triggers)
93+
94+
## Benefits of Consolidation
95+
96+
1. **Reduced Runner Time**: Fewer workflow runs mean less compute time and faster CI/CD
97+
2. **Better Context**: Related automation is grouped together
98+
3. **Easier Maintenance**: Changes to related logic can be made in one place
99+
4. **Improved Debugging**: Related actions are in the same workflow logs
100+
5. **Simplified Permissions**: Consolidated permissions are easier to audit
101+
102+
## Workflow Triggers Summary
103+
104+
| Workflow | Trigger | Frequency |
105+
|----------|---------|-----------|
106+
| `automation-suite.yml` | Issues & PRs | On event |
107+
| `pr-screenshot.yml` | PRs & main push | On event |
108+
| `lhci.yml` | PRs | On event |
109+
| `lychee.yml` | PRs | On event |
110+
| `codeql.yml` | PRs & main push | On event (with path filters) |
111+
| `zap.yml` | Schedule | Nightly at 06:00 UTC |
112+
| `security-headers-parity.yml` | PRs & main push | On event (with path filters) |
113+
| `swift-dashboard-build.yml` | PRs & main push | On event (with path filters) |
114+
| `dependabot-automerge.yml` | Dependabot PRs | On event |
115+
| `restyled.yml` | Manual | On demand |
116+
117+
## Project Board Automation Details
17118

18119
### Issue Linking Formats
19120

20-
The workflow detects issue references in PR titles and bodies:
121+
The automation suite detects issue references in PR titles and bodies:
21122

22123
- Simple reference: `#123`
23124
- Closing keywords: `fixes #123`, `closes #123`, `resolves #123`
@@ -35,73 +136,11 @@ New Issue → Backlog
35136
PR Merged → In Review (GitHub automation → Done)
36137
```
37138

38-
### Implementation Details
39-
40-
**Technology**: GitHub Actions + GraphQL API (Projects V2)
41-
42-
**Key Features**:
43-
- ✅ Handles multiple PRs linked to a single issue
44-
- ✅ Extracts issue numbers using regex pattern matching
45-
- ✅ Uses GitHub Projects V2 GraphQL API
46-
- ✅ Comprehensive error handling and logging
47-
- ✅ No external dependencies or PAT required
48-
49-
**Permissions Required**:
50-
- `issues: write`
51-
- `pull-requests: write`
52-
- `contents: read`
53-
54-
### Testing
55-
56-
To test the workflow:
57-
58-
1. Create a test issue (should appear in Backlog)
59-
2. Create a PR with "Fixes #[issue-number]" in description
60-
3. Check issue moved to "In Progress"
61-
4. Mark PR as ready for review
62-
5. Check issue moved to "In Review"
63-
64-
### Related Files
65-
66-
- **Workflow**: `.github/workflows/project-board-automation.yml`
67-
- **Documentation**: `AUTOMATION.md`
68-
- **Project**: Create at `https://github.com/[username]?tab=projects`
69-
70-
## Architecture
71-
72-
### Job 1: `add-issue-to-backlog`
73-
74-
1. Triggers on `issues: opened`
75-
2. Queries user projects to find "Portfolio Devmt"
76-
3. Adds issue using `addProjectV2ItemById` mutation
77-
4. Sets status to "Backlog" using `updateProjectV2ItemFieldValue`
78-
79-
### Job 2: `manage-pr-status`
80-
81-
1. Triggers on PR events (opened, closed, ready_for_review, converted_to_draft)
82-
2. Extracts linked issue numbers from PR text
83-
3. Determines target status based on PR state
84-
4. Queries project to find issue items
85-
5. Updates status for each linked issue
86-
87-
## Customization
88-
89-
To modify the workflow for your needs:
90-
91-
1. **Change project name**: Update `PROJECT_NAME` environment variable
92-
2. **Change status names**: Update the status name strings in the workflow
93-
3. **Add organization support**: Replace `user(login: $owner)` with `organization(login: $owner)` in GraphQL queries
94-
4. **Modify status transitions**: Edit the logic in the `manage-pr-status` job
95-
96-
## Maintenance
97-
98-
The workflow is self-contained and requires minimal maintenance:
99-
100-
- ✅ No external services or APIs
101-
- ✅ No secrets or PAT required (uses GITHUB_TOKEN)
102-
- ✅ Comprehensive logging for debugging
103-
- ✅ Graceful error handling
139+
## Notes
104140

105-
---
141+
- All workflows use `actions/github-script@v7` for consistency
142+
- Workflows use proper concurrency groups to prevent conflicts
143+
- Most workflows cache dependencies (npm, Playwright browsers) for speed
144+
- Path filters prevent unnecessary runs when unrelated files change
145+
- No external services or secrets required beyond GITHUB_TOKEN
106146

107-
For detailed setup instructions, see [AUTOMATION.md](../../AUTOMATION.md)

.github/workflows/a11y-axe.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)