Commit Graph

7 Commits

Author SHA1 Message Date
Jordi Enric d2ed60da27 fix(auth): migrate overview errors to clickhouse (#50174)
## Problem

Auth overview error tables call the legacy logs endpoint through
fetchLogs defaults, even with the ClickHouse migration enabled.
Success-rate cards also show zero when there are no requests and
misleading relative changes between small rates.

## Fix

Select matching BigQuery or ClickHouse queries with otelLegacyLogs,
separate caches by engine, and normalize numeric results.

Show No data for success rates without requests and omit comparisons
when either period has no requests. Show success-rate changes in
percentage points: 0% to 0.2% displays +0.2 pp. Omit undefined relative
changes from a zero baseline for activity and sign-up counts. Show
explicit errors for failed log requests, including error payloads
returned with HTTP 200, instead of empty tables.

## Validation

- Auth overview error tables compared against staging with matching
data.
- 84 focused tests passed across four suites, including 25 direct
formatter tests.
- 12 MSW integration tests exercise both endpoint/SQL pairs, HTTP and
embedded API failures, and rendered No data, genuine 0%, and +0.2 pp
states.
- Unit tests cover missing periods, zero requests, percentage-point and
relative changes, SQL structure, and numeric result parsing.
- Formatting and diff checks passed; code review found no actionable
issues.
- Full local lint/typecheck are limited by shared checkout dependencies.
Browser comparison confirmed the deployed rate display uses percentage
points and shows No data without a comparison for absent server
requests; populated error rows match staging. The final formatter
extraction (9886b78682) was also deployed and verified in the browser;
CI completion remains outstanding.

Split from #50173.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added OpenTelemetry support for authentication error and metrics
reporting.
- Added clearer handling of missing metric data, including “No data”
states.
- Improved success-rate change calculations using percentage-point
differences.
  - Added user-visible error states when analytics requests fail.

- **Bug Fixes**
- Improved validation and handling of authentication metrics and error
data.
  - Corrected formatting and rounding for metric values and changes.

- **Tests**
- Expanded coverage for legacy and OpenTelemetry analytics, error
handling, empty data, formatting, and edge cases.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-14 15:35:03 +02:00
Vaibhav 804475fd3a fix: redirect urls (#47487)
## TL;DR

fixes redirect url  normalization..

## PS:

| Before | After |
| --- | --- |
| Broken: whitespace could make the same redirect URL appear as a
separate entry and break delete behavior | Fixed: equivalent redirect
URLs are normalized consistently, so display, save, and delete behavior
stay in sync |
| <img width="800" height="274" alt="Before redirect URLs behavior"
src="https://github.com/user-attachments/assets/47dbb1ca-7c7d-482b-a67e-08c2eb2cd030"
/> | ![After redirect URLs
behavior](https://github.com/user-attachments/assets/b90dfad3-9ec2-4431-8412-34d4faca62da)
|

## ref:
- closes https://github.com/supabase/supabase/issues/47478

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved redirect URL handling so saved and displayed URLs are
consistently trimmed, normalized, deduplicated, and parsed from
comma-separated allow lists.
* Tightened redirect URL validation to better catch invalid formats and
prevent duplicates both against the existing allow list and within a new
submission.
* Fixed redirect URL deletion to remove the exact set of URLs confirmed
by the user.
* **Tests**
* Added/updated tests to cover redirect URL normalization and parsing
behavior for stored comma-separated allow lists.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-01 08:24:17 -06:00
Charis 205cbe7d26 chore(studio}: enforce import order, remove bare import specifiers (#44585) 2026-04-07 20:34:10 -04:00
Terry Sutton 110e8ed77f Chore/update url regex (#30138)
* Allow excluding options in the url regex

* Add tests for options
2024-10-29 10:05:52 -02:30
Terry Sutton 6d78a98b63 Chore/replace url with regex (#29499)
* Replace zod .url with regex check

* Prevent adding dupe URLs in modal

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-09-25 13:03:33 +08:00
Jordi Enric 764d10986d vitest & msw integration (#26303)
* Fix tests in tests/unit, tests/components and files under tests, looking into tests/pages

* Fix tests under pages/projects root

* Fix

* Comment out broken tests that im stuck with

* Fix api-report.test

* Fix storage-report-test

* chore: fix some tests

* chore: remove logging

* Fix LogsPreviewer.test.js

* Fix most of logs-query-test

* Skip broken tests instead of false positiving them

* Replace jest with vitest

* Rename all *.test.js to *.test.ts

* Configure vitest to work with jsx

* fix vitest issues, fix tests, skip broken tests, add msw, add next-router-mock

* uncomment file

* add tests for msw and nrm

* Fix failing tests

* fix tests in RowEditor

* fix datepicker tests

* fix type errors and comment out tests that need some refactoring

* leave 1 test so test script works

* rm clog and aaaaa

* rename script

* move msw to studio

* add pckg json which i forgot in last commit

* rm consolelog

* move vitest ui dep

* Move next-router-mock to studio.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: TzeYiing <ty@tzeyiing.com>
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-05-29 17:31:20 +02:00
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00