<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:31 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-859] Augmenting a container with if-feature</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-859</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;I would like ODL to reconsider the point of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-811&quot; title=&quot;yang parser problem with refine or augment of yang node, which is not supported per feature statement&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-811&quot;&gt;&lt;del&gt;YANGTOOLS-811&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;ve been researching this a little, and it seems people from the RFC itself acknowledge that the RFC is unclear on this point:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.ietf.org/mail-archive/web/netmod/current/msg17835.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.ietf.org/mail-archive/web/netmod/current/msg17835.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, there are standardized YANG modules that are relying on the assumption that no if-feature is needed in the augment, see the following standardized models from BBF:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/BroadbandForum/yang/blob/master/standard/interface/bbf-sub-interfaces.yang&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/BroadbandForum/yang/blob/master/standard/interface/bbf-sub-interfaces.yang&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/BroadbandForum/yang/blob/master/standard/interface/bbf-sub-interface-tagging.yang&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/BroadbandForum/yang/blob/master/standard/interface/bbf-sub-interface-tagging.yang&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first model contains at the end containers ingress-rewrite and egress-rewrite that are conditional under the feature tag-rewrites.&#160;&#160; The second module contains an augment on these containers, without an if-feature statement.&lt;/p&gt;

&lt;p&gt;It has also been brought to my attention that ConfD from Tail-F had provided a fix for this problem.&#160;&#160;&#160; So it seems there is some kind of consensus out there that the if-feature statement is not needed in the augment.&lt;/p&gt;

&lt;p&gt;That is why I request that ODL reconsiders this.&lt;/p&gt;</description>
                <environment></environment>
        <key id="29361">YANGTOOLS-859</key>
            <summary>Augmenting a container with if-feature</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="verthezpw">Peter Verthez</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Mar 2018 09:50:49 +0000</created>
                <updated>Wed, 4 Nov 2020 11:32:00 +0000</updated>
                            <resolved>Wed, 4 Nov 2020 11:32:00 +0000</resolved>
                                    <version>1.2.1</version>
                    <version>2.0.9</version>
                                    <fixVersion>4.0.14</fixVersion>
                    <fixVersion>6.0.1</fixVersion>
                    <fixVersion>5.0.8</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="61481" author="rovarga" created="Wed, 7 Mar 2018 10:58:44 +0000"  >&lt;p&gt;This actually works as expected with 2.0.1.&lt;/p&gt;</comment>
                            <comment id="61482" author="rovarga" created="Wed, 7 Mar 2018 11:13:12 +0000"  >&lt;p&gt;As far as I can tell, this works with 1.2.2, too. What version are you seeing this with?&lt;/p&gt;</comment>
                            <comment id="61483" author="verthezpw" created="Wed, 7 Mar 2018 11:15:00 +0000"  >&lt;p&gt;OK, we are using 1.2.1 at this moment.&lt;/p&gt;</comment>
                            <comment id="61484" author="rovarga" created="Wed, 7 Mar 2018 11:20:22 +0000"  >&lt;p&gt;Unless I am missing something, the reproducer is as simple as :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;module foo {
    namespace foo;
    prefix foo;

    feature foo;

    container foo {
        if-feature foo;
    }
}

module bar {
    namespace bar;
    prefix bar;

    import foo {
        prefix foo;
    }

