Repository navigation
fix(ngap): source ProcedureCode/ProtocolIE from pycrate, stop the shared -1 mint (#880) - #899
Conversation
1f2dd4f to
94fd58e
Compare
|
This PR breaks a test it correctly does not touch, and the fix has to land inside it. Verified by direct count rather than taken on trust:
The author was right to leave the file alone — I had declared it off-limits. But the bump cannot go to Two corrections to my own brief, both found by the author and both confirmed:
One thing I want the review to look at, since it changes the public surface: Head is now |
|
NEEDS CHANGES on 1. The census delta, and a correction to my own framing. The counts are confirmed 2. NEW — this permanently breaks the
But So from the moment this merges, every scheduled vendor run emits two Fix: add Everything else was confirmed and much of it strongly. Byte-exact offline reproducibility ( One thing for you rather than the author: unknown-string |
94fd58e to
f41de64
Compare
|
GOOD TO GO on The amend touched exactly what it should and nothing else. Still exactly one commit above Census (item 1) — fixed properly, not just the two numbers. The three remaining occurrences of
One question still open for you, not a blocker. Unknown-string Ready for you to merge once CI finishes on this head. I am not merging. |
|
We should add |
|
Ruling recorded, verbatim (reading
Agreed, and it is a better fix than what shipped — the current commit adds a bare One detail decides whether this alone is enough, and it is not. and So adding A consequence worth stating rather than discovering later: Sent to the author. Note this will move the head, so the |
…red -1 mint (#880) Completes #880's ngap.py half (the mh.py half landed in #889). Per the owner's ruling, ProcedureCode/ProtocolIE are genuinely open per 3GPP TS 38.413, so they want a per-key unique value rather than the shared -1 sentinel #880 measured aliasing on -- sourced from pycrate's own compiled NGAP specification through a vendor crawler, not hand-maintained or minted on demand. - Add pcapkit/vendor/ngap/{procedure_code,protocol_ie}.py: crawlers whose _request() imports pycrate_asn1dir.NGAP (no network fetch -- pycrate is already an installed optional dependency) and reads NGAP_Constants' (name, value) pairs, filtered by each value's own typeref. - Add pcapkit/const/ngap/{procedure_code,protocol_ie}.py, generated: EnumRegistry + IntEnum, matching the house pattern. get() no longer mints on an unresolvable string key; _missing_ answers an in-range value it has not seen with a throwaway, non-registering member instead of a shared-value extend_enum mint, which is what stops two different unknown keys from aliasing. - pcapkit/protocols/application/ngap.py now re-exports both from pcapkit.const.ngap under their historical names, dropping ~600 lines of hand-rolled IntEnum + extend_enum logic. - Update tests/const/test_const_registry_protocol.py's own census (122 const files -> 124, 105 generated-shape -> 107) and its narrative paragraph, since the two new const files land on the generated side. Extend four other tests/const/ generic sweeps' pinned counts the same way (+2 registries each). - Per the owner's ruling, declare pycrate in pyproject.toml's `vendor` extra (developer-facing, alongside requests/beautifulsoup4) rather than installing it ad hoc in a workflow; `all` still excludes it, unchanged. cron-vendor.yml installs `.[all,vendor]` so the scheduled regeneration job -- which runs pcapkit-vendor with no target and so now reaches both new crawlers -- has pycrate_asn1dir.NGAP importable. Extended one dependency-gate test (tests/test_tier_guard.py) that pinned `vendor`'s exact requirement-name set. New tests in tests/vendor/ and tests/protocols/application/, each shown to fail without this fix. tests/const/test_const_registry_protocol.py in full via plain unittest: Ran 74 tests, OK. tests/test_tier_guard.py: Ran 107 tests, OK. pytest tests/const/ tests/vendor/ (excluding the reachability test) tests/protocols/application/test_ngap_unit.py: 384 passed, 41026 subtests, 0 known failures; coverage on the touched files 96-100%.
f41de64 to
846dd00
Compare
|
GOOD TO GO re-pinned to So the dependency is declared where running the crawlers is declared, It also found the test I asked it to look for, which I would not have predicted: One prose defect in the new comment, and it is the wrong way round on the very thing the comment exists to explain.
LGPL-2.1+ is less permissive than BSD-3-Clause, not more — that is the entire reason Not blocking on a comment, so this stays GOOD TO GO — but it should be corrected before or just after merge, because a comment that inverts a licence argument is worse than no comment. Your call whether to merge now and let me fix it, or have the author amend first; say which and I will act. |
|
Should pycrate (and crypto libraries) added to the |
|
Question recorded, verbatim:
Half of it is already done: So crypto needs no change. You are right that the extra needs an audit, and the measurement shows why more concretely than I expected: there are three exclusions resting on three different reasons, and no rule that predicts any of them. Size, licence, release maturity and build-toolchain requirements are each argued locally in a comment, at length, and nothing says which of them disqualify an extra in general. So a contributor adding the next extra has nothing to check against — which is how this drifted in the first place. Filed as #910, scoped to produce the criterion rather than just a revised list, because a list without a rule drifts again. It also has to reconcile two things the measurement turned up:
This PR needs no change for any of it and its Still outstanding on this PR, unchanged and not blocking: the new |
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md-- N/A -- changelog centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Completes #880's
ngap.pyhalf (themh.pyhalf landed in #889). Per the owner's ruling,ProcedureCode/ProtocolIEare genuinely open per 3GPP TS 38.413, so they want a per-key unique value rather than the shared-1sentinel #880 measured aliasing on -- sourced from pycrate's own compiled NGAP specification through a vendor crawler, not hand-maintained or minted on demand.pcapkit/vendor/ngap/{procedure_code,protocol_ie}.py: crawlers whose_request()importspycrate_asn1dir.NGAPdirectly (no network fetch -- pycrate is already an installed optional dependency) and readsNGAP_Constants'(name, value)pairs, filtered by each value's own typeref.pcapkit/const/ngap/{procedure_code,protocol_ie}.py, generated:EnumRegistry+IntEnum, matching the house pattern.get()no longer mints on an unresolvable string key;_missing_answers an unseen in-range value with a throwaway, non-registering member instead of a shared-valueextend_enummint -- which is what stops two different unknown keys from aliasing.pcapkit/protocols/application/ngap.pynow re-exports both under their historical names, dropping ~600 lines of hand-rolled enum +extend_enumlogic.tests/const/generic sweeps' pinned counts move by +2 (two moreIntEnumregistries underpcapkit.const);tests/const/test_const_registry_protocol.py's own census is out of scope for this PR (another PR owns it) and needs 122->124, 105->107.New tests in
tests/vendor/andtests/protocols/application/, each shown to fail without this fix.