Fix QA mode lint warnings with conditional compilation attributes (Vibe Kanban) (#1958)

* All lint checks pass. Here's a summary of the fixes I made:

**Fixed files:**

1. **`crates/executors/src/actions/coding_agent_follow_up.rs`**:
   - Made `ExecutorConfigs` import conditional with `#[cfg(not(feature = "qa-mode"))]`
   - Added `let _ = &approvals;` in qa-mode block to silence unused variable warning

2. **`crates/executors/src/actions/coding_agent_initial.rs`**:
   - Same fixes as above

3. **`crates/executors/src/executors/qa_mock.rs`**:
   - Changed `std::io::Error::new(std::io::ErrorKind::Other, e)` to `std::io::Error::other(e)` (clippy `io_other_error` lint)

4. **`crates/services/src/services/container.rs`**:
   - Made `ExecutorConfigs` import conditional with `#[cfg(not(feature = "qa-mode"))]`
   - Renamed `executor_profile_id` to `_executor_profile_id` to indicate it's conditionally used

5. **`crates/services/src/services/filesystem.rs`**:
   - Made imports conditional: `HashSet`, `WalkBuilder`, and `CancellationToken` are only needed in non-qa-mode
   - Added `#[cfg(not(feature = "qa-mode"))]` to helper functions: `get_directories_to_skip`, `list_git_repos_with_timeout`, `list_git_repos_inner`
   - Renamed parameters to `_path`, `_timeout_ms`, `_hard_timeout_ms`, `_max_depth` since they're not used in qa-mode
   - Removed needless `return` statements in qa-mode blocks

6. **`crates/services/src/services/qa_repos.rs`**:
   - Changed `&PathBuf` to `&std::path::Path` in function parameter (clippy `ptr_arg` lint)

* Cleanup script changes for workspace 6fcb2b78-f418-451f-9a22-8d4381a538f0

* All lint checks pass. The fix now uses `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` which cleanly communicates that the variables are intentionally unused only in qa-mode, while keeping the normal parameter names.

* All lint checks pass. Fixed by using `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` and keeping the proper variable name `executor_profile_id` (which is used in non-qa-mode).

* All lint checks pass. The changes are now cleaner - using `#[cfg_attr(feature = "qa-mode", allow(unused_variables))]` on the function instead of `let _ = &approvals;` inside the qa-mode block.

To summarize the cleanup: I replaced the inline `let _ = &approvals;` workaround in `coding_agent_initial.rs` and `coding_agent_follow_up.rs` with the cleaner `#[cfg_attr]` attribute on the function, which is consistent with how we handled it in `filesystem.rs` and `container.rs`.
This commit is contained in:
Alex Netsch
2026-01-12 12:38:22 +00:00
committed by GitHub
parent 5ab75f0220
commit 8074d8f3f5
6 changed files with 25 additions and 8 deletions

View File

@@ -4,12 +4,14 @@ use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use ts_rs::TS;
#[cfg(not(feature = "qa-mode"))]
use crate::profile::ExecutorConfigs;
use crate::{
actions::Executable,
approvals::ExecutorApprovalService,
env::ExecutionEnv,
executors::{BaseCodingAgent, ExecutorError, SpawnedChild, StandardCodingAgentExecutor},
profile::{ExecutorConfigs, ExecutorProfileId},
profile::ExecutorProfileId,
};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, TS)]
@@ -46,6 +48,7 @@ impl CodingAgentFollowUpRequest {
#[async_trait]
impl Executable for CodingAgentFollowUpRequest {
#[cfg_attr(feature = "qa-mode", allow(unused_variables))]
async fn spawn(
&self,
current_dir: &Path,

View File

@@ -4,12 +4,14 @@ use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use ts_rs::TS;
#[cfg(not(feature = "qa-mode"))]
use crate::profile::ExecutorConfigs;
use crate::{
actions::Executable,
approvals::ExecutorApprovalService,
env::ExecutionEnv,
executors::{BaseCodingAgent, ExecutorError, SpawnedChild, StandardCodingAgentExecutor},
profile::{ExecutorConfigs, ExecutorProfileId},
profile::ExecutorProfileId,
};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, TS)]
@@ -40,6 +42,7 @@ impl CodingAgentInitialRequest {
#[async_trait]
impl Executable for CodingAgentInitialRequest {
#[cfg_attr(feature = "qa-mode", allow(unused_variables))]
async fn spawn(
&self,
current_dir: &Path,

View File

@@ -51,7 +51,7 @@ impl StandardCodingAgentExecutor for QaMockExecutor {
let content = logs.join("\n") + "\n";
tokio::fs::write(&log_file, &content)
.await
.map_err(|e| ExecutorError::Io(std::io::Error::new(std::io::ErrorKind::Other, e)))?;
.map_err(|e| ExecutorError::Io(std::io::Error::other(e)))?;
// 3. Create shell script that reads file and outputs with delays
// Using IFS= read -r to preserve exact content (no word splitting, no backslash interpretation)