fix(task): dont truncate task message when CI is set#6620
Conversation
There was a problem hiding this comment.
Pull Request Overview
Fixes task message truncation in CI environments by bypassing the truncation logic when the CI environment variable is set.
- Modified the
truncfunction to return the full message without truncation when CI mode is detected - Added test coverage to verify that task output is not truncated with ellipsis when CI environment variable is set
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/cli/run.rs | Added CI check to bypass message truncation in the trunc function |
| e2e/tasks/test_task_display_truncation | Added test case to verify no truncation occurs in CI mode |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| fn trunc(prefix: &str, msg: &str) -> String { | ||
| if Settings::get().ci { | ||
| return msg.to_string(); |
There was a problem hiding this comment.
hmm I wonder if we still may want to truncate eventually, users could have a truly massive line here
There was a problem hiding this comment.
fair point, question is what would be a realistic value instead of 80?
### 📦 Registry - add lazyssh by @TyceHerrman in [#6610](#6610) ### 🚀 Features - **(config)** Add a ceiling to how mise searchs for config & tasks by @richardthe3rd in [#6041](#6041) ### 🐛 Bug Fixes - **(task)** use config_root instead of project_root for task base path by @risu729 in [#6609](#6609) - **(task)** resolve project tasks in run blocks using TaskLoadContext by @jdx in [#6614](#6614) - **(task)** dont truncate task message when CI is set by @roele in [#6620](#6620) - **(ui)** prevent OSC 9;4 progress sequences from being written to non-terminals by @jdx in [#6615](#6615) ### Chore - remove cosign/slsa-verifier from mise.toml by @jdx in [#6616](#6616) ### New Contributors - @richardthe3rd made their first contribution in [#6041](#6041)
|
thank you! |
|
@roele I'm not a fan of this maybe we could only show the first line? |
|
Have to agree on this, showing the entire output is not a good idea 🤔 |
Partially reverts the CI-specific behavior from #6620. Instead of showing the full command in CI mode and truncating with ellipsis in non-CI mode, now always shows just the first line of the command without any truncation character, regardless of CI setting. This provides consistent behavior across all environments while keeping the display clean and predictable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Partially reverts the CI-specific behavior from #6620. Instead of showing the full command in CI mode and truncating with ellipsis in non-CI mode, now always shows just the first line of the command without any truncation character, regardless of CI setting. This provides consistent behavior across all environments while keeping the display clean and predictable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
) ## Summary Simplifies task command display to always show just the first line, with different truncation behavior based on environment. ## Changes **Before:** - In CI mode: showed full command (potentially multiple lines) - In non-CI mode: showed first line truncated to terminal width with "…" **After:** - In CI mode: shows full first line without truncation - In non-CI mode: shows first line truncated to terminal width with "…" This maintains the terminal width truncation for non-CI environments (like before #6620) while keeping the CI improvement from #6620, but now both modes only show the first line of multi-line commands. ## Implementation - Updated `src/task/task_output.rs::trunc()` to always extract first line before applying truncation logic - Kept CI-specific logic to skip truncation in CI mode - Updated function documentation ## Test Plan - ✅ Existing test `test_task_display_truncation` passes (verifies no "…" character in CI mode) - ✅ All task output tests pass - ✅ Clean and predictable display in all environments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>

Skip truncation of task message if
CIis set as mentioned in #6618