-
Notifications
You must be signed in to change notification settings - Fork 54
Add transit_ips
to NIC create body
#8851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -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)?; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
5ed0a7e
to
7a34d67
Compare
There was a problem hiding this 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!
// 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 | ||
); | ||
} |
There was a problem hiding this comment.
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?
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); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. 😅
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)?; |
There was a problem hiding this comment.
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)?; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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.