GeezerVison is showing github.com — fix(lab-ops-hub): return IP literals in canonical form in the container validator by dezren39 · Pull Request #638 · developing-today/code
Conversation
dezren39
commented
Oct 23, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
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 — matching validateCrawlUrl return-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.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- Bug Fixes
- URLs containing public IP addresses are now returned in a consistent canonical form, including normalized IPv4 and IPv6 spellings. User information and port numbers are preserved where present.
- This covers alternate representations such as integer, hexadecimal, octal, abbreviated, and expanded IP addresses.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-23T02:33:16.800989Z |
746769c |
New commits |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Warning
Review limit reached
You'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.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5d8371af-09cf-4eec-b247-84b9980d1054
📥 Commits
-
Reviewing files that changed from the base of the PR and between fecc932 and 746769c.
📒 Files selected for processing: 1
-
pkgs/lab-ops-hub/container/app.py
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
da306b4d-e066-4d30-b5db-164dac651beb
📥 Commits
-
Reviewing files that changed from the base of the PR and between 5a84351 and fecc932.
📒 Files selected for processing: 2
-
pkgs/lab-ops-hub/container/app.py
pkgs/lab-ops-hub/test/test_container_validate.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
-
validate_crawl_url now returns accepted IP-literal URLs with the parsed address in canonical form. Tests cover noncanonical IPv4 and IPv6 spellings and verify that userinfo and port are preserved.
Changes: IP URL canonicalization
| Layer / File(s) |
Summary |
Canonicalize accepted IP-literal URLs pkgs/lab-ops-hub/container/app.py, pkgs/lab-ops-hub/test/test_container_validate.py |
After public-address checks, validate_crawl_url replaces the URL host with str(ip). Tests check canonical IPv4 and IPv6 returns, including preserved userinfo and port. The translation-prefix test checks the canonical IPv6 form. |
Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to fecc9
-
The canonical IP return change is ready to merge after normal checks.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly and concisely describes the main change: returning IP literals in canonical form from the container validator. |
| Linked Issues check |
 |
Issue #637 requires canonical returned forms for accepted IP literals, unchanged verdicts, regression tests, a passing Python suite, and no TypeScript changes. The diff changes the successful IP-liter… |
| Out of Scope Changes check |
 |
The whole-PR diff contains changes only in pkgs/lab-ops-hub/container/app.py and its Python test file. The implementation changes only the successful IP-literal return path. The tests directly verif… |
Full details: Linked Issues check
-
Explanation
Issue #637 requires canonical returned forms for accepted IP literals, unchanged verdicts, regression tests, a passing Python suite, and no TypeScript changes. The diff changes the successful IP-literal path to call _url_with_host(u, str(ip)), which produces canonical IPv4 and IPv6 forms while preserving URL components. The added test covers 11 IPv4 and IPv6 cases, including userinfo, port, and IPv4-mapped IPv6 input. The PR reports 51/51 Python tests passing, unchanged verdicts, and no TypeScript changes.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff contains changes only in pkgs/lab-ops-hub/container/app.py and its Python test file. The implementation changes only the successful IP-literal return path. The tests directly verify issue #637 canonical-return behavior. No DNS-name behavior or unrelated TypeScript code changes are present.
✨ Finishing Touches: 💡 2
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
💡 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Follow-up commit: CI (Python 3.12.15) rendered str(IPv6Address) for an IPv4-mapped address as ::ffff:8.8.8.8 while this sandbox's Python 3.12.3 and the Worker's serializer both give hextets ::ffff:808:808 — str() is patch-version-unstable for mapped addresses. The fix now renders IPv6 via a small _canonical_ipv6 (exploded hextets + longest-zero-run compression), verified against node's URL serializer on mapped/6to4/NAT64/compression edge cases; 51/51 Python tests pass locally.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|