{"record":{"id":"75d8b394c67ed55e","repo":"dbt-labs/dbt-core","slug":"progress-style-template-is-valid","errorCode":null,"errorMessage":"Progress style template is valid","messagePattern":"Progress style template is valid","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-tui-progress/src/styles.rs","lineNumber":41,"sourceCode":"/// Available progress bar style variants.\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\npub enum ProgressStyleType {\n    /// A simple spinner with elapsed time, counters, and context items.\n    Spinner,\n    /// A wide progress bar with position/total and elapsed time.\n    FancyWideBar,\n    /// A thin progress bar with counters, displaying context on a separate line.\n    FancyThinBarWithCounters,\n}\n\nimpl ProgressStyleType {\n    /// Returns the indicatif `ProgressStyle` for this style type.\n    pub fn get_style(&self) -> ProgressStyle {\n        match self {\n            ProgressStyleType::Spinner => ProgressStyle::with_template(\n                \"{prefix:.cyan.bold} {spinner:.green.bold} [{elapsed}] {counters} {context}\",\n            )\n            .expect(\"Progress style template is valid\"),\n            ProgressStyleType::FancyWideBar => ProgressStyle::default_bar()\n                .template(\"{prefix:.cyan.bold} {spinner:.green} ▐{bar:20.bright_cyan/dim}▌ {pos}/{human_len} [{elapsed}]\")\n                .expect(\"Progress style template is valid\")\n                .progress_chars(\"█▉▊▋▌▍▎▏ \"),\n            ProgressStyleType::FancyThinBarWithCounters => ProgressStyle::default_bar()\n                .template(\"{prefix:.cyan.bold} [{bar:20.cyan}] {pos}/{len} {counters}\")\n                .expect(\"Progress style template is valid\")\n                .progress_chars(\"━━╾─ \"),\n        }\n    }\n\n    /// Returns the style for the context line (used with `FancyThinBarWithCounters`).\n    pub fn get_context_line_style(&self) -> ProgressStyle {\n        ProgressStyle::with_template(\"   {context}\").expect(\"Progress style template is valid\")\n    }\n\n    /// Returns whether this style type needs a separate context line.\n    pub fn needs_context_line(&self) -> bool {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-tui-progress/src/styles.rs#L23-L59","documentation":"Panic from `.expect()` in `ProgressStyleType::get_style` when building the Spinner style. The template string is a compile-time constant; indicatif's `with_template` only fails for templates referencing invalid format keys. The expect asserts the built-in template is always valid — hitting it means an indicatif version incompatibility or corrupted build, not user input.","triggerScenarios":"Calling `get_style()` on `ProgressStyleType::Spinner` while the installed `indicatif` crate version rejects one of the template keys (`{prefix}`, `{spinner}`, `{elapsed}`, `{counters}`, `{context}`) — e.g. after a semver-incompatible indicatif upgrade.","commonSituations":"Dependency resolution pulled a different indicatif major/minor than the one the templates were written against; vendored/patched builds with altered feature flags.","solutions":["Check the locked `indicatif` version (`cargo tree -p indicatif`) and pin it to the version the crate was developed against.","Update `dbt-tui-progress` templates if indicatif was intentionally upgraded and a key was renamed/removed.","Report upstream if the crash occurs with the expected dependency versions — it signals a broken template constant."],"exampleFix":"// Cargo.toml before (indicatif drifted)\nindicatif = \"0.18\"\n\n// after (pin to compatible version)\nindicatif = \"=0.17.8\"","handlingStrategy":"validation","validationCode":"// CI smoke test\ntest_style_constructs(ProgressStyleType::Spinner);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the indicatif dependency version in Cargo.lock.","Add a CI test constructing every `ProgressStyleType` variant.","Review indicatif changelogs before dependency upgrades for template key changes."],"tags":["tui","progress-bar","panic","template"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}