From a3d22dd599da766e59e52896f4b0766b94c49d07 Mon Sep 17 00:00:00 2001 From: Jordi Gil Date: Wed, 12 Aug 2026 20:33:11 -0400 Subject: [PATCH] fix(xtask): restore make lint to green on main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `make lint` fails on main today with two independent issues in the same gate, both pre-existing and unrelated to any change of mine: 1. `cargo clippy -D warnings` (clippy::match_same_arms): both `IngressMode::Global` and `IngressMode::Workload` map to the same `DEFAULT_WORKLOAD_IMAGE_PULL_POLICY` value in `demo_image_pull_policy`. Merged into a single or-pattern arm, matching clippy's own suggested fix, with a doc comment explaining why the parameter is kept despite both variants currently sharing a default. Existing test coverage (`public_demo_modes_use_registry_defaults`) already asserts both variants return the same value, so no new test is needed. 2. `cargo +nightly-2026-03-28 fmt --all -- --check`: two call sites (`combined_site_demo.rs`, `image_overrides.rs`'s own test module) had drifted from the pinned nightly formatter's output. CI's own `lint` job short-circuits at the clippy step today, so this second, independent failure is currently hidden — fixing only the clippy issue would just move the same red `lint` check to a different error. Ran `cargo +nightly-2026-03-28 fmt --all` (the exact toolchain CI pins) to resolve; purely whitespace/line-wrapping, no logic changes. Signed-off-by: Jordi Gil --- xtask/src/env/combined_site_demo.rs | 3 +-- xtask/src/env/image_overrides.rs | 17 +++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/xtask/src/env/combined_site_demo.rs b/xtask/src/env/combined_site_demo.rs index be2733f..478d3e4 100644 --- a/xtask/src/env/combined_site_demo.rs +++ b/xtask/src/env/combined_site_demo.rs @@ -4359,8 +4359,7 @@ fn apply_image_overrides(config: &mut serde_yaml::Value) { let operator_image = std::env::var("GRID_XTASK_OPERATOR_IMAGE") .unwrap_or_else(|_| "ghcr.io/praxis-proxy/grid-operator:v0.1.3".to_owned()); let vcr_image = crate::env::image_overrides::vcr_image(); - let image_pull_policy = - std::env::var("GRID_XTASK_IMAGE_PULL_POLICY").unwrap_or_else(|_| "IfNotPresent".to_owned()); + let image_pull_policy = std::env::var("GRID_XTASK_IMAGE_PULL_POLICY").unwrap_or_else(|_| "IfNotPresent".to_owned()); let (gateway_repo, gateway_tag) = parse_image_ref(&gateway_image); let (operator_repo, operator_tag) = parse_image_ref(&operator_image); diff --git a/xtask/src/env/image_overrides.rs b/xtask/src/env/image_overrides.rs index 90fd3f9..21944a5 100644 --- a/xtask/src/env/image_overrides.rs +++ b/xtask/src/env/image_overrides.rs @@ -128,10 +128,13 @@ pub(crate) fn image_pull_policy() -> String { } /// Get the image pull policy for the given ingress mode. +/// +/// Both `IngressMode` variants currently use the same registry-backed +/// default; the parameter is kept so a future mode-specific default can be +/// added without changing this function's signature. pub(crate) fn demo_image_pull_policy(mode: IngressMode) -> String { let default = match mode { - IngressMode::Global => DEFAULT_WORKLOAD_IMAGE_PULL_POLICY, - IngressMode::Workload => DEFAULT_WORKLOAD_IMAGE_PULL_POLICY, + IngressMode::Global | IngressMode::Workload => DEFAULT_WORKLOAD_IMAGE_PULL_POLICY, }; env::var(IMAGE_PULL_POLICY_ENV).unwrap_or_else(|_| default.to_owned()) } @@ -170,14 +173,8 @@ mod tests { assert_eq!(DEFAULT_GATEWAY_IMAGE, "localhost/praxis-ai:llmd-ext-proc"); assert_eq!(DEFAULT_MOCK_EPP_IMAGE, "localhost/praxis-ai-mock-epp:latest"); assert_eq!(DEFAULT_OPERATOR_IMAGE, "grid-operator:latest"); - assert_eq!( - DEFAULT_GLB_GATEWAY_IMAGE, - "ghcr.io/praxis-proxy/grid-ai-rollup:v0.1.3" - ); - assert_eq!( - DEFAULT_GLB_OPERATOR_IMAGE, - "ghcr.io/praxis-proxy/grid-operator:v0.1.3" - ); + assert_eq!(DEFAULT_GLB_GATEWAY_IMAGE, "ghcr.io/praxis-proxy/grid-ai-rollup:v0.1.3"); + assert_eq!(DEFAULT_GLB_OPERATOR_IMAGE, "ghcr.io/praxis-proxy/grid-operator:v0.1.3"); assert_eq!(DEFAULT_IMAGE_PULL_POLICY, "Never"); assert_eq!( DEFAULT_WORKLOAD_GATEWAY_IMAGE,