mirror of
https://github.com/supabase/supabase.git
synced 2026-09-06 09:59:03 +08:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Feature ## Summary - Add a Health Advisor page at `/project/[ref]/advisors/health` - Put Health Advisor first in the Advisors left nav (above Security), platform-only - Register `V` then `H` and a command-menu entry Stacked on #49662. Top of the stack. ## To test 1. Open any project in Studio. 2. Click **Advisors** in the main nav (or go to `/project/<ref>/advisors/security`). 3. In the left nav, confirm the order is **Health Advisor**, then Security Advisor, then Performance Advisor, then Query Performance. 4. Click **Health Advisor**. You should land on a page titled “Health Advisor” with Errors / Warnings / Info tabs, same layout as Security Advisor. 5. If the project is healthy, Errors should say no errors were detected. If it is not, the failing checks should list here (database down, connection limit, and so on). 6. Click **Refresh** (or Shift+R) and confirm the list reloads. 7. Click a row and confirm the detail panel opens with a link through to logs, connections, or infrastructure. 8. While still in Advisors, press **V** then **H**. You should jump back to Health Advisor. 9. Open the command menu and search **Health Advisor**. Choosing it should navigate to this page. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a Health Advisor page for reviewing project health findings by severity and category. - Added Health Advisor navigation in the advisor menu and a keyboard shortcut (`V`, then `H`) on supported platforms. - Added refresh, filtering, selection, and lint detail navigation for health findings. - **Bug Fixes** - Added validation for linter severity values, safely handling unsupported or missing inputs. - **Documentation** - Updated migration and shortcut documentation to include the Health Advisor. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
36 lines
895 B
TypeScript
36 lines
895 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { generateAdvisorsMenu } from './AdvisorsMenu.utils'
|
|
|
|
describe('generateAdvisorsMenu', () => {
|
|
it('puts Health Advisor first on platform', () => {
|
|
const [advisors] = generateAdvisorsMenu({
|
|
ref: 'abc',
|
|
isAdvisorRulesEnabled: false,
|
|
isPlatform: true,
|
|
})
|
|
|
|
expect(advisors.items.map((item) => item.key)).toEqual([
|
|
'health',
|
|
'security',
|
|
'performance',
|
|
'query-performance',
|
|
])
|
|
expect(advisors.items[0].url).toBe('/project/abc/advisors/health')
|
|
})
|
|
|
|
it('omits Health Advisor when not on platform', () => {
|
|
const [advisors] = generateAdvisorsMenu({
|
|
ref: 'abc',
|
|
isAdvisorRulesEnabled: false,
|
|
isPlatform: false,
|
|
})
|
|
|
|
expect(advisors.items.map((item) => item.key)).toEqual([
|
|
'security',
|
|
'performance',
|
|
'query-performance',
|
|
])
|
|
})
|
|
})
|