mirror of
https://github.com/supabase/supabase.git
synced 2026-09-22 13:37:53 +08:00
232ce7e68c
## 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? Documentation update and a small Studio copy correction. ## What is the current behavior? The Logs guide mixes unified filtering with retired SQL Explorer instructions, and the Markdown field reference loses query semantics. ## What is the new behavior? The Logs guide mixed filtering and event inspection with the retired SQL Logs Explorer workflow. It now documents the unified Logs view: default sources, filter semantics, event details, Live, sharing, bounded exports, and missing results. The log field reference uses one mapping for HTML and Markdown, preserving source IDs, query expressions, and source/query types. The Studio User-filter empty state and comments now match its Auth and API Gateway scope. ## Additional context Validation: shared-field mapping tests, guides Markdown generation, docs typecheck, targeted docs/Studio ESLint, formatting, and browser inspection of the field table. Exported Markdown includes the source IDs and usable ClickHouse expressions. Repository-wide MDX lint has existing failures; changed pages have no reported violations. Self-review: hosted Studio filtering and log ingestion were checked against the implementation, not exercised against a hosted project. The documentation assumes the unified Logs experience is the default. Stage 1 of 3. Review and merge from the bottom of the stack. Stack: #50073 → #50074 → #50075. Production docs build also passes at the stack tip after standard reference generation. Initial CI note: the spelling action failed while building its container because Debian package downloads returned 404, before checking content. The stack has no merge conflicts. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Expanded the log field reference with ClickHouse fields, nested-field query examples, types, schema references, and capture limits. * Reworked the Logs guide with clearer instructions for filtering, event inspection, live mode, sharing, exports, retention, and missing results. * Clarified service and Postgres log behavior and updated navigation and metadata. * **Bug Fixes** * Corrected user-filtering guidance and empty-state messaging to identify Auth and API Gateway logs as supported sources. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Steven Eubank <eubank.steven88@gmail.com> Co-authored-by: Steven Eubank <47563310+smeubank@users.noreply.github.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { getLogFieldReference } from './SharedData.utils'
|
|
|
|
describe('getLogFieldReference', () => {
|
|
it('distinguishes ClickHouse columns from both prefixed and unprefixed attributes', () => {
|
|
const source = {
|
|
name: 'API Gateway',
|
|
reference: 'edge_logs',
|
|
fields: [
|
|
{ path: 'id', type: 'string' },
|
|
{ path: 'identifier', type: 'string' },
|
|
{ path: 'metadata.response.status_code', type: 'number' },
|
|
],
|
|
}
|
|
const [result] = getLogFieldReference([source])
|
|
expect(result.reference).toBe('edge_logs')
|
|
expect(result.fields).toEqual(
|
|
expect.arrayContaining([
|
|
expect.objectContaining({ path: 'id', queryField: 'id', queryType: 'String' }),
|
|
expect.objectContaining({ path: 'identifier', queryField: "log_attributes['identifier']" }),
|
|
expect.objectContaining({
|
|
path: 'metadata.response.status_code',
|
|
type: 'number',
|
|
queryField: "log_attributes['response.status_code']",
|
|
queryType: 'String',
|
|
}),
|
|
expect.objectContaining({
|
|
path: 'timestamp',
|
|
queryField: 'timestamp',
|
|
queryType: 'DateTime64',
|
|
}),
|
|
expect.objectContaining({ path: 'source', queryField: 'source' }),
|
|
])
|
|
)
|
|
expect(result.fields.filter((field) => field.path === 'id')).toHaveLength(1)
|
|
expect(source.fields).toHaveLength(3)
|
|
})
|
|
})
|