Skip to content

📝 CodeRabbit Chat: Implement requested code changes#324

Open
coderabbitai[bot] wants to merge 1 commit intomainfrom
coderabbitai/chat/1b3322e
Open

📝 CodeRabbit Chat: Implement requested code changes#324
coderabbitai[bot] wants to merge 1 commit intomainfrom
coderabbitai/chat/1b3322e

Conversation

@coderabbitai
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot commented Mar 13, 2026

Code changes was requested by @leynos.

The following files were modified:

  • backend/tests/user_interests_revision_conflicts_bdd.rs
  • backend/tests/user_interests_revision_conflicts_bdd/db_support.rs
  • backend/tests/user_interests_revision_conflicts_bdd/flow_support.rs

@coderabbitai
Copy link
Copy Markdown
Contributor Author

coderabbitai Bot commented Mar 13, 2026

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f02d0caa-bb94-4fa5-9e8f-03f88cff6ac3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Failed
Enforce advisory code health rules (2 files with Code Duplication, Excess Number of Function Arguments)

Gates Passed
5 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
flow_support.rs 2 advisory rules 9.10 Suppress
user_interests_revision_conflicts_bdd.rs 1 advisory rule 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.

Comment on lines +60 to +72
fn existing_preferences_revision_1_with_preserved_safety_and_unit_settings(world: &mut World) {
if is_skipped(world) {
return;
}

let db = world.db.as_ref().expect("db context");
seed_preferences(
db.database_url.as_str(),
Uuid::parse_str(FIXTURE_AUTH_ID).expect("valid fixture UUID"),
PreferencesData::new(&[FIRST_THEME_ID], &[SAFETY_TOGGLE_ID], "imperial", 1),
)
.expect("seed user preferences");
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Code Duplication
The module contains 6 functions with similar structure: existing_preferences_revision_1_with_preserved_safety_and_unit_settings,existing_preferences_revision_2,the_first_interests_response_includes_revision_1,the_response_is_a_conflict_with_expected_revision_1_and_actual_revision_2 and 2 more functions

Suppress

Comment on lines +114 to +132
async fn update_interests_snapshot<S>(
app: &S,
cookie: Cookie<'static>,
payload: InterestsRequest,
) -> Snapshot
where
S: actix_web::dev::Service<
actix_http::Request,
Response = actix_web::dev::ServiceResponse<actix_web::body::BoxBody>,
Error = actix_web::Error,
>,
{
let req = actix_test::TestRequest::put()
.uri("/api/v1/users/me/interests")
.cookie(cookie)
.set_json(payload)
.to_request();
capture_snapshot(actix_test::call_service(app, req).await, false).await
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Code Duplication
The module contains 5 functions with similar structure: preferences_snapshot,run_first_write,run_missing_revision_conflict,run_stale_revision_conflict and 1 more functions

Suppress

Comment on lines +338 to +373
pub(crate) fn assert_preferences_snapshot(
snapshot: &Snapshot,
expected_interest_ids: &[&str],
expected_safety_ids: &[&str],
expected_unit_system: &str,
expected_revision: u32,
) {
assert_eq!(snapshot.status, 200);
let body = snapshot.body.as_ref().expect("preferences body");
assert_eq!(
body.get("interestThemeIds")
.and_then(Value::as_array)
.expect("interestThemeIds array")
.iter()
.map(|value| value.as_str().expect("string interest id"))
.collect::<Vec<_>>(),
expected_interest_ids
);
assert_eq!(
body.get("safetyToggleIds")
.and_then(Value::as_array)
.expect("safetyToggleIds array")
.iter()
.map(|value| value.as_str().expect("string safety id"))
.collect::<Vec<_>>(),
expected_safety_ids
);
assert_eq!(
body.get("unitSystem").and_then(Value::as_str),
Some(expected_unit_system)
);
assert_eq!(
body.get("revision").and_then(Value::as_u64),
Some(u64::from(expected_revision))
);
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Excess Number of Function Arguments
assert_preferences_snapshot has 5 arguments, max arguments = 4

Suppress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant