<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:11 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-745] Enable execution M2E in incremental builds</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-745</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;BUG-7128 adds basic lifecycle mapping for yang-maven-plugin, which does not include execution during increment builds.&lt;/p&gt;

&lt;p&gt;Based on &lt;a href=&quot;https://wiki.eclipse.org/M2E_compatible_maven_plugins#BuildContext&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://wiki.eclipse.org/M2E_compatible_maven_plugins#BuildContext&lt;/a&gt;, we cannot enable execution during incremental builds because our generator plugins do not correctly account for generator plugins interactions.&lt;/p&gt;

&lt;p&gt;This issue tracks the final enablement of incremental builds, which can happen only after the dependencies have been taken care of.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="23165">YANGTOOLS-745</key>
            <summary>Enable execution M2E in incremental builds</summary>
                <type id="10103" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</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="rkashapov">Ruslan Kashapov</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Feb 2017 22:33:13 +0000</created>
                <updated>Mon, 13 Mar 2023 07:06:10 +0000</updated>
                            <resolved>Mon, 13 Mar 2023 07:06:10 +0000</resolved>
                                                    <fixVersion>11.0.0</fixVersion>
                                    <component>maven plugin</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                                                            <comments>
                            <comment id="71601" author="JIRAUSER13216" created="Tue, 8 Nov 2022 10:50:58 +0000"  >&lt;p&gt;Due to the plugin API invokes files generation out of &lt;ins&gt;modules not files&lt;/ins&gt;,&lt;br/&gt;
the decision to include the module in scope of re-build (module being updated)&lt;br/&gt;
should take into account the following&lt;/p&gt;

&lt;p&gt;a) is yang file of module itself was updated&lt;br/&gt;
b) is any of submodules (if module contains any) was updated&lt;br/&gt;
c) if other module which ougments current one was updated&lt;br/&gt;
d) if expected output for this module is absent for some reason&lt;/p&gt;

&lt;p&gt;while (a-c) can be checked out of effective model context within &lt;em&gt;yang-maven-plugin&lt;/em&gt;&lt;br/&gt;
module, the d) is responsibility of actual &lt;tt&gt;FileGenerator&lt;/tt&gt; implementation,&lt;br/&gt;
and cannot be determined unless the input-to-output mapping (on per module basis)&lt;br/&gt;
is returned from file generator. In current implementation only full list of&#160;&lt;br/&gt;
generated files is returned, no details on which output file generated based on&#160;&lt;br/&gt;
which input module.&lt;/p&gt;

&lt;p&gt;The approaches to check the expected output before re-build (file re-generation&#160;&lt;br/&gt;
based on updated input):&lt;/p&gt;

&lt;p&gt;&lt;b&gt;1.&lt;/b&gt; Do not check for expected outputs at plugin core level, &lt;b&gt;delegate&lt;/b&gt; the responsibility&lt;br/&gt;
on handling updated only inputs to file generator (i.e mdsal-binding-java-api-generator)&lt;/p&gt;

&lt;p&gt;in this case the information on input module states will be provided using &lt;b&gt;same API&lt;/b&gt;&#160;&lt;br/&gt;
via extended &lt;tt&gt;ContextHolder&lt;/tt&gt;, which will provide file generator with information either&#160;&lt;br/&gt;
input module was updated after last build. Also full scope of input will be available for&#160;&lt;br/&gt;
file generator, because it&apos;s required (&lt;em&gt;mdsal-binding-java-api-generator&lt;/em&gt; case) to build&#160;&lt;br/&gt;
aggregate output file (model binding providers list under /META-INF/services)&lt;/p&gt;

&lt;p&gt;this approach also makes unnecessary output stream capture on a plugin level,&lt;br/&gt;
because this data won&apos;t be used prior the file generator invocation. file generator&#160;&lt;br/&gt;
implementation will be responsible for check either expected output exists and regenerate&lt;br/&gt;
files if necessary.&#160;&lt;/p&gt;

&lt;p&gt;Also output files and mappings can be persisted via context object (the one providing&#160;&lt;br/&gt;
information on modified inputs). This may help managing states on a file generator level,&lt;br/&gt;
but the implementation is not forced to do it.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;2.&lt;/b&gt; &lt;b&gt;Enforce&lt;/b&gt; file generator to return input-to-output mapping via &lt;b&gt;API update&lt;/b&gt;. Currently&#160;&lt;br/&gt;
the result of file generation is a &lt;tt&gt;Table&amp;lt;GeneratedFileType, GeneratedFilePath, GeneratedFile&amp;gt;&lt;/tt&gt;,&lt;br/&gt;
the update may contain 4th element referencing source module (i.e. &lt;tt&gt;SourceIdentifier&lt;/tt&gt;)&lt;/p&gt;

&lt;p&gt;in this case the output file to input relation can be mapped on a yang-maven-plugin level,&lt;br/&gt;
as result the decision on either to include module into a scope for generator also can be made&lt;br/&gt;
on a plugin level, not generator implementation.&lt;/p&gt;