    augment &quot;/foo:foo&quot; {
        container bar {
        }
    }
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;and parsing this without feature foo present.&lt;/p&gt;</comment>
                            <comment id="61485" author="verthezpw" created="Wed, 7 Mar 2018 11:22:10 +0000"  >&lt;p&gt;Yes, looks correct.&lt;/p&gt;</comment>
                            <comment id="61486" author="rovarga" created="Wed, 7 Mar 2018 11:30:37 +0000"  >&lt;p&gt;Try it out with 1.2.2 and update the issue accordingly, please.&lt;/p&gt;</comment>
                            <comment id="61487" author="verthezpw" created="Wed, 7 Mar 2018 11:31:39 +0000"  >&lt;p&gt;OK, will do that.&lt;/p&gt;</comment>
                            <comment id="61489" author="verthezpw" created="Wed, 7 Mar 2018 11:37:17 +0000"  >&lt;p&gt;I can&apos;t reproduce it with the above modules in 1.2.1 either.&#160;&#160; I&apos;ll check what the exact reproducer is then, because we do have the problem with the standard modules I mentioned.&lt;/p&gt;</comment>
                            <comment id="61533" author="verthezpw" created="Thu, 8 Mar 2018 09:47:12 +0000"  >&lt;p&gt;I&apos;ve attached the combination of standard models that exhibits the bug, even in 1.2.1.&#160;&#160; I&apos;ll still work on a minimized version of this if needed.&lt;/p&gt;</comment>
                            <comment id="61534" author="verthezpw" created="Thu, 8 Mar 2018 09:53:12 +0000"  >&lt;p&gt;I will also still try 1.2.2.&lt;/p&gt;</comment>
                            <comment id="61535" author="verthezpw" created="Thu, 8 Mar 2018 10:21:11 +0000"  >&lt;p&gt;With the attached models, I have exactly the same error in 1.2.2.&lt;/p&gt;</comment>
                            <comment id="61548" author="verthezpw" created="Thu, 8 Mar 2018 12:11:18 +0000"  >&lt;p&gt;I&apos;ve been able to minimize the model needed to reproduce: see attachment minimalmodel.zip.&#160;&#160; Apparently the 2-level augment is relevant: without that 2-level augment it works.&lt;/p&gt;</comment>
                            <comment id="61581" author="rovarga" created="Fri, 9 Mar 2018 00:04:43 +0000"  >&lt;p&gt;2.0.2 assembles both packages without any issue. What is the error you are seeing?&lt;/p&gt;</comment>
                            <comment id="61582" author="rovarga" created="Fri, 9 Mar 2018 00:09:01 +0000"  >&lt;p&gt;Sorry, I forgot to jiggle the features. 2.0.2 reports:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException: Some of EFFECTIVE_MODEL modifiers for statements were not resolved.
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.addSourceExceptions(BuildGlobalContext.java:354)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.completePhaseActions(BuildGlobalContext.java:415)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.executePhases(BuildGlobalContext.java:219)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.buildEffective(BuildGlobalContext.java:230)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor$BuildAction.buildEffective(CrossSourceStatementReactor.java:196)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.stmt.StmtTestUtils.parseYangSources(StmtTestUtils.java:141)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.stmt.StmtTestUtils.parseYangSources(StmtTestUtils.java:158)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.stmt.StmtTestUtils.parseYangSources(StmtTestUtils.java:190)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.stmt.YT859Test.testFindDataSchemaNode(YT859Test.java:20)
&#160;&#160; &#160;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&#160;&#160; &#160;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
&#160;&#160; &#160;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&#160;&#160; &#160;at java.lang.reflect.Method.invoke(Method.java:498)
&#160;&#160; &#160;at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
&#160;&#160; &#160;at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
&#160;&#160; &#160;at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
&#160;&#160; &#160;at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
&#160;&#160; &#160;at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
&#160;&#160; &#160;at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
&#160;&#160; &#160;at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
&#160;&#160; &#160;at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
&#160;&#160; &#160;at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
&#160;&#160; &#160;at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
&#160;&#160; &#160;at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
&#160;&#160; &#160;at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
&#160;&#160; &#160;at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
&#160;&#160; &#160;at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Yang model processing phase EFFECTIVE_MODEL failed [at /home/nite/odl/yangtools/yang/yang-parser-rfc7950/target-ide/test-classes/bugs/YT859/bbf-sub-interface-tagging.yang:1:0]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:360)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.addSourceExceptions(BuildGlobalContext.java:319)
&#160;&#160; &#160;... 31 more
Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Augment target &apos;Absolute{path=[(urn:ietf:params:xml:ns:yang:ietf-interfaces)interfaces, (urn:ietf:params:xml:ns:yang:ietf-interfaces)interface, (urn:bbf:yang:bbf-sub-interfaces)egress-rewrite]}&apos; not found [at /home/nite/odl/yangtools/yang/yang-parser-rfc7950/target-ide/test-classes/bugs/YT859/bbf-sub-interface-tagging.yang:15:2]
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.augment.AbstractAugmentStatementSupport$1.prerequisiteFailed(AbstractAugmentStatementSupport.java:161)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:83)
&#160;&#160; &#160;at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:348)
&#160;&#160; &#160;... 32 more



&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Test case at:&#160; &lt;a href=&quot;https://git.opendaylight.org/gerrit/69298&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/69298&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="61583" author="rovarga" created="Fri, 9 Mar 2018 00:41:51 +0000"  >&lt;p&gt;Looks like a problem in SchemaNodeIdentifierBuildNamespace around subtree matches. The inference action needs to succeed, but report that the target is not supported. Since namespaces currently support only exact matches, we need to teach them about matching subtrees.&lt;/p&gt;

