Skip to content

[codex] Fix update failure log filters#2321

Merged
riderx merged 1 commit into
mainfrom
codex/fix-update-stats-log-filters
May 21, 2026
Merged

[codex] Fix update failure log filters#2321
riderx merged 1 commit into
mainfrom
codex/fix-update-stats-log-filters

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented May 21, 2026

Summary (AI generated)

  • Updated the Updates statistics chart log navigation so the fail bucket opens logs filtered by every *_fail event it aggregates.
  • Added repeated action query parameter support on the logs page so multiple filters are restored from URL state.
  • Kept chart-click log navigation scoped to the clicked day.
  • Switched CI Playwright frontend startup to build the app and serve it with vite preview, avoiding the Vite dependency optimizer hang seen in the duplicate push run.

Motivation (AI generated)

Clicking fail in Updates statistics previously opened logs for only one failure action, so most users saw no matching events even though the chart counted failures from several event types. The CI frontend change keeps Playwright checks stable while preserving full browser coverage.

Business Impact (AI generated)

This makes update failure investigation reliable from the dashboard, reducing support/debug time and helping users identify real OTA update failure causes faster. The CI hardening also avoids wasting review time on unrelated Playwright startup flakes.

Test Plan (AI generated)

  • bun lint
  • bun typecheck
  • bun run build
  • bun build scripts/playwright-frontend-preview.ts --outdir /tmp/capgo-playwright-preview-check
  • Parsed .github/workflows/tests.yml with the repo YAML parser

Generated with AI

Summary by CodeRabbit

  • New Features

    • Chart tooltips now filter logs by multiple action types simultaneously.
    • Log table filters correctly initialize from query parameters that include one or more actions.
  • Chores

    • Updated Playwright test workflow to use a new local frontend preview runner and adjusted preview/startup automation.

Review Change Stack

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 49dfc1bf-e295-44eb-859a-55871c165a4b

📥 Commits

Reviewing files that changed from the base of the PR and between a03301d and fc27ef5.

📒 Files selected for processing (4)
  • .github/workflows/tests.yml
  • scripts/playwright-frontend-preview.ts
  • src/components/dashboard/UpdateStatsChart.vue
  • src/components/tables/LogTable.vue

📝 Walkthrough

Walkthrough

Chart clicks now map buckets to one-or-more log action query params; the log table reads multi-value action queries and enables matching filters. Playwright tests now start the frontend via a new preview script that sets Supabase env, builds, and serves the app.

Changes

Multi-action stats filtering

Layer / File(s) Summary
Chart action mapping and multi-action URL generation
src/components/dashboard/UpdateStatsChart.vue
UPDATE_FAILURE_ACTIONS lists failure log actions; actionToLogActions maps chart buckets to one-or-many log actions. Tooltip click handler appends one action query parameter per mapped action.
Log table multi-action query parameter parsing
src/components/tables/LogTable.vue
initializeActionFilters() normalizes route.query.action into an array (handles string or array) and enables actionFilters for each recognized action value.

Playwright test frontend infrastructure

Layer / File(s) Summary
Frontend preview script and workflow integration
scripts/playwright-frontend-preview.ts, .github/workflows/tests.yml
Adds a preview runner that validates SUPABASE_URL, derives API_DOMAIN, sets ENV: 'local', runs bun run build, then starts vite preview on 127.0.0.1:5173. Workflow step now invokes this script via supabase:with-env.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Cap-go/capgo#2096: Overlaps on src/components/tables/LogTable.vue action filter initialization and query→filter mapping.
  • Cap-go/capgo#1976: Also modifies Playwright frontend startup in .github/workflows/tests.yml.

Suggested reviewers

  • jihadMo
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete, missing the 'Test plan' section with reproduction steps and the 'Checklist' section with required validations, though it does include a summary and screenshots are not applicable for these backend/config changes. Add a detailed 'Test plan' section with step-by-step instructions for manually testing the failure filters and logs, and complete the 'Checklist' section by marking applicable items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Fix update failure log filters' accurately and concisely summarizes the main change: enabling proper failure action filtering in the update statistics chart and logs navigation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the codex label May 21, 2026
@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 21, 2026

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing codex/fix-update-stats-log-filters (fc27ef5) with main (3e75b49)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@riderx riderx force-pushed the codex/fix-update-stats-log-filters branch 2 times, most recently from 0dc872e to 9f42633 Compare May 21, 2026 15:51
Copy link
Copy Markdown

@hadessunxy-code hadessunxy-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the chart-to-logs filter path. The repeated action query params should round-trip correctly through Vue Router, and the log table now restores all matching filters instead of only the first failure action.

No blocker from me. The one follow-up I would consider is moving the update failure action list into a shared stats/logs helper, because it now needs to stay in sync with both the aggregated fail statistic and statsActions.ts. That would reduce the chance of a future failure action being counted in the chart but omitted from the log drill-down.

@riderx riderx force-pushed the codex/fix-update-stats-log-filters branch from 9f42633 to a03301d Compare May 21, 2026 17:04
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedemulate@​0.5.07110010093100
Addedcountry-code-to-flag-emoji@​2.1.0801008286100
Addedcron-schedule@​6.0.010010010081100
Addeddayjs@​1.11.2010010010084100
Addedcommander@​14.0.39810010084100
Addedeslint-plugin-format@​2.0.19910010085100
Addeddrizzle-orm@​1.0.0-rc.1971008899100
Addedeslint@​10.2.18910010096100
Addeddotenv@​17.4.29910010092100
Addeddiscord-api-types@​0.38.4710010010095100

View full report

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/playwright-frontend-preview.ts`:
- Around line 3-4: The code currently defaults SUPABASE_URL to '' which produces
a bad apiDomain; update the logic around process.env.SUPABASE_URL and the
derived apiDomain so it fails fast when SUPABASE_URL is missing (throw an error
or call process.exit with a clear message) and normalize the URL before building
apiDomain: read process.env.SUPABASE_URL into supabaseUrl, validate it is
non-empty, strip any trailing slash and any protocol only when composing
apiDomain (use supabaseUrl.replace(/^https?:\/\//, '').replace(/\/$/, '') to
produce the host) and then set apiDomain = `${normalizedHost}/functions/v1`;
ensure the error message references SUPABASE_URL and the variables supabaseUrl
and apiDomain for clarity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c0bc93c2-c80b-43c3-b102-14e6ac7da011

📥 Commits

Reviewing files that changed from the base of the PR and between 992dab5 and a03301d.

📒 Files selected for processing (4)
  • .github/workflows/tests.yml
  • scripts/playwright-frontend-preview.ts
  • src/components/dashboard/UpdateStatsChart.vue
  • src/components/tables/LogTable.vue

Comment thread scripts/playwright-frontend-preview.ts Outdated
@riderx riderx force-pushed the codex/fix-update-stats-log-filters branch from a03301d to fc27ef5 Compare May 21, 2026 17:12
@sonarqubecloud
Copy link
Copy Markdown

@riderx riderx merged commit ec0bb65 into main May 21, 2026
44 checks passed
@riderx riderx deleted the codex/fix-update-stats-log-filters branch May 21, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants