[YANGTOOLS-1272] Expose SchemaInferenceStack.effectiveStatus() Created: 13/Apr/21 Updated: 29/Oct/23 Resolved: 29/Oct/23 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | model-api, model-util |
| Affects Version/s: | None |
| Fix Version/s: | 12.0.0, 11.0.4 |
| Type: | Improvement | Priority: | High |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | Accurate EffectiveStatements | ||||||||
| Description |
|
Our current inference does not propagate effective status into EffectiveStatement hierarchy, but rather performs some indeterminate magic with DocumentedNode.WithStatus. This mechanics is mostly specified in https://tools.ietf.org/html/rfc7950#section-7.21.2 , but the NETMOD WG list needs to be researched as to how parent/child relationships work – i.e. what would be the effective status of 'bar' here: module foo {
prefix foo;
namespace foo;
container foo {
status deprecated;
container bar;
}
}
as logic would dictate it is implied to be deprecated. This is even stronger when 'status obsolete' is in play – such statements should not be implemented, hence having 'status current' underneath them does not make much sense. The spec says that If a definition is "current", it MUST NOT reference a "deprecated" or "obsolete" definition within the same module. If a definition is "deprecated", it MUST NOT reference an "obsolete" definition within the same module. it could be argued that child statements are referencing their parent – at least for the purposes of:
Note that the mechanics of adding status statements has similar scalability implications as YANGTOOLS-1271, hence the two issues will probably share some common infrastructure. |
| Comments |
| Comment by Robert Varga [ 07/Jun/22 ] |
|
We perhaps want actually compute the effective config/status values based on EffectiveStatementInference – i.e. we really use it only in contexts where the result is used in something which can be cached, like codecs etc. |
| Comment by Robert Varga [ 26/Oct/23 ] |
|
We cannot quite expose this from EffectiveStatementInference, as we need a normalized view of the path (e.g. resolve enterDataTree() and similar). |