Repository navigation
fix: UI health check runtime fixes and rate limiting #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9c478d4
docs: refresh CODEX_CLAUDE_PARITY_GAPS coverage report to 2026-03-13
hunnibear 53dceb0
fix(ui): switch health routes from edge to nodejs runtime
hunnibear 68d3fdd
fix(ui): correct JWT base64url decoding in boot-jwt health check
hunnibear d9ede9a
feat(ui): add rate limiting to presign health endpoint
hunnibear 49b0e8c
feat(ui): add Supabase DB connectivity check to health endpoint
hunnibear 44f05de
test(ui): update Playwright config for E2E test improvements
hunnibear 4de5246
test(ui): add E2E tests and ingest-smoke health endpoint
hunnibear 07d06f8
ci(ui): add GitHub Actions workflow for UI testing
hunnibear a0bf7c6
fix(ui): move refreshSyncStatus before useEffect to resolve hoisting …
hunnibear f0e9e42
fix(ui): resolve remaining ESLint and TypeScript errors
hunnibear 4328aaa
fix(ui): resolve TypeScript errors and failing tests
hunnibear ed699c1
fix(lint): resolve all ESLint warnings in pmoves/ui
hunnibear 1d6cc62
test(ui): add missing ok/err mocks to hirag.test.ts
hunnibear cd08f08
fix(ui): remove statusFilter and sourceFilter props from BulkApproval…
hunnibear 08f2607
fix(ui): add test-results to gitignore
hunnibear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| name: UI Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, PMOVES.AI-Edition-Hardened] | ||
| paths: | ||
| - 'pmoves/ui/**' | ||
| - '.github/workflows/ui-tests.yml' | ||
| pull_request: | ||
| branches: [main, PMOVES.AI-Edition-Hardened] | ||
| paths: | ||
| - 'pmoves/ui/**' | ||
| - '.github/workflows/ui-tests.yml' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint (ESLint) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@v2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: pmoves/ui/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: pmoves/ui | ||
| run: npm ci | ||
|
|
||
| - name: Run ESLint | ||
| working-directory: pmoves/ui | ||
| run: npm run lint | ||
|
|
||
| typecheck: | ||
| name: Type Check (TypeScript) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@v2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: pmoves/ui/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: pmoves/ui | ||
| run: npm ci | ||
|
|
||
| - name: Run TypeScript type check | ||
| working-directory: pmoves/ui | ||
| run: npm run typecheck | ||
|
|
||
| unit-tests: | ||
| name: Unit Tests (Jest) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| actions: read | ||
| checks: write | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@v2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: pmoves/ui/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: pmoves/ui | ||
| run: npm ci | ||
|
|
||
| - name: Run Jest unit tests | ||
| working-directory: pmoves/ui | ||
| env: | ||
| # Mock Supabase for unit tests | ||
| NEXT_PUBLIC_SUPABASE_URL: http://localhost:54321 | ||
| NEXT_PUBLIC_SUPABASE_ANON_KEY: mock-anon-key | ||
| SUPABASE_SERVICE_ROLE_KEY: mock-service-role-key | ||
| run: npm test -- --ci --coverage --maxWorkers=2 | ||
|
|
||
| - name: Upload coverage reports | ||
| uses: codecov/codecov-action@v4 | ||
| if: always() | ||
| with: | ||
| files: pmoves/ui/coverage/coverage-final.json | ||
| flags: ui-unit | ||
| name: ui-unit-coverage | ||
| fail_ci_if_error: false | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| e2e-tests: | ||
| name: E2E Tests (Playwright) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@v2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: pmoves/ui/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: pmoves/ui | ||
| run: npm ci | ||
|
|
||
| - name: Install Playwright browsers | ||
| working-directory: pmoves/ui | ||
| run: npx playwright install --with-deps | ||
|
|
||
| - name: Run Playwright E2E tests | ||
| working-directory: pmoves/ui | ||
| env: | ||
| # Configure Playwright to use correct port (4482) | ||
| PLAYWRIGHT_HOST: 127.0.0.1 | ||
| PLAYWRIGHT_PORT: 4482 | ||
| # Mock Supabase for E2E tests | ||
| NEXT_PUBLIC_SUPABASE_URL: http://localhost:54321 | ||
| NEXT_PUBLIC_SUPABASE_ANON_KEY: playwright-anon-key | ||
| NEXT_PUBLIC_SUPABASE_BOOT_USER_JWT: playwright-boot-user-jwt | ||
| SUPABASE_SERVICE_ROLE_KEY: playwright-service-role | ||
| run: npm run test:e2e | ||
|
|
||
| - name: Upload Playwright report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: playwright-report | ||
| path: pmoves/ui/playwright-report/ | ||
| retention-days: 7 | ||
|
|
||
| - name: Upload Playwright screenshots | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: playwright-screenshots | ||
| path: pmoves/ui/test-results/ | ||
| retention-days: 7 | ||
|
|
||
| integration-tests: | ||
| name: Integration Tests (API Clients) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| actions: read | ||
| checks: write | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@v2 | ||
| with: | ||
| egress-policy: audit | ||
| allowed-endpoints: > | ||
| github.com:443 | ||
| api.github.com:443 | ||
| registry.npmjs.org:443 | ||
| localhost:4482 | ||
| localhost:8086 | ||
| localhost:8093 | ||
| localhost:8098 | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: pmoves/ui/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: pmoves/ui | ||
| run: npm ci | ||
|
|
||
| - name: Run API client integration tests | ||
| working-directory: pmoves/ui | ||
| run: npm test -- --testPathPattern="lib/api/.*\.test\.ts$" --ci | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 99
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 1213
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 610
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 116
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 4043
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 1141
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 49
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 110
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 49
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 813
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 295
🌐 Web query:
codecov-action fork PR secrets unavailable GitHub Actions💡 Result:
On GitHub Actions, this is expected behavior: for workflows triggered by
pull_requestfrom a fork, GitHub does not pass repository/org secrets to the runner (exceptGITHUB_TOKEN, which is also reduced to minimal/read-only permissions) to prevent secret exfiltration by untrusted code in the PR [1]. GitHub explicitly documents: “With the exception ofGITHUB_TOKEN, secrets are not passed … when a workflow is triggered from a forked repository” [1].What this means for
codecov/codecov-actionwith: token: ${{ secrets.CODECOV_TOKEN }}, that secret will be empty on fork PRs, so uploads that require a token will fail [1][2].forkname:main), and the Codecov action automatically adjusts the branch name for fork PRs to include:starting with v4+ [2].Practical options
CODECOV_TOKENfor fork PR uploads (or allow tokenless uploads in your Codecov org settings for public repos) [2][3].pull_request_target: be very carefulpull_request_targetruns in the context of the base repo and can access secrets even for fork PRs, which is why it’s considered risky if you check out / run untrusted PR code [4].Sources: GitHub secrets behavior [1], Codecov token requirements and tokenless rules [2], Codecov action notes about fork PR tokenless support [3], GitHub security rationale for fork PR restrictions [4].
🌐 Web query:
GitHub Actions fork pull request secrets access best practices💡 Result:
What to do for fork-based PRs (best practice)
pull_requestevent (lint/unit tests that don’t need credentials). GitHub notes thatpull_requestruns from forks with no secrets and a read-only token, which limits impact if someone tries to exfiltrate data. [2]If you must use secrets with PRs (common safe patterns)
pull_request_targetto run PR code. GitHub explicitly warns thatpull_request_targetruns in the base-repo context with access to repo secrets and typically write permissions, and becomes dangerous if you check out/execute PR code (“pwn request”). [3]pull_request_target, keep it to metadata-only tasks (label/comment) and ensure user-controlled input cannot influence execution. [3][4]pull_request(no secrets).Hardening controls to enable
.github/workflows/. [5]GITHUB_TOKENusing the workflowpermissions:key and keep defaults restrictive. [2][4][6]Key rule of thumb
If a workflow can be influenced by fork PR code/inputs, don’t give it secrets; if a workflow needs secrets, ensure it cannot execute untrusted PR code and is gated (approvals/environments/protected branches). [3][4][6]
Sources
[1] GitHub Docs – “Actions secrets … are not passed to workflows that are triggered by a pull request from a fork.” (docs.github.com)
[2] GitHub Blog (Security) –
pull_requestfrom forks runs with no secrets + read-only token. (github.blog)[3] GitHub Well-Architected – avoid
pull_request_target; explains “pwn request” risk. (wellarchitected.github.com)[4] GitHub Changelog (2025-11-07) –
pull_request_targetwith forks increases risk; recommends least privilege / preferpull_requestif no secrets needed. (github.blog)[5] GitHub Docs – approving runs from forks; be alert to
.github/workflows/changes. (docs.github.com)[6] GitHub Docs – repo settings for fork PR workflows; “send write tokens/secrets”, approval requirements, and token permissions. (docs.github.com)
Citations:
🏁 Script executed:
# Check if the repository is public or private by looking at git config git config --get remote.origin.urlRepository: POWERFULMOVES/PMOVES.AI
Length of output: 113
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 1866
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES.AI
Length of output: 49
Guard Codecov upload for fork PRs to prevent secret reference in untrusted contexts
Line 120 references
secrets.CODECOV_TOKEN, which is unavailable on fork PRs per GitHub Actions security controls. Add anifguard to skip the upload step for fork-based PRs, preventing unnecessary secret attempts in untrusted workflow runs.Suggested guard
This aligns with the coding guideline to maintain secret-handling paths and follows GitHub's recommended pattern for fork PR workflows.
🤖 Prompt for AI Agents