workspace: show backend error details

This commit is contained in:
Keisuke Hirata 2026-07-13 19:51:28 +09:00
parent fb0d5aeaa9
commit 60c772ec38
No known key found for this signature in database
3 changed files with 36 additions and 6 deletions

View File

@ -1,8 +1,8 @@
--- ---
title: 'Show backend operation error details' title: 'Show backend operation error details'
state: 'inprogress' state: 'done'
created_at: '2026-07-13T10:45:59Z' created_at: '2026-07-13T10:45:59Z'
updated_at: '2026-07-13T10:46:30Z' updated_at: '2026-07-13T10:51:20Z'
assignee: null assignee: null
queued_by: 'yoi ticket' queued_by: 'yoi ticket'
queued_at: '2026-07-13T10:46:30Z' queued_at: '2026-07-13T10:46:30Z'

View File

@ -39,4 +39,31 @@ Ticket を `yoi ticket` が queued にしました。
State changed to `inprogress`. State changed to `inprogress`.
---
<!-- event: implementation_report author: hare at: 2026-07-13T10:51:20Z -->
## Implementation report
Changed workspace-server backend operation error reporting to preserve backend messages instead of replacing them with the fixed `backend-private details were omitted` text.
- `sanitize_backend_error` now returns the original message.
- Updated the existing test to assert backend operation details are preserved.
Validation:
- `cargo fmt --check`
- `git diff --check`
- `cargo test -q -p yoi-workspace-server`
- `nix build .#yoi --no-link`
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-13T10:51:20Z from: inprogress to: done reason: cli_state field: state -->
## State changed
State changed to `done`.
--- ---

View File

@ -4637,8 +4637,8 @@ fn settings_diagnostic(
} }
} }
fn sanitize_backend_error(_message: &str) -> String { fn sanitize_backend_error(message: &str) -> String {
"operation failed; backend-private details were omitted".to_string() message.to_string()
} }
fn repository_diagnostics( fn repository_diagnostics(
@ -5201,11 +5201,14 @@ mod tests {
} }
#[test] #[test]
fn sanitized_errors_omit_backend_private_paths() { fn backend_errors_preserve_operation_details() {
let sanitized = sanitize_backend_error( let sanitized = sanitize_backend_error(
"failed to open /home/example/.yoi/workspace-backend.local.toml", "failed to open /home/example/.yoi/workspace-backend.local.toml",
); );
assert!(!sanitized.contains("/home/example")); assert_eq!(
sanitized,
"failed to open /home/example/.yoi/workspace-backend.local.toml"
);
} }
#[tokio::test] #[tokio::test]