Skip to content

chore:add GitHub CI for tests#18

Merged
bsatrom merged 2 commits intomainfrom
bsatrom/montgomery-v5
Apr 17, 2026
Merged

chore:add GitHub CI for tests#18
bsatrom merged 2 commits intomainfrom
bsatrom/montgomery-v5

Conversation

@bsatrom
Copy link
Copy Markdown
Member

@bsatrom bsatrom commented Apr 17, 2026

Summary

Adds three GitHub Actions workflows that run tests automatically on every pull request:

  • test-dashboard.yml: Type check (tsc), lint, and 394 Vitest tests — triggers on songbird-dashboard/ changes
  • test-infrastructure.yml: Build and 450 Vitest tests — triggers on songbird-infrastructure/ changes
  • test-firmware.yml: PlatformIO native Unity tests (91 tests) — triggers on songbird-firmware/ changes

Each workflow is scoped to only run when its component directory is modified.

🤖 Generated with Claude Code

bsatrom and others added 2 commits April 16, 2026 17:51
Add test workflows for dashboard (vitest + tsc + lint), infrastructure
(vitest), and firmware (PlatformIO native Unity tests). Each triggers
only on PRs that modify its respective directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove lint step from dashboard workflow (no eslint config exists).
Add esbuild as explicit devDependency to infrastructure to fix npm ci
resolution on Node 20/npm 10.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bsatrom bsatrom merged commit e53fd04 into main Apr 17, 2026
3 checks passed
bsatrom added a commit that referenced this pull request Apr 17, 2026
…signature

Merge origin/main to pick up the test suite added in #18, resolve import
conflict in DeviceDetail.tsx (kept Satellite icon from this PR), and update
5 assertions in alerts.test.ts to match getAlerts's new apiGet(url, params)
call pattern introduced by this PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bsatrom added a commit that referenced this pull request Apr 17, 2026
Merge origin/main to pick up the test suite from #18, then update the
3 GET /analytics/feedback tests to include cognito:groups=Admin in the
authorizer JWT claims, matching the admin-group check this PR adds to
the handler. Also adds a new test covering the 403 denial path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bsatrom added a commit that referenced this pull request Apr 17, 2026
Merge origin/main to pick up the test suite from #18, then update the
3 GET /analytics/feedback tests to include cognito:groups=Admin in the
authorizer JWT claims, matching the admin-group check this PR adds to
the handler. Also adds a new test covering the 403 denial path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bsatrom added a commit that referenced this pull request Apr 17, 2026
…r + react-query refactors

- Merge origin/main to pull in the test suite from #18; resolve
  DeviceDetail.tsx import conflict (keep Satellite icon added here).
- Rewrite analytics.test.ts to mock the ./client helpers
  (apiFetch/apiGet/apiPost/apiPut/apiPatch/apiDelete) instead of the
  old global fetch + fetchAuthSession pattern, matching analytics.ts's
  refactor to call those helpers.
- Wrap useAuth hook tests in a QueryClientProvider and disable retry/
  retryDelay on the test QueryClient, since useAuth now backs its
  hooks with @tanstack/react-query.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bsatrom added a commit that referenced this pull request Apr 17, 2026
… error handling, security hardening (#5)

* fix(infra): SQL injection via parameterized queries, admin check on feedback endpoint, restrict device auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(infra): remove marketplace IAM permission, use crypto.randomUUID for alert IDs, add ACKNOWLEDGED constant

- Remove aws-marketplace:Subscribe and aws-marketplace:ViewSubscriptions from chat query Lambda IAM role; a Lambda should never be able to subscribe to paid Marketplace products
- Scope bedrock:InvokeModel to specific Claude 3.5 Sonnet ARN prefixes instead of wildcard *
- Replace Math.random() alert ID generation with crypto.randomUUID() in api-ingest — eliminates 5-6 char collision window at high throughput, uses built-in Node 20 crypto module
- Add ACKNOWLEDGED constant (TRUE/FALSE string literals) to shared/constants.ts — prevents accidental boolean writes that break the DynamoDB GSI partition key
- Import and use ACKNOWLEDGED constant in api-alerts and api-ingest at all write and query sites
- Add marshallOptions: { removeUndefinedValues: true } to DynamoDB document clients in api-alerts and api-devices — matches the pattern already used in api-ingest, prevents latent runtime errors on optional fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: merge main and update feedback.test.ts for admin-group auth

Merge origin/main to pick up the test suite from #18, then update the
3 GET /analytics/feedback tests to include cognito:groups=Admin in the
authorizer JWT claims, matching the admin-group check this PR adds to
the handler. Also adds a new test covering the 403 denial path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
bsatrom added a commit that referenced this pull request Apr 17, 2026
…ed string constants (#6)

* fix(infra): SQL injection via parameterized queries, admin check on feedback endpoint, restrict device auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: merge main and update feedback.test.ts for admin-group auth

Merge origin/main to pick up the test suite from #18, then update the
3 GET /analytics/feedback tests to include cognito:groups=Admin in the
authorizer JWT claims, matching the admin-group check this PR adds to
the handler. Also adds a new test covering the 403 denial path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant