Repository navigation
refactor(corekit)!: move the schema helpers protocols call into corekit.schema (#2674) - #2704
Conversation
096f76f to
ffbd611
Compare
|
Rebased
The earlier review was cut off by a credential failure, so a Sonnet re-review is running on this head. |
|
GOOD TO GO at
One small test-only follow-up goes into this PR, and I'll check the amend: |
ffbd611 to
dd6072a
Compare
|
Pushed
The schema, foundation, application, corekit and misc legs pass, and every module imports. This stays GOOD TO GO. |
|
The owner asked in session, paraphrased, to group the moved helpers in one subpackage instead of splitting them across Needs deciding: the subpackage's name.
Recommendation: 2. It keeps the location you asked for, but |
|
The owner then proposed One naming overlap, for the record: |
|
The owner adds, paraphrased: the whole of |
dd6072a to
a6efa73
Compare
|
Pushed the restructure, |
|
GOOD TO GO at a6efa73 (Sonnet re-review).
|
…it.schema (#2674) - The new pcapkit.corekit.schema package holds the helpers shared across the schema layer, one module per group; its __init__ imports none of them, and none imports a field module or a protocol at run time. - pad_length moves from pcapkit.corekit.fields.strings to .padding. - parse_ip_address, with the _reject_bool and _reraise_as_field_value_error guards the IP address fields share, moves from pcapkit.corekit.fields.ipaddress to .ipaddress. - pcapkit.corekit.fields.byteorder moves whole, with byteorder_callback and packet_byteorder, to .byteorder. - keep_short_read and replay_short_read move from pcapkit.protocols.schema.schema to .shortread. - jumbo_payload_length, which the IPv6 pseudo-header and the Scapy toolkit call as well as IPv6, moves from pcapkit.protocols.schema.internet.ipv6 to .jumbogram. - Every caller, radiotap's included, imports from the new home, with no re-export at the old path; the shipped names get versionremoved there. - utilities-or-corekit.rst records the rulings, and test_schema_helpers_boundary_2674_unit fails on a schema-layer helper called from outside the layer, or from outside its own protocol. Every tests/ leg passes under util/run_unittest_leg.py, and the Sphinx build warns exactly as the base does.
a6efa73 to
a2a3f6f
Compare
|
Fold pushed:
|
… helpers, MH options 6 and 27, the cut SCTP and option-area schemas and dict-built secrets into 1.6.0 (#2449) - Breaking: a make() enumeration field takes a member or an int, its X_default/X_namespace/X_reversed keywords removed with no alias, and names, wide codes and wide option codes are refused (#2692); the schema helpers move to pcapkit.corekit.schema and pcapkit.corekit.fields.byteorder is removed (#2704); MobileNetworkPrefixOption gains prefix_length and keeps an IPv6Address prefix, and TimestampOption's timestamp is None past 9999 (#2709). Folded into the MH data-model entry; old values measured against v1.5.1. - Fixed: the SCTP schema cut inside its padding and a header schema cut inside an option area pack back as captured (#2682), into the SCTP entry; a Decryption Secrets Block rebuilds from its dict as captured (#2707), into the DSB entry. - Folded into unreleased entries: FRAD's Q.922 address refusal and quiet cut rebuild (#2719); a from_data rebuild's checksum status (#2712); a failed ListField fill's ledger (#2706); pad_length's path (#2704); TLS's enumeration fields (#2692); the make() and schema-helper rulings, into the conventions entry (#2692, #2704); the GraalPy shards, into the CI-legs entry (#2720). - 1.5.0's corekit.fields.byteorder role points at corekit.schema.byteorder, where #2704 moved it, so the nitpicky build does not warn on it; 1.5.0's text unchanged. - No entry for the test-only 72b2bd8 (#2715), or the docs-and-test-only 0c07940 (#2718). - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
#2704 and #2722 - protocol.rst linked pad_length at pcapkit.corekit.fields.strings, its home before #2704; it links pcapkit.corekit.schema.padding now. - protocol.rst documented Protocol._make_uint twice, beside _make_index and among the value helpers; the value-helper entry stays, in the Protocol autoclass, the ProtocolBase method group and its link list alike. - ReduceAsProtocol2 names copyreg._reduce_ex and copyreg.__newobj__ as literals, since intersphinx holds neither private name. - HIP and IPv6_Route filed their #2676 note under versionremoved 1.6.0; it moves, unreworded, into each class's versionchanged 1.6.0 list. Docstrings and .rst only; the AST is equal once docstrings are stripped.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
The owner ruled on #2674, refining it in session: helpers shared beyond the schema layer live in one package,
pcapkit.corekit.schema, with a submodule per group. A protocol-specific helper moves only if code outside its own protocol uses it and it is generic enough to reuse. No old path keeps a re-export.paddingpad_lengthcorekit.fields.stringsipaddressparse_ip_addressand its guardscorekit.fields.ipaddressbyteorderpacket_byteorder,byteorder_callback(the whole module)corekit.fields.byteorderjumbogramjumbo_payload_lengthshortreadkeep_short_read,replay_short_readprotocols.schema.schemaThe package holds shared helpers. It is not the
Schemaframework inpcapkit.protocols.schema, and each module's docstring says so. Shipped names getversionremovedat their old paths. The ruling is recorded on utilities-or-corekit.rst under "Shared Schema Helpers". A boundary test fails when code outside the schema layer, or outside a protocol, calls a helper from a field module,schema.schemaor another protocol's schema module. It also fails on a helper defined twice, and on an import cycle into the package.Breaking: names shipped since 1.5.0 move with no re-export.
All 13 legs pass, every module imports, and the docs build gives the same warnings as
main.Closes #2674