&lt;p&gt;this will require the generator to be updated for both&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;implement updated API to return input-to-output mappings&lt;/li&gt;
	&lt;li&gt;support partial file generation (result of multiple runs for parts to be same as for&#160;&lt;br/&gt;
&#160; single run for full scope)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;shortly:&lt;/p&gt;

&lt;p&gt;1. api remain same, generator to decide the scope based on provided information&lt;br/&gt;
&#160; (which module is modified)&#160;&lt;br/&gt;
2. api is modified, plugin logic limits scope, generator processes what is given&lt;/p&gt;</comment>
                            <comment id="71604" author="rovarga" created="Tue, 8 Nov 2022 15:32:15 +0000"  >&lt;p&gt;So the idea here is that we have two-stage processing and there are complex bits which we have little control over.&lt;/p&gt;

&lt;p&gt;The first stage is assembling an EffectiveModelContext, the dependencies of which are:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;local files&lt;/li&gt;
	&lt;li&gt;project dependencies and files therein&lt;/li&gt;
	&lt;li&gt;the set of codegen plugins and their preference of module resolution (currently unused)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If we know EffectiveModelContext has not changed, we know nothing in codegen could change and we can immediately terminate execution. That is what &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1165&quot; title=&quot;Capture yang-maven input streams&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1165&quot;&gt;&lt;del&gt;YANGTOOLS-1165&lt;/del&gt;&lt;/a&gt; is about.&lt;/p&gt;

&lt;p&gt;The second stage is the codegen phase, where we run each plugin, each of which results in a set of files being generated, dependencies of which are:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;EffectiveModelContext&lt;/li&gt;
	&lt;li&gt;Each codegen plugin&apos;s configuration (not really used, IIRC)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This results in a set of files being generated by each codegen plugin &#8211; which is expressed in plugin-generator-api. If we have a new EffectiveModelContext or new codegen plugin configuration, we must let the plugin run.&lt;/p&gt;

&lt;p&gt;Codegen plugins must never have a dependency on anything maveney &#8211; we should be able to create a Gradle plugin (for example), which does the same thing as the Maven plugin and uses the same codegen plugins. This is why we have removed yang-maven-plugin-spi in &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-747&quot; title=&quot;Remove yang-maven-plugin-spi APIs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-747&quot;&gt;&lt;del&gt;YANGTOOLS-747&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, we cannot know what exactly the logic in codegen plugin does &#8211; and we should not try to express that in an API boundary. It is also important that the codegen plugin does not have (official) access to workspace state, as that improves repeatability.&lt;/p&gt;

&lt;p&gt;Once a codegen plugin has done its thing, though, we need to deal with the task of updating target/generated-sources files with the new view. This is where &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1166&quot; title=&quot;Capture yang-maven generated files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1166&quot;&gt;&lt;del&gt;YANGTOOLS-1166&lt;/del&gt;&lt;/a&gt; comes in. One thing is that we need to delete files that are on the filesystem but were not emitted by the codegen plugin, which is easy. The other thing is writing the files which were emitted.&lt;/p&gt;

&lt;p&gt;This is tricky, because all other maven plugins look at file timestamps to determine whether they were updated. Eclipse integration is sensitive to when a file was updated via BuildContext. So when we write out files, we need to look at their current content and compare it (quickly!) with the newly-generated content &#8211; and if it has not changed, not touch the file at all. BuildContext.hasDelta() and BuildContext.isUptodate() &#8211; they are not really that nice, IIRC.&lt;/p&gt;

&lt;p&gt;With all of this in place, if I have a project open with Eclipse and make a whitespace change in src/main/yang/foo.yang, nothing should change on the filesystem. If I make any significant change, only the files affected by that change (at codegen plugin&apos;s discretion) should change. If I delete foo.yang, all the files generated for it should disappear.&lt;/p&gt;

&lt;p&gt;Finally, there is one more step, which is to store/retrieve state of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1165&quot; title=&quot;Capture yang-maven input streams&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1165&quot;&gt;&lt;del&gt;YANGTOOLS-1165&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1166&quot; title=&quot;Capture yang-maven generated files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1166&quot;&gt;&lt;del&gt;YANGTOOLS-1166&lt;/del&gt;&lt;/a&gt; via BuildContext&apos;s setValue()/getValue() methods &#8211; that allows us to see &quot;hey, what were the deps/output in the last incremental run?&quot;&lt;/p&gt;

&lt;p&gt;Once all this works, we can update &#160;&lt;font color=&quot;#000000&quot;&gt;src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml&lt;/font&gt; to say&#160; &amp;lt;runOnIncremental&amp;gt;true&amp;lt;/runOnIncremental&amp;gt; &#8211; because we will not cause compilation spikes or anything.&lt;/p&gt;

&lt;p&gt;With that, this issue will be done and dusted. The command-line integration and/or IntelliJ integration (which works with pure maven, AFAIR) will then something &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-60&quot; title=&quot;Milestone: enable takari lifecycle or similar command-line incremental builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-60&quot;&gt;YANGTOOLS-60&lt;/a&gt; will address.&lt;/p&gt;</comment>
                            <comment id="72030" author="rovarga" created="Tue, 28 Feb 2023 16:59:51 +0000"  >&lt;p&gt;One wrinkle we need to deal is that there can be actually multiple plugin executions configured. We should handle these seamlessly by acquiring a &lt;a href=&quot;https://stackoverflow.com/a/62705361&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MojoExecution from maven&lt;/a&gt; and propagating as appropriate.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="36721">YANGTOOLS-1491</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="22480">YANGTOOLS-60</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="23167">YANGTOOLS-747</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="36719">YANGTOOLS-1490</subtask>
                            <subtask id="33496">YANGTOOLS-1166</subtask>
                            <subtask id="33495">YANGTOOLS-1165</subtask>
                    </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_10002" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>YANGTOOLS-746</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7825</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=7825]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10308"><![CDATA[New Feature]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0294f:</customfieldvalue>

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