Document Ninja executable override (#83)#323
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Comment on lines +244 to +260 fn verbose_build_logs_default_ninja_command(
temp_with_minimal_manifest: Result<TempDir>,
) -> Result<()> {
let temp = temp_with_minimal_manifest?;
let ninja_temp = tempdir().context("create fake ninja dir")?;
let ninja_path = ninja_temp.path().join(fake_ninja_name("ninja"));
write_fake_ninja_script(&ninja_path, &[], None)?;
let stderr =
run_verbose_build_with_ninja_env(temp.path(), path_containing(ninja_temp.path())?, None)?;
ensure!(
stderr.contains("Executing command: ninja "),
"default build should log the fallback ninja program, got:\n{stderr}"
);
Ok(())
}❌ New issue: Code Duplication |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
cat tests/logging_stderr_tests.rsLength of output: 13381 File: FixExtract a private helper that owns the shared setup and assertion logic; keep the two fn run_verbose_build_and_assert_ninja_log(
temp_with_minimal_manifest: Result<TempDir>,
ninja_stem: &str,
use_env_override: bool,
) -> Result<()> {
let temp = temp_with_minimal_manifest?;
let ninja_temp = tempdir().context("create fake ninja dir")?;
let ninja_path = ninja_temp.path().join(fake_ninja_name(ninja_stem));
write_fake_ninja_script(&ninja_path, &[], None)?;
let ninja_env = use_env_override.then_some(ninja_path.as_path());
let stderr =
run_verbose_build_with_ninja_env(temp.path(), path_containing(ninja_temp.path())?, ninja_env)?;
let expected = if use_env_override {
format!("Executing command: {} ", ninja_path.display())
} else {
format!("Executing command: {ninja_stem} ")
};
let description = if use_env_override {
"override build should log the resolved ninja program"
} else {
"default build should log the fallback ninja program"
};
ensure!(
stderr.contains(&expected),
"{description}, got:\n{stderr}"
);
Ok(())
}
#[rstest]
fn verbose_build_logs_default_ninja_command(
temp_with_minimal_manifest: Result<TempDir>,
) -> Result<()> {
run_verbose_build_and_assert_ninja_log(temp_with_minimal_manifest, "ninja", false)
}
#[rstest]
fn verbose_build_logs_ninja_env_override(
temp_with_minimal_manifest: Result<TempDir>,
) -> Result<()> {
run_verbose_build_and_assert_ninja_log(temp_with_minimal_manifest, "custom-ninja", true)
}AI coding-agent prompt |
Document `NETSUKE_NINJA` in the user and runner documentation so users can find the portable Ninja executable override. Add binary-level logging coverage for the default `ninja` fallback and an explicit `NETSUKE_NINJA` path so verbose command traces show the resolved program in both cases.
6247da7 to
f914024
Compare
There was a problem hiding this comment.
Gates Failed
Enforce advisory code health rules
(1 file with Code Duplication)
Our agent can fix these. Install it.
Gates Passed
5 Quality Gates Passed
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| logging_stderr_tests.rs | 1 advisory rule | 10.00 → 9.39 | Suppress |
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Summary
This branch documents and verifies the
NETSUKE_NINJAexecutable override for issue #83. It makes the user-facing variable discoverable, corrects stale internal documentation that referred to the Rust constant name, and adds binary-level coverage showing the verbose command log contains the resolved Ninja program.Closes #83.
Review walkthrough
NETSUKE_NINJAguidance.Validation
cargo test --test logging_stderr_tests verbose_build_logs -- --nocapture: passed.make check-fmt: passed.make lint: passed.make test: passed.make markdownlint: passed.make nixie: passed.coderabbit review --agent: attempted twice; both invocations stalled at sandbox preparation, and the second timed out after five minutes without findings.