Skip to content
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

Fix i6pn main address being None (typo) #2351

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Fix i6pn main address being None (typo) #2351

merged 1 commit into from
Oct 17, 2024

Conversation

thecodingwizard
Copy link
Contributor

I forgot to add a return statement.

This wasn't caught in code review because I made the change after the PR was approved and somehow didn't catch the error myself :(

e2e tests failed on the main Modal repo, which is how I noticed this issue.

@thecodingwizard
Copy link
Contributor Author

@prbot approve

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

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

Please request a reviewer to follow up with a post-merge review.

@thecodingwizard
Copy link
Contributor Author

@prbot approve

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

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

Approved 👍. @thundergolfer will follow-up review this.

@thecodingwizard thecodingwizard merged commit 196e648 into main Oct 17, 2024
19 checks passed
@thecodingwizard thecodingwizard deleted the nathan/fix branch October 17, 2024 14:38
Copy link
Contributor

@thundergolfer thundergolfer left a comment

Choose a reason for hiding this comment

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

LGTM, doh!

@@ -159,7 +159,7 @@ def wrapper(*args, **kwargs):

def get_i6pn():
"""Returns the ipv6 address assigned to this container."""
socket.getaddrinfo("i6pn.modal.local", None, socket.AF_INET6)[0][4][0]
return socket.getaddrinfo("i6pn.modal.local", None, socket.AF_INET6)[0][4][0]
Copy link
Member

Choose a reason for hiding this comment

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

[0][4][0]

is very confusing to me. Could you create named variables? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there was some discussion here about this. Personally I agree with Eric that [0][4][0] is something that can just be black-boxed (which was sort of the goal of the get_i6pn() function -- readers just need to know that the function returns the ipv6 address and don't need to know how it's done).

I'm open to other ideas though! In particular, I don't even know what to name the variables if I were to make each one a variable.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Magic incantations without comments will likely trigger questions from every unfamiliar reader. Imo it's either "literate programming" or adding comments to the source.

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.

3 participants