Repository navigation
Conversation
…1173) Move models/clickstack_enums.rs in as models/clickstack/enums.rs. mod.rs now declares and glob re-exports enums in place of the old `use super::clickstack_enums::*`, and models.rs drops its clickstack_enums module, so models::* paths are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the ClickStack models out of models/clickstack/mod.rs into alerts, dashboards, tiles, sources, saved_searches, webhooks and roles submodules. dashboards keeps the dashboard request/response, containers, filters, saved filter values and validation types; tiles holds the tile wrappers, every dashboard chart config and series, and the on-click types. mod.rs keeps the chart building blocks that alert and tile chart configs share (select items, formulas, number formats, background charts and colour conditions) and glob re-exports every submodule, so models::* paths are unchanged. Moves only: the item text is unchanged; only mod/use lines were added, including a #[cfg(doc)] import so the alert chart configs' intra-doc links to their tile counterparts still resolve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each models/clickstack/*.rs module, enums.rs included, maps to no live suite, like models/clickstack.rs and models/clickstack_enums.rs did. The old paths stay mapped so diffs that name them remain classified. The install classifier only inventories crates/clickhousectl and never mapped either old path, so it needs no entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1173 (6 of 6:
models/clickstack). Stacked on #1180.Summary
This splits
src/models/clickstack.rs(6.7k lines) intosrc/models/clickstack/and movessrc/models/clickstack_enums.rsin asclickstack/enums.rs. Behaviour and the public surface are unchanged.mod.rsglob re-exports every submodule, so every crate-root andmodels::*path still resolves.I chose the seams from the type-reference graph, starting at the request and response types of each
Clientmethod. Each resource's types are reachable only from that resource. Dashboard-only types are split intodashboards.rsandtiles.rs. The only types that alerts and dashboards share stay inmod.rs.mod.rsmod/pub usefacade, plus the chart building blocks that alert and tile chart configs share:SelectItem,Formula,NumberFormat,BackgroundChart,NumberTileColorConditionand the between/equality/numeric colour conditionsalerts.rsAlert*ChartConfigunions and their builder/raw-SQL variants, silenced/execution-error, overlaydashboards.rsFilterunions (query-expression, Prometheus label, source, static list), saved filter values (SQL and variable), validate-dashboard responsetiles.rsTileInput/TileOutput,TileConfig, every dashboard chart config (bar, categorical bar, line, stacked line, number, pie, table, heatmap, markdown, search, event patterns) and series, on-click typessources.rsSourceunion; log, trace, metric, session and PromQL sources; materialized views, highlighted attributes, filter settings; connectionssaved_searches.rswebhooks.rsWebhookunion and its variants, webhook input, validate-webhook responseroles.rsenums.rsgit mvofclickstack_enums.rs, unchangedCommits
git mvs, plus the minimal edit to compile.clickstack.rs→clickstack/mod.rs(99%) andclickstack_enums.rs→clickstack/enums.rs(100%), so blame follows both files. Inmod.rs,use super::clickstack_enums::*becomesmod enums; pub use enums::*;.models.rsdropsmod clickstack_enumsand its re-export.Defaultimpl moved with its type. I compared the sorted line multisets before and after this commit. No line was removed, and the only added lines aremod,pub useanduselines. One of those is a#[cfg(doc)]import inalerts.rs, so the alert chart configs' rustdoc links to their tile counterparts still resolve (cargo doc -D warningsis clean). Review it withgit show --color-moved=dimmed-zebra.models/clickstack/*.rsmaps toNO_SUITES, as both parents did. The old paths stay mapped, as the classifier requires for deleted files. The install classifier needs no change..git-blame-ignore-revsentry for commit 2. This SHA must be updated if the stack is rebased before merge.AGENTS.mdlayout section and the README layout table now describesrc/models/clickstack/.Visibility widenings
None. Every moved item was already
pub. Submodules import shared types explicitly fromsuperand the enums throughsuper::enums::*.Tests
--listoutput is identical, module paths included.spec_coverage_testandmodel_facade_testpass untouched.python3 scripts/check-openapi-drift.py --dry-runreports the same findings before and after (0 actionable).cargo fmt --all, both clippy configurations,cargo check -p clickhousectl --no-default-features,cargo check --workspace --all-features,cargo test -p clickhouse-cloud-api -p clickhouse-openapi-analyzerand the Python classifier tests all pass.Merge with a merge commit, not a squash. The
.git-blame-ignore-revsentry names this PR's move commit. A squash merge would leave it pointing at a commit that isn't on main, and git would silently ignore it.🤖 Generated with Claude Code
Note
Low Risk
Mechanical file moves and re-exports with no serde or type surface changes; risk is limited to merge/rebase hygiene for blame-ignore metadata.
Overview
Reorganizes the large monolithic ClickStack model layer into
src/models/clickstack/, mirroring the existingclickpipes/split pattern without changing API behavior or public paths.clickstack.rsandclickstack_enums.rsbecome a directory: shared chart primitives stay inmod.rs, while alerts, dashboards, tiles, sources, saved searches, webhooks, roles, and enums live in dedicated modules re-exported through the facade.models.rsdrops the separateclickstack_enumsmodule;pub use clickstack::*still exposes the same crate-root types.Supporting updates only:
.git-blame-ignore-revsfor the move commit,AGENTS.md/ README layout notes, and the cloud integration classifier (newmodels/clickstack/*.rspaths mapped toNO_SUITES).Reviewed by Cursor Bugbot for commit 5d5996b. Bugbot is set up for automated code reviews on this repo. Configure here.