Skip to content

Commit e1b22c3

Browse files
adwk67claude
andcommitted
chore: remove REVIEW comments
Remove all // REVIEW: comments that were added to aid code review. These served their purpose during the review process and are no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0f52c40 commit e1b22c3

11 files changed

Lines changed: 0 additions & 51 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ impl ValidatedLogging {
159159
}
160160
}
161161

162-
// REVIEW: ValidatedAirflowCluster is the central validated type. It holds all data needed
163-
// by the build stage so that build() can be infallible. All optional-after-merge fields
164-
// are unwrapped during validation, and logging is pre-validated into ValidatedLogging.
165162
#[derive(Clone)]
166163
pub struct ValidatedAirflowCluster {
167164
metadata: ObjectMeta,
@@ -303,12 +300,6 @@ impl ReconcilerError for Error {
303300
}
304301
}
305302

306-
// REVIEW: The reconcile pipeline is structured as five sequential stages:
307-
// 1. dereference — async, fallible: resolve external references
308-
// 2. validate — sync, fallible: validate and merge configs
309-
// 3. build — sync, infallible: construct Kubernetes resources
310-
// 4. apply — async, fallible: apply resources to the cluster
311-
// 5. update_status — async, fallible: patch status on the CRD
312303
pub async fn reconcile(
313304
airflow: Arc<DeserializeGuard<v1alpha2::AirflowCluster>>,
314305
ctx: Arc<Ctx>,
@@ -336,9 +327,6 @@ pub async fn reconcile(
336327
let validated =
337328
validate_cluster(airflow, &dereferenced, &ctx.product_config).context(ValidateSnafu)?;
338329

339-
// REVIEW: build() is infallible — all validation and fallible operations (config
340-
// generation, PodBuilder/ContainerBuilder usage, logging validation) happen in the
341-
// validate stage. The build stage purely assembles Kubernetes resource structs.
342330
// --- build (sync, infallible) ---
343331
let prepared = build(&validated);
344332

rust/operator-binary/src/controller/build.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ fn main_container_for_role(_role: &AirflowRole) -> Container {
3333
Container::Airflow
3434
}
3535

36-
// REVIEW: build() is infallible. All validation and fallible operations (config generation,
37-
// PodBuilder/ContainerBuilder usage, logging validation) are performed in the validate
38-
// stage. The build stage purely assembles Kubernetes resource structs from validated data.
3936
pub(crate) fn build(validated: &ValidatedAirflowCluster) -> KubernetesResources<Prepared> {
4037
let mut stateful_sets = Vec::new();
4138
let mut config_maps = Vec::new();
@@ -140,9 +137,6 @@ fn build_pdb(
140137
_ => 1,
141138
});
142139

143-
// REVIEW: from_str_unsafe is used here because the values come from constants (APP_NAME,
144-
// OPERATOR_NAME, AIRFLOW_CONTROLLER_NAME) or validated role names — they are known to be
145-
// valid at compile time or have been validated during the validate stage.
146140
Some({
147141
framework::builder::pdb::pod_disruption_budget_builder_with_role(
148142
cluster,
@@ -240,11 +234,6 @@ fn build_metrics_service(
240234
}
241235
}
242236

243-
// REVIEW: from_str_unsafe is used for label construction throughout these helpers because
244-
// the inputs are either compile-time constants (APP_NAME, OPERATOR_NAME, etc.) or values
245-
// that have already been validated during the validate stage (role names, role group names,
246-
// product versions). Using from_str_unsafe avoids redundant re-validation in the infallible
247-
// build stage.
248237
pub(super) fn build_recommended_labels(
249238
cluster: &ValidatedAirflowCluster,
250239
role: &str,

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,6 @@ impl<'a> RoleGroupBuilder<'a> {
359359
}
360360

361361
fn build_volumes(&self) -> Vec<Volume> {
362-
// REVIEW: controller_commons::create_volumes is called with the new validated type
363-
// (&ValidatedContainerLogConfigChoice) instead of the old Option<&ContainerLogConfig>.
364-
// This is safe because the logging config has already been validated during the
365-
// validate stage.
366362
let mut volumes = controller_commons::create_volumes(
367363
&self.rolegroup_ref.object_name(),
368364
&self.role_group_config.logging.airflow_container,

rust/operator-binary/src/controller/validate.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,6 @@ fn build_executor_template_config_maps(
793793
pb.add_container(airflow_container.build());
794794
pb.add_volumes(airflow.volumes().clone())
795795
.context(AddVolumeSnafu)?;
796-
// REVIEW: controller_commons::create_volumes now takes &ValidatedContainerLogConfigChoice
797-
// instead of Option<&ContainerLogConfig>. The validated type ensures logging config
798-
// has already been checked, so the build stage can use it directly.
799796
pb.add_volumes(controller_commons::create_volumes(
800797
&executor_rolegroup_ref.object_name(),
801798
&validated_config.logging.airflow_container,

rust/operator-binary/src/controller_commons.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ pub const CONFIG_VOLUME_NAME: &str = "config";
1313
pub const LOG_CONFIG_VOLUME_NAME: &str = "log-config";
1414
pub const LOG_VOLUME_NAME: &str = "log";
1515

16-
// REVIEW: parameter changed from Option<&ContainerLogConfig> to &ValidatedContainerLogConfigChoice.
17-
// Pattern matching is simpler now because we match on a flat enum instead of nested Option<ContainerLogConfig>.
1816
pub fn create_volumes(
1917
config_map_name: &str,
2018
log_config: &ValidatedContainerLogConfigChoice,

rust/operator-binary/src/crd/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ pub struct AirflowOpaConfig {
571571
pub cache: UserInformationCache,
572572
}
573573

574-
// REVIEW: Ord/PartialOrd added so AirflowRole can be used as a BTreeMap key
575-
// in the new controller's ValidatedAirflowCluster (BTreeMap<AirflowRole, ValidatedRoleConfig>)
576574
#[derive(
577575
Clone,
578576
Debug,

rust/operator-binary/src/env_vars.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ fn static_envs(
373373

374374
/// Return environment variables to be applied to the configuration map used in conjunction with
375375
/// the `kubernetesExecutor` worker.
376-
// REVIEW: simplified from &ExecutorConfig — only config.logging.enable_vector_agent was used
377376
pub fn build_airflow_template_envs(
378377
airflow: &v1alpha2::AirflowCluster,
379378
env_overrides: &HashMap<String, String>,

rust/operator-binary/src/framework/types/operator.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::attributed_string_type;
1212
attributed_string_type! {
1313
ProductName,
1414
"The name of a product",
15-
// REVIEW: example is operator-specific — parameterise when moving to operator-rs
1615
"airflow",
1716
// A suffix is added to produce a label value. An according compile-time check ensures that
1817
// max_length cannot be set higher.
@@ -31,13 +30,10 @@ attributed_string_type! {
3130
attributed_string_type! {
3231
ClusterName,
3332
"The name of a cluster/stacklet",
34-
// REVIEW: example is operator-specific — parameterise when moving to operator-rs
3533
"my-airflow-cluster",
3634
// Suffixes are added to produce resource names. According compile-time checks ensure that
3735
// max_length cannot be set higher. Reduced from opensearch's 24 to 22 because airflow's
3836
// longest role name ("dagprocessor") is 12 chars vs opensearch's 10.
39-
// REVIEW: max_length is operator-specific (depends on longest RoleName) — parameterise
40-
// when moving to operator-rs
4137
(max_length = 22),
4238
is_rfc_1035_label_name,
4339
is_valid_label_value
@@ -46,15 +42,13 @@ attributed_string_type! {
4642
attributed_string_type! {
4743
ControllerName,
4844
"The name of a controller in an operator",
49-
// REVIEW: example is operator-specific — parameterise when moving to operator-rs
5045
"airflowcluster",
5146
is_valid_label_value
5247
}
5348

5449
attributed_string_type! {
5550
OperatorName,
5651
"The name of an operator",
57-
// REVIEW: example is operator-specific — parameterise when moving to operator-rs
5852
"airflow.stackable.tech",
5953
is_valid_label_value
6054
}
@@ -66,8 +60,6 @@ attributed_string_type! {
6660
// The role-group name is used to produce resource names. To make sure that all resource names
6761
// are valid, max_length is restricted. Compile-time checks ensure that max_length cannot be
6862
// set higher if not other names like the RoleName are set lower accordingly.
69-
// REVIEW: max_length is operator-specific (depends on ClusterName and RoleName budgets) —
70-
// parameterise when moving to operator-rs
7163
(max_length = 16),
7264
is_rfc_1123_label_name,
7365
is_valid_label_value
@@ -76,13 +68,10 @@ attributed_string_type! {
7668
attributed_string_type! {
7769
RoleName,
7870
"The name of a role name",
79-
// REVIEW: example is operator-specific — parameterise when moving to operator-rs
8071
"webserver",
8172
// The role name is used to produce resource names. To make sure that all resource names are
8273
// valid, max_length is restricted. Compile-time checks ensure that max_length cannot be set
8374
// higher if not other names like the RoleGroupName are set lower accordingly.
84-
// REVIEW: max_length is operator-specific (airflow needs 12 for "dagprocessor", opensearch
85-
// uses 10) — parameterise when moving to operator-rs
8675
(max_length = 12),
8776
is_rfc_1123_label_name,
8877
is_valid_label_value

rust/operator-binary/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ async fn main() -> anyhow::Result<()> {
177177
)
178178
.graceful_shutdown_on(sigterm_watcher.handle())
179179
.run(
180-
// REVIEW: renamed from reconcile_airflow to reconcile
181180
controller::reconcile,
182181
controller::error_policy,
183182
Arc::new(controller::Ctx {

rust/operator-binary/src/product_logging.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ use crate::{
1818
const LOG_CONFIG_FILE: &str = "log_config.py";
1919
const LOG_FILE: &str = "airflow.py.json";
2020

21-
// REVIEW: signature changed from Logging<C> + two container keys to pre-validated types.
22-
// The function is now infallible — validation happens earlier in the pipeline.
2321
/// Extend the ConfigMap with logging and Vector configurations
2422
pub fn extend_config_map_with_log_config<K>(
2523
rolegroup: &RoleGroupRef<K>,

0 commit comments

Comments
 (0)