Files
supabase/apps/studio/components/interfaces/App/GitHubConfigDriftBanner.tsx
Ivan Vasilov e10f7cc808 feat: Add a config drift page in Studio (#48906)
## New Features
- Initial work for showing configuration drift in Studio
- This only works for Github-connected projects and it'll show a banner
if the project state differs from the git-tracked `config.toml`
- Currently behind a feature-flag `ConfigDrift`, enabled on local and
staging.
- There might be drift shown without changing any setting, this is
work-in-progress.

<img width="1217" height="1195" alt="Screenshot 2026-08-19 at 23 12 10"
src="https://github.com/user-attachments/assets/fb0b18d8-1a93-4595-85cc-e8b8a3462847"
/>

## How to test
1. Connect a project to a Github repo
2. Resync the branch on `/dashboard/project/_/branches`. This will
trigger deployment of the `config.toml` on your project
3. Change some settings (I recommend
`dashboard/project/_/auth/providers`
4. A banner should appear on all project pages with a link 


## Tests
- Added coverage for configuration conversion, normalization, matching,
drift detection, and unmanaged settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-25 13:56:40 +02:00

33 lines
1.1 KiB
TypeScript

import { useParams } from 'common'
import { AnimatePresence } from 'framer-motion'
import Link from 'next/link'
import { HeaderBanner } from '../Organization/HeaderBanner'
import { useSelectedGitHubConfigDrift } from '@/hooks/misc/useGitHubConfigDrift'
export function GitHubConfigDriftBanner() {
const { ref } = useParams()
const { hasConfigurationIssues, summary } = useSelectedGitHubConfigDrift()
const driftCount = summary.driftedFields.length
const settingsLabel = `${driftCount} managed ${driftCount === 1 ? 'setting differs' : 'settings differ'}`
return (
<AnimatePresence initial={false}>
{hasConfigurationIssues && ref && (
<HeaderBanner
key="github-config-drift-banner"
variant="warning"
title="Code configuration needs attention"
description={
<>
Current environment values are active; {settingsLabel}.{' '}
<Link href={`/project/${ref}/settings/code-configuration`}>Review configuration</Link>
</>
}
/>
)}
</AnimatePresence>
)
}