fix(cli): implement transparent serialization for JobId and fix receipt parsing#3066
fix(cli): implement transparent serialization for JobId and fix receipt parsing#3066brbrainerd wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds #[serde(transparent)] to JobId so it serializes as a raw UUID; updates CLI index and file commands to accept and print JobReceipt (id + job_name) returned by the daemon; and adds a task doc describing the issue and acceptance criteria. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI
participant Daemon
participant Core
CLI->>Daemon: submit job request (index / copy)
Daemon->>Core: create job (generate JobId, set job_name)
Core-->>Daemon: JobReceipt { id, job_name }
Daemon-->>CLI: JSON-encoded JobReceipt
CLI->>CLI: deserialize JobReceipt, print id and job_name
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/cli/src/domains/file/mod.rs (1)
3-14: Keepsd_coreimports in the external-crate group.Line 11 adds an external crate import after local
crateimports. Movesd_coreup with the other external crates. As per coding guidelines,**/*.rs: “Group imports with blank lines: standard library, external crates, then local modules”.Proposed import grouping
use anyhow::Result; use clap::Subcommand; use comfy_table::presets::UTF8_BORDERS_ONLY; +use sd_core::infra::job::handle::JobReceipt; +use sd_core::infra::query::LibraryQuery; +use crate::context::Context; use crate::format_bytes; use crate::util::prelude::*; - -use crate::context::Context; -use sd_core::infra::job::handle::JobReceipt; -use sd_core::infra::query::LibraryQuery; use self::args::*;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/cli/src/domains/file/mod.rs` around lines 3 - 14, The sd_core imports (sd_core::infra::job::handle::JobReceipt and sd_core::infra::query::LibraryQuery) are placed after local crate imports; move those two use lines into the external-crate group with the other externals (e.g., after comfy_table::presets::UTF8_BORDERS_ONLY) and ensure a blank line separates external crates from local crate imports (use crate::... and self::args::* remain in the local group).apps/cli/src/domains/index/mod.rs (1)
3-12: Move thesd_coreimport above local imports.Line 10 adds an external crate import after local
crateimports. Keep external crates together before local modules. As per coding guidelines,**/*.rs: “Group imports with blank lines: standard library, external crates, then local modules”.Proposed import grouping
use anyhow::Result; use clap::Subcommand; use comfy_table::{presets::UTF8_BORDERS_ONLY, Attribute, Cell, Table}; +use sd_core::{infra::job::handle::JobReceipt, ops::libraries::list::query::ListLibrariesQuery}; use crate::util::prelude::*; - use crate::{context::Context, util::error::CliError}; -use sd_core::{infra::job::handle::JobReceipt, ops::libraries::list::query::ListLibrariesQuery}; use self::args::*;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/cli/src/domains/index/mod.rs` around lines 3 - 12, The sd_core external crate import (sd_core::{infra::job::handle::JobReceipt, ops::libraries::list::query::ListLibrariesQuery}) is placed after local crate imports; move that line up into the external-crates block so external imports appear together before local modules, and ensure a blank line separates external crates from local imports (e.g., keep use clap::Subcommand and comfy_table... and sd_core grouped together, then a blank line, then use crate::... and use self::args::*).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/cli/src/domains/file/mod.rs`:
- Around line 3-14: The sd_core imports (sd_core::infra::job::handle::JobReceipt
and sd_core::infra::query::LibraryQuery) are placed after local crate imports;
move those two use lines into the external-crate group with the other externals
(e.g., after comfy_table::presets::UTF8_BORDERS_ONLY) and ensure a blank line
separates external crates from local crate imports (use crate::... and
self::args::* remain in the local group).
In `@apps/cli/src/domains/index/mod.rs`:
- Around line 3-12: The sd_core external crate import
(sd_core::{infra::job::handle::JobReceipt,
ops::libraries::list::query::ListLibrariesQuery}) is placed after local crate
imports; move that line up into the external-crates block so external imports
appear together before local modules, and ensure a blank line separates external
crates from local imports (e.g., keep use clap::Subcommand and comfy_table...
and sd_core grouped together, then a blank line, then use crate::... and use
self::args::*).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 78193b71-6312-441b-858f-2b3337f01930
📒 Files selected for processing (4)
.tasks/core/CLI-001-fix-jobid-serialization-and-receipts.mdapps/cli/src/domains/file/mod.rsapps/cli/src/domains/index/mod.rscore/src/infra/job/types.rs
ca16557 to
70ba74c
Compare
70ba74c to
10e9edb
Compare
|
Addressed automated review feedback: standardized import organization across the CLI file and index domains. |
This PR resolves CLI communication failures caused by improper JSON deserialization of Job identifiers.
Key changes:
Task File: .tasks/core/CLI-001-fix-jobid-serialization-and-receipts.md
Closes CLI-001