Skip to content

chore(integrations/grafana): get rid of AI generated SDK#15222

Merged
franklevasseur merged 1 commit into
masterfrom
fl_grafana_get_rid_of_sdk
May 27, 2026
Merged

chore(integrations/grafana): get rid of AI generated SDK#15222
franklevasseur merged 1 commit into
masterfrom
fl_grafana_get_rid_of_sdk

Conversation

@franklevasseur
Copy link
Copy Markdown
Member

No description provided.

@franklevasseur franklevasseur requested a review from a team as a code owner May 27, 2026 19:09
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Greptile Summary

This PR removes an AI-generated TypeScript SDK file (GrafanaDashboard.ts) that held Grafana dashboard type definitions, replacing the external import with a small set of locally-defined types directly in client.ts.

  • Deleted GrafanaDashboard.ts: the AI-generated file contained TextPanel, TimeSeriesPanel, Panel, and supporting types; functionally identical types are now inlined in client.ts.
  • Updated dashboard-schemas.ts: removed the satisfies z.ZodType<Partial<…>> constraints that previously linked the Zod schemas to the deleted type file; the schemas themselves are unchanged.
  • Updated client.ts: dropped the Panel import and added equivalent local type definitions; no logic changes.

Confidence Score: 4/5

Safe to merge — the deleted file's types are faithfully reproduced in client.ts and no runtime behaviour changes.

The type definitions moved into client.ts are structurally identical to the deleted ones, so there is no functional regression. The only consequence is that the Zod schemas in dashboard-schemas.ts and the TypeScript types in client.ts can now silently diverge in the future since the compile-time satisfies guard was removed along with the deleted file.

dashboard-schemas.ts — the two satisfies constraints were the only mechanism keeping the Zod schemas and TypeScript types in sync; worth revisiting if a shared types file is introduced later.

Important Files Changed

Filename Overview
integrations/grafana/definitions/dashboard-schemas.ts Removed import and two satisfies z.ZodType<Partial<…>> constraints; schemas now standalone with no compile-time link to the TypeScript types in client.ts
integrations/grafana/grafana-api/GrafanaDashboard.ts Deleted AI-generated SDK file; all referenced types are now either inlined in client.ts or no longer needed
integrations/grafana/src/client.ts Replaced the external Panel/TextPanel/TimeSeriesPanel import with identical locally-defined types; functional behaviour is unchanged

Reviews (1): Last reviewed commit: "chore(integrations/grafana): get rid of ..." | Re-trigger Greptile

id: z.number().optional().title('ID').describe('Numeric panel ID (assigned by Grafana)'),
gridPos: gridPosSchema.optional().title('Grid Position').describe('Position and size of the panel in the grid'),
}) satisfies z.ZodType<Partial<TextPanel>>
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Compile-time schema/type sync check removed

Dropping satisfies z.ZodType<Partial<TextPanel>> (and the TimeSeriesPanel counterpart) removes the only compile-time guard that kept the Zod schemas aligned with the TypeScript types. Those types now live in client.ts as pure TypeScript, but nothing links them back to the schemas. A future contributor could add a field to TextPanel/TimeSeriesPanel in client.ts without updating the Zod schema, and the mismatch would silently pass the type checker. Consider extracting the shared types to a small types.ts file that both dashboard-schemas.ts and client.ts can import, so the satisfies constraint can be restored without circular dependencies.

@franklevasseur franklevasseur merged commit 6be1910 into master May 27, 2026
10 checks passed
@franklevasseur franklevasseur deleted the fl_grafana_get_rid_of_sdk branch May 27, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants