Skip to content

Conversation

david-crespo
Copy link
Contributor

Closes #6588

As threatened in product eng sync, here is Claude with some aggressive steering on my end. It cost nearly $10, by far the most I have ever spent in Claude Code. Hard to say whether it was worth it. It seems pretty good and I did almost nothing.

@david-crespo david-crespo changed the title NIC Add transit_ips to NIC create body Aug 18, 2025
@@ -1260,6 +1272,8 @@ impl QueryFragment<Pg> for InsertQueryValues {
out.push_identifier(dsl::slot::NAME)?;
out.push_sql(", ");
out.push_identifier(dsl::is_primary::NAME)?;
out.push_sql(", ");
out.push_identifier(dsl::transit_ips::NAME)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes in this file are the ones most likely to have issues, but the test suggests they are working.

Copy link
Contributor

Choose a reason for hiding this comment

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

As above, I do think they are correct here.

Copy link
Contributor

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

Thanks David (or, thanks Claude?). Some repetition/verbosity in the tests, but otherwise it holds water if the tests are passing fine!

Comment on lines 3253 to 3268
// Verify transit IPs are correctly persisted
assert_eq!(
inserted_interface.transit_ips.len(),
transit_ips.len(),
"Transit IPs count should match"
);

for (actual, expected) in
inserted_interface.transit_ips.iter().zip(transit_ips.iter())
{
assert_eq!(
actual, expected,
"Transit IP {} should match expected {}",
actual, expected
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This has already been verified by assert_interfaces_eq, right?

Comment on lines 2741 to 2746
assert_eq!(iface.transit_ips.len(), params.transit_ips.len());
for (actual, expected) in
iface.transit_ips.iter().zip(params.transit_ips.iter())
{
assert_eq!(actual, expected);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert_eq!(iface.transit_ips.len(), params.transit_ips.len());
for (actual, expected) in
iface.transit_ips.iter().zip(params.transit_ips.iter())
{
assert_eq!(actual, expected);
}
assert_eq!(iface.transit_ips, params.transit_ips);

This should suffice? I guess that's two places Claude has chosen to break up an equality test like this. 😅

Comment on lines +1216 to +1220
out.push_bind_param::<sql_types::Array<sql_types::Inet>, Vec<IpNetwork>>(
&self.interface.transit_ips,
)?;
out.push_sql(" AS ");
out.push_identifier(dsl::transit_ips::NAME)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably reflected in the doc comment on lines 923--930, but otherwise it looks correct to me.

@@ -1260,6 +1272,8 @@ impl QueryFragment<Pg> for InsertQueryValues {
out.push_identifier(dsl::slot::NAME)?;
out.push_sql(", ");
out.push_identifier(dsl::is_primary::NAME)?;
out.push_sql(", ");
out.push_identifier(dsl::transit_ips::NAME)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, I do think they are correct here.

Copy link
Contributor

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

Thanks!

@david-crespo david-crespo enabled auto-merge (squash) August 19, 2025 15:32
@david-crespo david-crespo merged commit cb7b856 into main Aug 19, 2025
17 checks passed
@david-crespo david-crespo deleted the nic-transit-ips branch August 19, 2025 22:53
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.

[nexus] Add transit_ips to network interface create body
2 participants