Skip to content

fix(all): pcapkit.all lists OSPF on the Link Layer line - #1129

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1124-all-ospf-group
Oct 6, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1124-all-ospf-group

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort) — ran pylint/mypy/isort on both files: isort clean, mypy no hits in all.py; pylint reports a pre-existing line-too-long at all.py:126 and the test's in-method imports and missing docstrings, which match test_layer_placement_unit.py's style
  • make test passes, and a test case covers the change — ran the new module, tests/project/test_public_api.py, tests/protocols/application/test_layer_placement_unit.py, and tests/project
  • Added a changelog entry — N/A, added centrally after the wave

What is the purpose of your pull request?

  • fix — corrects a defect

Description of your pull request and other information

Closes #1124. OSPF, RARP and DRARP sat on the Link Layer line of pcapkit/all.py's __all__, with a comment admitting they are application-layer (#719). All three now sit in the Application Layer group, and the comment is gone. all.py imports with from pcapkit.protocols import *, so __all__ is the only change.

Probe (group read from the source): before, Link = ARP C_Tag DRARP Ethernet InARP L2TP L2TPv2 OSPF RARP S_Tag VLAN; after, Link = ARP C_Tag Ethernet InARP L2TP L2TPv2 S_Tag VLAN, Application = FTP FTP_DATA HTTP NGAP OSPF RARP DRARP.

Test: tests/project/test_all_layer_grouping_unit.py tokenizes all.py and checks every exported class's __layer__ against its group. Without the fix: 5 failed, 3 passed; with it: 5 passed, 3 subtests passed. test_public_api.py 10 passed; test_layer_placement_unit.py 17 passed; tests/project 384 passed, 1 skipped.

@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on fa60acf4e: NEEDS CHANGES (ran on Sonnet; author Opus). The fix is correct; one test-robustness change is needed.

Change needed: if a group comment is renamed, mark() calls next(...) with no default. Every test then errors in setUpClass with RuntimeError: generator raised StopIteration, and the error does not say which comment is missing. Raise an AssertionError that names the missing comment instead.

Verified:

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@JarryShaw
JarryShaw force-pushed the fix/1124-all-ospf-group branch from fa60acf to 7fc16c3 Compare October 6, 2026 19:19
@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 6, 2026
- Move OSPF, RARP and DRARP from the Link Layer group of `__all__` to the
  Application Layer group, matching their `__layer__` since #719, and drop
  the comment that flagged the mismatch.
- Add tests/project/test_all_layer_grouping_unit.py, which reads the groups
  from all.py's source and checks each exported class's `__layer__`.

Closes #1124
@JarryShaw
JarryShaw force-pushed the fix/1124-all-ospf-group branch from 7fc16c3 to 9e84ff0 Compare October 6, 2026 19:21
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 9e84ff0dd: GOOD TO GO (ran on Sonnet; author Opus, round 2)

  • Group comments: mark() now matches the label exactly. If a comment is missing it raises a named AssertionError. Renaming it to # Transport Protocols or # Transport Layers (the old prefix-match hole) gives that assertion; restored, the module passes.
  • all.py: unchanged from round 1.
    • OSPF, RARP and DRARP report __layer__ == 'Application'.
    • With main's all.py, the new module fails 5.
    • All 7 group mutations are caught.

The wider gap, names missing from pcapkit.all.__all__, is #1136.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Coverage: 88.74% (unit tier, Python 3.14, 9e84ff0dd, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1035 2342 846 90.23%
pcapkit/corekit 1874 91 578 22 94.33%
pcapkit/dumpkit 136 0 40 0 100.00%
pcapkit/foundation 2422 143 842 34 92.62%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15653 187 3942 162 98.19%
pcapkit/toolkit 487 71 144 3 84.15%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 795e2aa into main Oct 6, 2026
40 checks passed
@JarryShaw
JarryShaw deleted the fix/1124-all-ospf-group branch October 6, 2026 20:37
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(all): pcapkit.all lists OSPF on the Link Layer line

1 participant