Commit Graph

87 Commits

Author SHA1 Message Date
WorkClub Automation
271b3c189c chore: commit sisyphus evidence and CI/CD artifacts
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Failing after 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 28s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
2026-03-09 15:05:55 +01:00
WorkClub Automation
867dc717cc fix(shifts): expose ExternalUserId in ShiftSignupDto to fix frontend signup state
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Failing after 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 29s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 3s
2026-03-09 14:46:35 +01:00
WorkClub Automation
6119506bd3 fix(frontend): remove invalid json parsing on shift signup
All checks were successful
CI Pipeline / Backend Build & Test (pull_request) Successful in 53s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 27s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 3s
- Backend `/signup` endpoint returns 200 OK with an empty body (`TypedResults.Ok()`), causing `res.json()` to throw 'Unexpected end of JSON input'. Removed the `res.json()` return.
- Added Suspense boundary in login page to fix `useSearchParams` build error.
2026-03-09 14:25:12 +01:00
WorkClub Automation
1322def2ea fix(auth): resolve Keycloak OIDC issuer mismatch and API proxy routing
Some checks failed
CI Pipeline / Backend Build & Test (pull_request) Successful in 49s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Failing after 26s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
- Bypass NextAuth OIDC discovery with explicit token/userinfo endpoints using internal Docker DNS, avoiding 'issuer string did not match' errors.
- Fix next.config.ts API route interception that incorrectly forwarded NextAuth routes to backend by using 'fallback' rewrites.
- Add 'Use different credentials' button to login page and AuthGuard for clearing stale sessions.
2026-03-09 14:21:03 +01:00
WorkClub Automation
a8730245b2 fix(backend): resolve shift signup by looking up Member via ExternalUserId
All checks were successful
CI Pipeline / Backend Build & Test (pull_request) Successful in 52s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 29s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 5s
The signup/cancel endpoints were passing the Keycloak sub claim (external UUID)
directly as MemberId, but ShiftSignup.MemberId references the internal Member.Id.
Now ShiftService resolves ExternalUserId to the internal Member.Id before creating
the signup record. Integration tests updated to seed proper Member entities.
2026-03-09 13:24:50 +01:00
1117cf2004 Merge pull request 'fix(frontend): restore member self-assignment for shifts and tasks' (#2) from feature/fix-self-assignment into main
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 49s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 31s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
Reviewed-on: #2
2026-03-08 19:13:29 +01:00
WorkClub Automation
add4c4c627 fix(frontend): restore member self-assignment for shifts and tasks
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m12s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 35s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
CI Pipeline / Backend Build & Test (pull_request) Successful in 52s
CI Pipeline / Frontend Lint, Test & Build (pull_request) Successful in 33s
CI Pipeline / Infrastructure Validation (pull_request) Successful in 4s
Root Cause:
- Shift: Next.js 16.1.6 incompatible rewrite pattern caused runtime SyntaxError
- Task: Missing self-assignment UI for member role

Fix:
- Updated next.config.ts rewrite pattern from regex to wildcard syntax
- Added "Assign to Me" button to task detail page with useSession integration
- Added test coverage for self-assignment behavior with session mocks

Testing:
- Lint:  PASS (ESLint v9)
- Tests:  47/47 PASS (Vitest v4.0.18)
- Build:  PASS (Next.js 16.1.6, 12 routes)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-08 19:07:19 +01:00
WorkClub Automation
785502f113 fix(cd): configure buildx for HTTP-only insecure registry
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m9s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 54s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-08 16:05:28 +01:00
WorkClub Automation
c657a123df feat(cd): add multi-arch Docker build support (AMD64 + ARM64)
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m40s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 1m18s
CI Pipeline / Infrastructure Validation (push) Successful in 10s
Add Docker Buildx support to build images for both linux/amd64 and linux/arm64 architectures using a single workflow. This enables deployment to ARM-based systems (e.g., Raspberry Pi, Apple Silicon) without separate builds.

Changes:
- Add Docker Buildx setup step to both backend and frontend jobs
- Replace single-arch 'docker build' with multi-arch 'docker buildx build'
- Configure '--platform linux/amd64,linux/arm64' for both architectures
- Consolidate tag and push operations into single buildx command
- Update evidence capture to include platform information
- Update release summary to indicate multi-arch images

Images will now be published as manifest lists containing both AMD64 and ARM64 variants under the same tags.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-08 15:39:39 +01:00
WorkClub Automation
5c815c824a fix(cd): remove http:// from REGISTRY_HOST for valid image tags
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m17s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 56s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-08 15:24:51 +01:00
WorkClub Automation
5e3968bd69 fix(cd): remove systemctl-based insecure registry config
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m18s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 57s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
- Remove 'Configure insecure registry' step from both backend and frontend jobs
- systemctl not available in Gitea Actions container environment
- Runner host must be pre-configured with insecure registry support
- Fixes: System has not been booted with systemd error
2026-03-08 15:18:27 +01:00
WorkClub Automation
145c47a439 Merge branch 'sisyphus/club-work-manager' 2026-03-08 15:11:30 +01:00
WorkClub Automation
4d35a76669 fix(cd): remove systemctl restart - requires runner pre-config
- Remove 'Configure insecure registry' step from both jobs
- systemctl is not available in Gitea Actions container environment
- Runner host must be pre-configured with insecure registry in daemon.json
- This is a one-time setup by administrator on the runner host
- Resolves: System has not been booted with systemd as init system error
2026-03-08 15:11:21 +01:00
WorkClub Automation
49466839a3 fix(cd): add insecure registry config for HTTP push
Some checks failed
CI Pipeline / Backend Build & Test (push) Failing after 1m19s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 56s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
- Add Docker daemon configuration step to both backend and frontend jobs
- Configure insecure-registries to allow HTTP connections to registry
- Restart Docker daemon and verify configuration
- Resolves HTTP error when pushing to HTTP-only registry at 192.168.241.13:8080
2026-03-08 15:03:02 +01:00
WorkClub Automation
ba74a5c52e fix(cd): add insecure registry config for HTTP push
- Add Docker daemon configuration step to both backend and frontend jobs
- Configure insecure-registries to allow HTTP connections to registry
- Restart Docker daemon and verify configuration
- Resolves HTTP error when pushing to HTTP-only registry at 192.168.241.13:8080
2026-03-08 15:02:25 +01:00
6a912412c6 Enforce http for Registry
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m27s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 58s
CI Pipeline / Infrastructure Validation (push) Successful in 5s
2026-03-08 14:52:47 +01:00
WorkClub Automation
01d5e1e330 fix(cd): change workflow to manual trigger with inputs
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m27s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 58s
CI Pipeline / Infrastructure Validation (push) Successful in 53s
2026-03-08 14:37:25 +01:00
WorkClub Automation
fce12f7cf0 fix(cd): change workflow to manual trigger with inputs 2026-03-08 14:35:43 +01:00
b4b9d23429 next ci test
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m25s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 1m3s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
v0.0.1
2026-03-08 14:27:08 +01:00
7d9e7d146e simle test to force ci
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m10s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 1m0s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
2026-03-08 14:22:56 +01:00
WorkClub Automation
493234af2a ci(cd): add release-tag bootstrap image publish pipeline to 192.168.241.13:8080
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m24s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 1m2s
CI Pipeline / Infrastructure Validation (push) Successful in 5s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-08 14:00:58 +01:00
WorkClub Automation
0b6bdd42fd docs(evidence): record ci troubleshooting and resolution notes
Some checks failed
CI Pipeline / Backend Build & Test (push) Failing after 1m7s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 54s
CI Pipeline / Infrastructure Validation (push) Successful in 3s
2026-03-06 22:44:33 +01:00
WorkClub Automation
3313bd0fba docs(plan): mark task 29 complete after gitea ci success
Some checks failed
CI Pipeline / Frontend Lint, Test & Build (push) Has been cancelled
CI Pipeline / Infrastructure Validation (push) Has been cancelled
CI Pipeline / Backend Build & Test (push) Has been cancelled
2026-03-06 22:43:48 +01:00
WorkClub Automation
cf79778466 fix(ci): install jsdom in frontend workflow before vitest
All checks were successful
CI Pipeline / Backend Build & Test (push) Successful in 1m7s
CI Pipeline / Frontend Lint, Test & Build (push) Successful in 57s
CI Pipeline / Infrastructure Validation (push) Successful in 3s
2026-03-06 22:39:48 +01:00
WorkClub Automation
4db56884df fix(ci): pin node runtime for frontend vitest compatibility
Some checks failed
CI Pipeline / Backend Build & Test (push) Successful in 1m9s
CI Pipeline / Frontend Lint, Test & Build (push) Failing after 50s
CI Pipeline / Infrastructure Validation (push) Successful in 4s
2026-03-06 22:33:44 +01:00
WorkClub Automation
e1f98696b5 fix(ci): install kustomize directly in infra job
Some checks failed
CI Pipeline / Backend Build & Test (push) Successful in 1m7s
CI Pipeline / Frontend Lint, Test & Build (push) Failing after 25s
CI Pipeline / Infrastructure Validation (push) Successful in 3s
2026-03-06 22:27:08 +01:00
WorkClub Automation
5cf43976f6 fix(frontend): resolve lint blockers for gitea frontend-ci 2026-03-06 22:26:55 +01:00
WorkClub Automation
ad6a23621d docs(evidence): record gitea actions validation blocker state
Some checks failed
CI Pipeline / Backend Build & Test (push) Successful in 2m21s
CI Pipeline / Frontend Lint, Test & Build (push) Failing after 20s
CI Pipeline / Infrastructure Validation (push) Failing after 7s
2026-03-06 22:02:32 +01:00
WorkClub Automation
53e2d57f2d ci(gitea): add parallel workflow for backend frontend and infra checks 2026-03-06 22:02:28 +01:00
WorkClub Automation
c543d3df1a docs(plan): append gitea ci/cd pipeline requirements 2026-03-06 22:02:24 +01:00
WorkClub Automation
4788b5fc50 test(e2e): stabilize Playwright suite and close plan verification
Make auth/tasks/shifts end-to-end tests deterministic with robust role-aware
fallbacks, single-worker execution, and non-brittle selectors aligned to the
current UI contracts.

Mark verified plan/evidence checklists complete after re-validating backend,
frontend, E2E, security isolation, and infrastructure commands.
2026-03-06 16:03:03 +01:00
WorkClub Automation
33a9b899d1 docs(evidence): resolve final QA status with consolidated blockers and acceptance 2026-03-06 09:26:36 +01:00
WorkClub Automation
f8f3e0f01e test(harness): stabilize backend+frontend QA test suite (12/12+63/63 unit+integration, 45/45 frontend)
Stabilize test harness across full stack:

Backend integration tests:
- Fix Auth/Club/Migration/RLS/Member/Tenant/RLS Isolation/Shift/Task test suites
- Add AssemblyInfo.cs for test configuration
- Enhance CustomWebApplicationFactory + TestAuthHandler for stable test environment
- Expand RlsIsolationTests with comprehensive multi-tenant RLS verification

Frontend test harness:
- Align vitest.config.ts with backend API changes
- Add bunfig.toml for bun test environment stability
- Enhance api.test.ts with proper test setup integration
- Expand test/setup.ts with fixture initialization

All tests now passing: backend 12/12 unit + 63/63 integration, frontend 45/45
2026-03-06 09:19:32 +01:00
WorkClub Automation
9950185213 fix: stabilize auth-to-tenant flow and correct tenant header mapping
Resolve post-login routing and tenant context issues by proxying frontend API
calls, redirecting authenticated users away from /login, and hardening club
loading with retries/loading guards.

Align tenant identity end-to-end by returning tenantId in /api/clubs/me and
sending X-Tenant-Id from cookie-backed tenantId instead of local clubId,
restoring authorized tasks/shifts data access after club selection.
2026-03-06 08:01:09 +01:00
WorkClub Automation
dbc8964f07 fix: resolve ObjectDisposedException in ClubService.GetMyClubsAsync()
Create fresh NpgsqlConnection per tenant iteration instead of reusing
EF Core's managed connection. This prevents connection disposal issues
when iterating over multiple tenant IDs from the JWT clubs claim.

The fix ensures each iteration has its own connection lifecycle with
proper SET LOCAL app.current_tenant_id for RLS compliance.
2026-03-05 21:46:19 +01:00
WorkClub Automation
ffc4062eba fix: exempt /api/clubs/me from tenant validation
- Add path exemption in TenantValidationMiddleware for /api/clubs/me
- Change authorization policy from RequireMember to RequireViewer
- Fix KEYCLOAK_CLIENT_ID in docker-compose.yml (workclub-app not workclub-api)
- Endpoint now works without X-Tenant-Id header as intended
- Other endpoints still protected by tenant validation

This fixes the chicken-and-egg problem where frontend needs to call
/api/clubs/me to discover available clubs before selecting a tenant.
2026-03-05 21:32:37 +01:00
WorkClub Automation
18be0fb183 fix: exempt /api/clubs/me from tenant validation
- Add path exemption in TenantValidationMiddleware for /api/clubs/me
- Change authorization policy from RequireMember to RequireViewer
- Fix KEYCLOAK_CLIENT_ID in docker-compose.yml (workclub-app)
- Resolves frontend chicken-and-egg problem for club discovery

Verified:
- /api/clubs/me returns 200 OK without X-Tenant-Id header
- /api/tasks still requires X-Tenant-Id (400 Bad Request)
- Other endpoints unaffected
2026-03-05 21:32:34 +01:00
WorkClub Automation
b286e5cb34 docs(notepads): record Option D interceptor debugging and learnings 2026-03-05 20:43:10 +01:00
WorkClub Automation
c918f447b2 fix(backend): add TenantDbTransactionInterceptor for RLS with explicit transactions
Implements Option D: wraps auto-commit reads in explicit transactions with SET LOCAL.
Handles transaction lifecycle (create→SET LOCAL→execute→commit/dispose).
Uses IDbTransactionInterceptor for EF-managed SaveChanges transactions.
Critical fix for PostgreSQL RLS requiring transaction-scoped context.
2026-03-05 20:43:03 +01:00
WorkClub Automation
5fb148a9eb chore(evidence): add QA evidence and notepads from debugging sessions
Add comprehensive QA evidence including manual testing reports, RLS isolation
tests, API CRUD verification, JWT decoded claims, and auth evidence files.
Include updated notepads with decisions, issues, and learnings from full-stack
debugging sessions.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:55 +01:00
WorkClub Automation
3d14ace20a fix(frontend): add server-side redirect to login
Simplify root page to redirect to /login on server side, eliminating
unnecessary client-side logic.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:45 +01:00
WorkClub Automation
1246086ab5 fix(infra): add privileges and fix Keycloak configuration for auth
Update realm-export.json with fixed UUID endianness, correct passwords,
mappers, and SSL configuration. Add ALTER DEFAULT PRIVILEGES for app_admin
in PostgreSQL init.sh to ensure proper role permissions.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:37 +01:00
WorkClub Automation
65e80ee334 fix(backend): move RLS initialization before app_admin role assignment
Reorganize SeedDataService to establish RLS policies before granting
app_admin role to prevent permission issues. Remove --no-restore flag
from Dockerfile.dev to ensure proper build.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:29 +01:00
WorkClub Automation
3b7db39cc2 fix(backend): update middleware ordering and interceptors for RLS
Update TenantValidationMiddleware, Program.cs startup sequence,
SaveChangesTenantInterceptor, and TenantProvider to ensure proper
middleware ordering and tenant context initialization before database access.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:21 +01:00
WorkClub Automation
5a4bb16413 fix(backend): resolve tenant context initialization in claims transformation
Set tenant context before querying DB in ClubRoleClaimsTransformation.TransformAsync
to avoid chicken-and-egg problem where tenant context is needed but not yet available.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 19:22:13 +01:00
WorkClub Automation
7859e1b3cf fix(infra): add explicit transaction management to TenantDbConnectionInterceptor for RLS
PostgreSQL SET LOCAL only persists within a transaction scope. Added explicit transaction creation if none exists, ensuring tenant context is properly set before queries execute. Fixes tenant isolation for multi-tenant RLS filtering.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-05 16:30:50 +01:00
WorkClub Automation
8d3ac6e64a Remove transaction check from TenantDbConnectionInterceptor.SetTenantContext
Allow SET LOCAL execution for all database commands by removing the transaction check.
EF Core creates implicit transactions for queries, so SET LOCAL works regardless.

This fixes the issue where read operations without explicit transactions were not getting
tenant context set properly, leading to incorrect RLS filtering and data visibility.
2026-03-05 16:08:09 +01:00
WorkClub Automation
e8c8dac5d4 fix(keycloak): update user club attributes with real database UUIDs
- Replaced placeholder UUIDs (club-1-uuid, club-2-uuid) with real database UUIDs
- Updated all 5 test users via Keycloak database
- Restarted Keycloak to clear caches and apply changes

Impact:
- JWT tokens now contain real UUIDs in clubs claim
- API endpoints accept X-Tenant-Id with real UUIDs (returns 200 OK)
- Unblocks 46 remaining QA scenarios

Documentation:
- Created update-keycloak-club-uuids.py script for automation
- Added KEYCLOAK_UPDATE_GUIDE.md with step-by-step instructions
- Recorded learnings in notepad

Ref: .sisyphus/evidence/final-f3-manual-qa.md lines 465-512
2026-03-05 14:21:44 +01:00
WorkClub Automation
b813043195 fix(auth): add JWT audience claim and disable issuer validation
- Added Keycloak audience protocol mapper to workclub-app client
  - Maps 'workclub-api' to aud claim in access tokens
- Disabled issuer validation in API for local dev
  - External clients use localhost:8080, internal use keycloak:8080
  - Prevents validation mismatch in Docker network environment

This resolves 401 Unauthorized errors on all authenticated endpoints.

Ref: .sisyphus/evidence/final-f3-manual-qa.md lines 418-444
2026-03-05 14:12:53 +01:00
WorkClub Automation
8643c3dfa7 fix(frontend): create NextAuth.js API route handler
NextAuth.js v5 requires an explicit API route to expose authentication endpoints.

Added missing route handler at frontend/src/app/api/auth/[...nextauth]/route.ts that imports and exports handlers from the auth configuration.

This fixes:
- /api/auth/signin endpoint (was 404)
- /api/auth/callback endpoint
- /api/auth/session endpoint
- Frontend authentication flow initialization

Verification: Endpoint now returns HTTP 200 and frontend loads without ClientFetchError.
2026-03-05 13:59:16 +01:00