merge/irr: harden parsing and deterministic output#137
Open
SuvidhJ wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Hardens IRR parsing and merge behavior to better handle edge-case inputs and produce stable merge outputs under constrained resources (addresses #134).
Changes:
- Fix IRR RPSL object splitting to handle blank lines robustly and flush the final object without requiring a trailing blank line.
- Make merge output writing more deterministic and avoid blank-line artifacts; cap merge worker concurrency.
- Add a regression test asserting deterministic merge output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tests/test_merge.py |
Adds a regression test to ensure general_merge produces identical output on repeated runs. |
kartograf/merge.py |
Caps ProcessPoolExecutor workers, adjusts chunk sizing accordingly, and rewrites output emission to avoid blank-line artifacts and improve determinism. |
kartograf/irr/parse.py |
Improves IRR entry splitting logic for blank-line handling and ensures the final entry is flushed even without a trailing blank line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d6e92b3 to
735af53
Compare
Collaborator
|
Please try to explain what the problem(s) are that you are solving in the PR rather than describing only the change. You should also make a separate commit for each fix, ideally with a test that did not pass before the fix but passes afterwards.
Please also test consistency with a full reproduction run from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Small hardening follow-up from regression checks.
Main changes:
Validation:
-> pytest tests/test_merge.py tests/test_irr_parse.py -q
-> pytest -q
Issue linkage: