<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:56:17 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-1485] Fail to process deviation of augmented node without feature support</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1485</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Parsing of YANG models fails if a deviation statement targets a node conditionally augmented based on a feature and the feature is not supported.&lt;/p&gt;

&lt;p&gt;In the following example with two modules, &lt;tt&gt;foo&lt;/tt&gt; &amp;amp; &lt;tt&gt;bar&lt;/tt&gt;, parsing fails if &lt;tt&gt;foo-feature&lt;/tt&gt; is not supported.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;foo.yang&lt;/tt&gt;&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 &quot;urn:foo&quot;;
  prefix &quot;foo&quot;;

  feature foo-feature;

  container foo {
  }

  augment /foo:foo {
    if-feature foo-feature;

    leaf foo-leaf {
      type string;
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;tt&gt;bar.yang&lt;/tt&gt;&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 bar {
  namespace &quot;urn:bar&quot;;
  prefix &quot;bar&quot;;

  import foo {
    prefix foo;
  }

  deviation /foo:foo/foo:foo-leaf {
   deviate not-supported;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Parsing fails after trying to find the deviation target &lt;tt&gt;foo-leaf&lt;/tt&gt;:&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;Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Deviation target &apos;Absolute{qnames=[(urn:foo)foo, foo-leaf]}&apos; not found. [at /volumes/OpenDaylight/yangtools/parser/yang-parser-rfc7950/target/test-classes/bugs/YT1485/augment/bar.yang:9:3]
	at org.opendaylight.yangtools.yang.parser.rfc7950@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.rfc7950.stmt.deviate.AbstractDeviateStatementSupport$1.prerequisiteFailed(AbstractDeviateStatementSupport.java:167)
	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:86)
	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:375)
	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.addSourceExceptions(BuildGlobalContext.java:307)
	... 80 more
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="36648">YANGTOOLS-1485</key>
            <summary>Fail to process deviation of augmented node without feature support</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="sangwookha">Sangwook Ha</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Tue, 7 Feb 2023 08:17:41 +0000</created>
                <updated>Mon, 20 Mar 2023 10:10:09 +0000</updated>
                            <resolved>Mon, 13 Mar 2023 19:25:55 +0000</resolved>
                                    <version>8.0.9</version>
                    <version>9.0.6</version>
                    <version>10.0.3</version>
                                    <fixVersion>11.0.0</fixVersion>
                    <fixVersion>8.0.10</fixVersion>
                    <fixVersion>9.0.7</fixVersion>
                    <fixVersion>10.0.5</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72002" author="rovarga" created="Tue, 14 Feb 2023 09:54:42 +0000"  >&lt;p&gt;This boils down to order of evaluation. The deviation hooks up into schema tree namespace, but AbstractPathRequisite.namespaceItemAdded() executes as soon as /foo:foo is added. This results in it calling isSupportedByFeatures() before the if-feature statements has a chance of being added, and thus we do not report the prerequisiteUnavailable(), but end up reporting prerequisiteFailed().&lt;/p&gt;

&lt;p&gt;Fixing this requires augmenting callers to make sure they can work with if we require FULL_DECLARATION along the entire tree and if they do perform another level of indirection, when we first require /foo:foo to complete FULL_DECLARATION before evaluating feature support.&lt;/p&gt;</comment>
                            <comment id="72047" author="rovarga" created="Mon, 13 Mar 2023 14:53:59 +0000"  >&lt;p&gt;Right, so the only way we are using this is for EFFECTIVE_MODEL, hence can lock this use down and add a requirement on FULL_DECLARATION.&lt;/p&gt;</comment>
                            <comment id="72050" author="rovarga" created="Mon, 13 Mar 2023 19:26:50 +0000"  >&lt;p&gt;Well, actually this is a tad simpler: augmentations need to propagate their children as long as the target is found.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="36628">YANGTOOLS-1480</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="34943">YANGTOOLS-1370</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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|i0447j:</customfieldvalue>

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