&lt;p&gt;This will definitely require an API change to report that &apos;your prerequisite failed, here is the closest node we have&apos;. Based on that information AbstractAugmentStatementSupport can understand that it is not to take any action, as an unsupported parent exists.&lt;/p&gt;</comment>
                            <comment id="61584" author="rovarga" created="Fri, 9 Mar 2018 00:47:55 +0000"  >&lt;p&gt;Resolving this equals to solving part 3) of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-694&quot; title=&quot;Eliminate duplicate DescriptionEffectiveStatementImpl objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-694&quot;&gt;&lt;del&gt;YANGTOOLS-694&lt;/del&gt;&lt;/a&gt; problem statement.&lt;/p&gt;</comment>
                            <comment id="61845" author="verthezpw" created="Wed, 21 Mar 2018 07:58:36 +0000"  >&lt;p&gt;We&apos;re seeing a similar problem with deviations (Deviation target not found), also with if-feature involved.&#160;&#160; Is that the same issue, or should I create a new ticket for this?&lt;/p&gt;</comment>
                            <comment id="63774" author="verthezpw" created="Thu, 28 Jun 2018 07:09:57 +0000"  >&lt;p&gt;Hi, what is the target date for fixing this?&#160;&#160; This is causing constant issues with the devices that we manage, for which we currently each time have to perform a workaround.&lt;/p&gt;</comment>
                            <comment id="63816" author="rovarga" created="Fri, 29 Jun 2018 11:57:18 +0000"  >&lt;p&gt;Sorry, no fixed target date yet, as I am busy in downstream projects. If I get enough quiet time it could make it into Oxygen SR3, but I cannot guarantee that.&lt;/p&gt;</comment>
                            <comment id="64443" author="rovarga" created="Tue, 31 Jul 2018 16:19:49 +0000"  >&lt;p&gt;So I have a prototype patch, 69298,17, but the it does not quite work. The reason for that is that we have two augments at play, the first one introducing a if-feature container which is then being augmented.&lt;/p&gt;

&lt;p&gt;As it stands we do not populate if-feature&apos;d statements if that feature is not effective, which is what makes sense. If we populate them, we need to understand that is really going on and account for it &#8211; somehow, I am not yet sure how.&lt;/p&gt;</comment>
                            <comment id="64530" author="rovarga" created="Fri, 3 Aug 2018 18:59:44 +0000"  >&lt;p&gt;So the problem is that I cannot find any text in RFC7950 which would preclude the following nightmare:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
feature foo;
feature bar;

container baz {
   &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;-feature &lt;span class=&quot;code-quote&quot;&gt;&quot;foo and (not baz)&quot;&lt;/span&gt;;
}

list baz {
   &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;-feature &lt;span class=&quot;code-quote&quot;&gt;&quot;(not foo) and baz&quot;&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;i.e. mutually-exclusive items which conflict on namespace, but are both augmentable. Eventhough such a scenario will thoroughly break MD-SAL, it should be acceptable by YANG parser, unless it can be proven otherwise.&lt;/p&gt;

&lt;p&gt;This means, though, that at least&#160;ChildSchemaNodeNamespace needs to track a soft &quot;potentially unsupported&quot; state, which is cleared when a statement is fully resolved. If the statement is not fully resolved by end of the namespace mutation, we need to push either an &quot;unsupported&quot; or &quot;invalid&quot; event.&lt;/p&gt;</comment>
                            <comment id="64531" author="rovarga" created="Fri, 3 Aug 2018 19:13:37 +0000"  >&lt;p&gt;I have raised &lt;a href=&quot;https://mailarchive.ietf.org/arch/msg/netmod/9JgPZphOdim-wLZA3NrSe3I1un4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mailarchive.ietf.org/arch/msg/netmod/9JgPZphOdim-wLZA3NrSe3I1un4&lt;/a&gt; will see what the reply is.&lt;/p&gt;</comment>
                            <comment id="64597" author="rovarga" created="Wed, 8 Aug 2018 15:28:02 +0000"  >&lt;p&gt;Based on the initial reply it would seem the sentiment is to disallow the above construct. That means we can ignore the nightmare.&lt;/p&gt;</comment>
                            <comment id="64598" author="rovarga" created="Wed, 8 Aug 2018 15:32:11 +0000"  >&lt;p&gt;ChildSchemaNodeNamespace needs to be be updated to handle the case of adding an unsupported statement. Details are a bit sketchy, but I think it would work by squashing unsupported statements into a well-known (private) value and filter them out when queried.&lt;/p&gt;

&lt;p&gt;Furthermore augment/deviate etc. copy functions need to let the copy statement get created (so that proper onStatementAdded() namespace-handling logic kicks in) and then not add them to the copy set if they are not supported.&lt;/p&gt;

&lt;p&gt;That is not exactly pretty, but should provide the final pieces to the puzzle.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="23114">YANGTOOLS-694</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="22823">YANGTOOLS-403</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="14459" name="minimalmodel.zip" size="1080" author="verthezpw" created="Thu, 8 Mar 2018 12:10:20 +0000"/>
                            <attachment id="14458" name="models.zip" size="37950" author="verthezpw" created="Thu, 8 Mar 2018 09:46:30 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03baf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>