<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:56:19 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-1495] Deviation must not target the same module as the one it is defined in</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1495</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;This is more like a query.&lt;/p&gt;

&lt;p&gt;Recently we found some yang files from our product team are failing the ODL parser. And the error is &quot;Deviation must not target the same module as the one it is defined in&quot;.&lt;/p&gt;

&lt;p&gt;The root cause is obvious - they put some deviations in the same module they target.&lt;/p&gt;

&lt;p&gt;But the validators they are using do not report this kind of error.&lt;/p&gt;

&lt;p&gt;So we would like to know why ODL has this restriction? Is there any reference in RFC?&lt;/p&gt;

&lt;p&gt;The exception is thrown in yangtools/yang/parser/rfc7950/stmt/meta/DeviationStatementSupport.java&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;
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; targetModule = Iterables.getLast(ctx.getArgument().getNodeIdentifiers()).getModule();
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (currentModule.equals(targetModule)) {
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; InferenceException(ctx,
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;code-quote&quot;&gt;&quot;Deviation must not target the same module as the one it is defined in: %s&quot;&lt;/span&gt;, currentModule);
&#160; &#160; &#160; &#160; }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Really appreciate your help.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="36749">YANGTOOLS-1495</key>
            <summary>Deviation must not target the same module as the one it is defined in</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="1" iconUrl="https://jira.opendaylight.org/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="xiao.jing">Xiao Jing</reporter>
                        <labels>
                    </labels>
                <created>Fri, 17 Mar 2023 05:14:29 +0000</created>
                <updated>Mon, 20 Mar 2023 09:16:53 +0000</updated>
                                                                            <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="72061" author="rovarga" created="Fri, 17 Mar 2023 10:59:54 +0000"  >&lt;p&gt;This goes back to &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-638&quot; title=&quot;Milestone: Deviation statements should be resolved during SchemaContext assembly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-638&quot;&gt;&lt;del&gt;YANGTOOLS-638&lt;/del&gt;&lt;/a&gt;, not sure where exactly we picked it up. At the end of the day, there are three pieces to this:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8407.html#section-4.20&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.rfc-editor.org/rfc/rfc8407.html#section-4.20&lt;/a&gt; et al. provides explicit guidance&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc6020#section-5.6.4.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.rfc-editor.org/rfc/rfc6020#section-5.6.4.3&lt;/a&gt; points towards deviations existing in a different module&lt;/li&gt;
	&lt;li&gt;at the end of the day, using &apos;deviate&apos; inside the same module is very questionable: why not actually fix the model definition inline, why resort to deviations?&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="72062" author="JIRAUSER15511" created="Mon, 20 Mar 2023 07:31:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=rovarga&quot; class=&quot;user-hover&quot; rel=&quot;rovarga&quot;&gt;rovarga&lt;/a&gt; Thanks a lot for your reply! Will share the info and trigger more discussions.&lt;/p&gt;</comment>
                            <comment id="72063" author="JIRAUSER15511" created="Mon, 20 Mar 2023 09:16:53 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=rovarga&quot; class=&quot;user-hover&quot; rel=&quot;rovarga&quot;&gt;rovarga&lt;/a&gt;&#160;&lt;/p&gt;

&lt;p&gt;We just have a discussion with our Yang Model expert Bal&#225;zs Lengyel here.&lt;/p&gt;

&lt;p&gt;I would quote:&lt;/p&gt;


&lt;p&gt;Neither &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8407.html#section-4.2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.rfc-editor.org/rfc/rfc8407.html#section-4.2&lt;/a&gt; nor &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc6020#section-5.6.4.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.rfc-editor.org/rfc/rfc6020#section-5.6.4.3&lt;/a&gt; says that deviation statements and their target MUST be in different files, thus it is allowed.&lt;/p&gt;

&lt;p&gt;Also in this case the deviation statement references a target defined in a grouping statement in another module that is only used via a &quot;uses groupingName&quot; statement. &#160;So even if deviating the same module would be forbidden, this is not the case, so it should allow this.&lt;/p&gt;


&lt;p&gt;So can we improve ODL in this case?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    </comments>
                    <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|i044lb:</customfieldvalue>

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