chore(integrations/grafana): cleanp code gen#15221
Conversation
|
| Filename | Overview |
|---|---|
| integrations/grafana/grafana-api/GrafanaDashboard.ts | Hand-written Grafana dashboard types moved from src/gen/types/ to grafana-api/; contains a garbled JSDoc comment on line 2 ("AI with"). |
| integrations/grafana/.gitignore | Deleted the force-include overrides (!src/gen, !src/gen/**). Without them, the root gen gitignore pattern now masks src/gen/, so new untracked generated files won't be stageable without -f. |
| integrations/grafana/src/client.ts | Single-line import path change: Panel type now imported from ../grafana-api/GrafanaDashboard instead of ./gen/types/GrafanaDashboard. No logic changes. |
| integrations/grafana/package.json | Generate scripts updated to reference ./grafana-api/.json instead of ./src/gen/specs/.json, consistent with the spec file migration. |
| integrations/grafana/grafana-api/README.md | New documentation file explaining how to fetch and update the two API specs (legacy and K8s) and why both clients exist. |
| integrations/grafana/tsconfig.json | Added grafana-api/*.ts to the TypeScript include paths to compile the newly relocated hand-written types. |
| integrations/grafana/definitions/dashboard-schemas.ts | Import path for TextPanel/TimeSeriesPanel updated to ../grafana-api/GrafanaDashboard; no logic changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph grafana-api ["grafana-api/ (source of truth)"]
SPEC1[grafana-dashboard-k8s.json]
SPEC2[grafana-folder-k8s.json]
SPEC3[grafana-legacy.json]
TYPES[GrafanaDashboard.ts]
README[README.md]
end
subgraph gen ["src/gen/ (auto-generated)"]
K8S[grafana-k8s-client/]
LEGACY[grafana-legacy-client/]
end
SPEC1 -->|pnpm run generate:k8s| K8S
SPEC2 -->|pnpm run generate:k8s| K8S
SPEC3 -->|pnpm run generate:legacy| LEGACY
K8S --> CLIENT[src/client.ts]
LEGACY --> CLIENT
TYPES --> CLIENT
TYPES --> DEFS[definitions/dashboard-schemas.ts]
Comments Outside Diff (1)
-
integrations/grafana/.gitignoreMissing gitignore override for
src/genThe root
.gitignorehas a baregenpattern that matches any directory namedgenat any depth — includingintegrations/grafana/src/gen. The deleted file was the only thing overriding that exclusion (!src/gen/!src/gen/**). Existing tracked files insrc/gen/will still appear as modified ingit status, but any new file produced bypnpm run generate(e.g. when the API spec gains a new schema) will be silently invisible to git and cannot be staged withoutgit add -f. Consider adding a newintegrations/grafana/.gitignorethat re-includes the generated output, or moving the generated clients to a path not matched by the rootgenrule.
Reviews (1): Last reviewed commit: "update" | Re-trigger Greptile
No description provided.