feat(entrypoints): heuristic tier on the written decorator spelling; odoo GET+POST; quieter unresolved - #185
Merged
Conversation
…odoo GET+POST; quieter unresolved
A decorator that reads as an HTTP hook — `route`, `*.route`, `*.*.route`, or a
one- or two-segment `.get`/`.post`/`.put`/`.patch`/`.delete`/`.head`/
`.options`/`.websocket` — is now an entrypoint on its own, recorded with
`framework: "heuristic"`, `confidence: "heuristic"` and rule id
`heuristic.http-route` / `heuristic.http-verb`, whether or not a framework
was detected or any framework rule knows the library. Route and methods
come from the arguments exactly as framework rules take them; a node a
framework rule already matched gets no heuristic record. Shipped as a
`heuristics:` block in rules.yml, disableable by id. `*` now keeps its
meaning inside a `{a,b}` alternation.
The odoo rule's default methods are [GET, POST]: Odoo serves both unless
`methods=` narrows the route, and json-typed routes are POST.
`PyEntrypointReport.unresolved` stops counting the nameable: builtins,
subscripted generics, and any spelling whose head is imported or declared.
On Odoo it listed 24 `Exception` and 20 `object` bases as unresolved.
Verified on odoo_slim (1,626 modules): with the odoo rules disabled the
heuristic tier alone finds the same 534 `@http.route` methods.
Closes #184
3 tasks
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.
Closes #184.
A decorator that reads as an HTTP hook (
route,*.route,*.*.route, or a one- or two-segment.get/.post/.put/.patch/.delete/.head/.options/.websocket) is now an entrypoint on its own, recorded withframework: "heuristic",confidence: "heuristic"and rule idheuristic.http-route/heuristic.http-verb, whether or not a framework was detected or any framework rule knows the library. Route and methods come from the decorator arguments exactly as framework rules take them; a node a framework rule already matched gets no heuristic record. Shipped as aheuristics:block inrules.yml, disableable by id like every other rule.*now keeps its meaning inside a{a,b}alternation. No schema change:confidence: "heuristic"already existed.Also: the odoo rule's default methods are
[GET, POST](Odoo serves both unlessmethods=narrows the route; json-typed routes are POST), andPyEntrypointReport.unresolvedstops counting the nameable (builtins, subscripted generics, spellings whose head is imported or declared).Verified on
odoo_slim(1,626 modules,-a 1 --no-venv --ray):heuristic.http-route, 0 framework recordsodoo.routewith[GET, POST]where the decorator says nothing, 94odoo.controller, 0 heuristic recordsunresolvednary_condition_optimization,peer_connection.on)Gates: entrypoint, rules, decorator, artifact, symbol-table, conformance, schema and config suites, 317 passed.
test_cli.pyleft to CI (memory-killed locally, as with the previous four PRs).