Repository navigation
fix(lab-ops-hub): return IP literals in canonical form in the container validator - #638
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fecc932909
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # spelling. (A percent-decoded host is likewise fetched in its | ||
| # decoded form, #529.) _url_with_host re-adds the brackets for | ||
| # an IPv6 literal. | ||
| return _url_with_encoded_components(_url_with_host(u, str(ip))) |
There was a problem hiding this comment.
Serialize mapped IPv6 independently of Python's display form
On the declared python:3.13-alpine runtime, str(ipaddress.ip_address("::ffff:8.8.8.8")) returns ::ffff:8.8.8.8, not the WHATWG form ::ffff:808:808. Consequently this new path leaves mapped literals noncanonical and the added assertion in test_judges_translation_prefixes_by_embedded_ipv4 fails under Python 3.13 (and 3.14), while Node's URL serializer returns the expected hex form. IPv4-mapped IPv6 addresses need an explicit hextet-based serialization rather than str(ip).
Useful? React with 👍 / 👎.
|
Follow-up commit: CI (Python 3.12.15) rendered |
Fixes #637
The container validator judged IP literals correctly but returned the caller's spelling verbatim (inet_aton IPv4 forms like
134744072,1.2.256,010.0.0.010; expanded/uppercase IPv6). The Worker returns the WHATWG-canonical form. The IP-literal success path now returns_url_with_host(u, str(ip))— the canonical dotted quad / compressed lowercase IPv6 of the address that was judged — matchingvalidateCrawlUrlreturn-for-return on the #637 probe table, including IPv4-mapped forms ([::ffff:8.8.8.8]→[::ffff:808:808]).Tests: new
test_returns_ip_literals_in_canonical_form(11 cases incl. userinfo+port preservation); two pre-existing verbatim pins updated to the canonical expectation (integer-spelling accept case, IPv4-mapped dotted spelling). Python suite: 51/51 pass. Differential probe vs the Worker validator: all IP-literal diffs eliminated; verdicts unchanged everywhere.Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit