feat: revamp min init output - #773
Conversation
📝 WalkthroughWalkthroughProject initialization now passes the target repository to TOML generation. Generated files omit unmatched stack settings, always include base session packages, and add ChangesProject initialization generation
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/op/src/project/init.rs (1)
329-346: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the complete session package behavior.
This test passes even if
baseorvimdisappears, and no test covers addinggitwhen.gitexists. Assert the exact package list for both repository states, preferably by parsing the generated TOML.Proposed coverage
assert!(out.contains("[session]")); + assert!(out.contains(r#"packages = ["base", "vim"]"#)); } + +#[test] +fn generate_mfile_adds_git_to_session_for_git_repository() { + let origin = SpecOrigin::Repo(Repo::Git { + url: "u".to_string(), + rev: "r".to_string(), + tracking: None, + }); + let cwd = TempDir::new().unwrap(); + std::fs::create_dir(cwd.path().join(".git")).unwrap(); + + let out = generate_mfile(None, &origin, cwd.path()); + + assert!(out.contains(r#"packages = ["base", "vim", "git"]"#)); +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/op/src/project/init.rs` around lines 329 - 346, Strengthen generate_mfile_falls_back_to_upstream_with_session by parsing the generated TOML and asserting the complete session package list, including base, vim, and git when the temporary directory contains a .git directory. Add coverage for both repository states: without .git, verify the expected packages excluding git; with .git, verify git is included, while preserving the existing assertions for absent stack, branch, and package sections.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/op/src/project/init.rs`:
- Around line 329-346: Strengthen
generate_mfile_falls_back_to_upstream_with_session by parsing the generated TOML
and asserting the complete session package list, including base, vim, and git
when the temporary directory contains a .git directory. Add coverage for both
repository states: without .git, verify the expected packages excluding git;
with .git, verify git is included, while preserving the existing assertions for
absent stack, branch, and package sections.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6606fb7e-77c6-4912-b4c2-4b1b5ee2b258
📒 Files selected for processing (1)
crates/op/src/project/init.rs
shellstack if we couldnt match with a known stack.shelltask - that use case is covered by sessions[session]section, with a few likely+recognizable CLI tools.Summary by CodeRabbit
New Features
Bug Fixes