mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
create-pull-request/patch
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
833a875ea2 |
fix(studio): friendly database metric errors DEBUG-155 (#52216)
## Problem The Database section of Observability displays raw infrastructure API errors in metric cards, making failures confusing and repetitive. ## Fix Show one friendly alert with refresh, support, and service-status guidance when the infrastructure request fails. Keep Slow Queries visible, and show “Unable to load” only on affected cards for partial failures while preserving healthy metrics. The Overview Refresh button now invalidates the active project’s connection-limit query. Previously it used a cache key that matched no active query, so Peak Connections could stay on “Unable to load” while the other cards refreshed. Consolidates and supersedes #47491 and #47495, adapted to the current batched metrics implementation. ## How to test - Open Observability and verify that successful database metrics still render. - Simulate a failed infrastructure request. Expect one friendly alert, no raw backend message, and Slow Queries still visible. - Simulate an individual metric or connection-limit failure. Expect only the affected card to show “Unable to load”. - With the connection-limit request failing, click **Refresh** and confirm that Peak Connections shows “Unable to load”. Restore the response and click **Refresh** again. The card should show the peak and limit without a browser reload. ## QA results - **Hosted Refresh recovery passed on `ee646999af`.** After the connection-limit request recovered, one click sent a new request and replaced “Unable to load” with `6/90`. The other five hosted cases passed on `dbf78487f5`. [Automated QA review](https://github.com/supabase/supabase/pull/52216#pullrequestreview-6169329677) - **Local Chromium recovery passed on the same commit.** With a simulated HTTP 500 followed by success, Refresh retried the query and displayed `12/100`. CPU, Memory, and Disk remained healthy. - All 52 focused tests passed with retries disabled and shuffled order. The recovery test failed with the original Refresh handler. Studio typecheck passed. GitHub reported 38 successful checks and six skipped checks. Fixes https://linear.app/supabase/issue/DEBUG-155/frontend-should-render-nice-error-message-on-infra-monitoring-api ## QA screenshots ### Peak Connections before and after the Refresh fix **Before · `dbf78487f5`.** Peak Connections still showed “Unable to load” after two Refresh clicks, even as the other metrics reloaded.  **After · `ee646999af`.** Once the connection-limit request could succeed, the next Refresh click restored Peak Connections to `6/90`.  ### Local browser with HTTP overrides Actual PR component at `dbf78487f5`, rendered in a local fixture harness at a 1440 × 900 viewport. Playwright intercepted the infrastructure API request; these are local simulated error states, not hosted-preview captures. **Full request failure:** one friendly alert; raw backend details are hidden and Slow Queries remains visible.  **Partial failure:** only Disk IO Budget shows “Unable to load”; healthy metrics and Slow Queries remain visible.  **Recovery:** after restoring a successful response and reloading, all metric cards render normally.  ### Verified hosted preview Studio staging deployment for `dbf78487f5`, 1440 × 900. All database metric cards and Slow Queries return after Refresh.  The CPU card opens the Database report and preserves Last 24 hours.  |
||
|
|
60b51d74d5 |
Audit existing unit tests + Remove redundant ones (#52215)
## Context
_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_
We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.
## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
|
||
|
|
4825c6d9f5 |
fix(studio): clarify disk IO balance FDBKPRI-2885 (#51943)
## Problem Infrastructure and Observability label consumed disk IO burst credits as “Disk IO,” so a value of 1% appears inconsistent with a remaining balance of 99% in AWS or Grafana. Both surfaces request `disk_io_consumption`, which is the inverse of `disk_io_budget`. ## Fix Show `disk_io_budget` as “Disk IO balance” and explain that it represents the lower of the remaining throughput and IOPS burst balances. Infrastructure shows the lowest sampled balance over seven days; Observability shows the selected-window average. Keep Infrastructure's overall Compute score based on consumed credits, so a full balance stays healthy and a low balance still warns. Missing balance remains unavailable. Update the compute and disk guide and disk IO troubleshooting page to explain the remaining balance, its direction, and the different aggregation windows. ## How to test - Open Infrastructure settings for a project with burstable IO. Verify the balance headline and chart show remaining credits, with 100% full and 0% exhausted. - Open Observability and verify “Disk IO balance” shows the average remaining balance for the selected window. - Hover the labels to check the explanation and aggregation window. - Verify a high balance does not inflate Compute usage, a low balance raises the warning, and missing balance does not appear as 0% or 100%. - Focused unit and MSW component tests: 79 passed, including shuffled runs with retries disabled; regression mutations caught wrong metric selection, reversed pressure, and maximum-versus-minimum selection. ## Validation Studio typecheck, changed-file ESLint, and Prettier pass locally. Verified both surfaces on the deployed preview, including Observability refresh and the balance tooltip. Documentation formatting and review pass. The local markdown build is blocked by missing generated federated content and its GitHub credentials; docs CI validates the deployed build. ## Screenshots Same project on `supabase.green` (before) and the PR preview (after), captured October 20. Infrastructure uses the same seven-day window; Observability uses Last 24 hours. ### Infrastructure | Before | After | | --- | --- | |  |  | ### Observability | Before | After | | --- | --- | |  |  | Observability balance explanation:  Fixes FDBKPRI-2885 |
||
|
|
509afd0bf0 | fix(o11y): support partial metric loading (#50867) |