You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/03/05 15:06:28 UTC

[GitHub] [netbeans] sdedic opened a new pull request #2795: Priming build action support

sdedic opened a new pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795


   Sometimes it is good idea to **automate** the priming build. So far, the only way how to do it is to  `ProjectProblemsProvider`s and "somehow" detect a priming build is required. So I have defined `COMMAND_PRIME` Project action to be implemented by specific project types that require some sort of 'initialization' before they can be fully used. Currently they are `maven` and `gradle`. 
   
   Maven support comes in the second commit. I tried to avoid multiple runs of the 'priming build', so if the build is run, an additional request will just piggyback on the execution. But once the execution completes, another ProblemResolver invocation will re-build the project.
   
   In maven, I didn't want to pollute even more `ActionProviderImpl` that already has very complex dependencies. At the same time, I didn't want to break the closure of `ActionProvider`s: since Maven does not use LookupMerger for `ActionProvider`s, there can be only that single one (maven core - provided) and others may only plug through providing configurations for maven executions, not by custom `invokeActions`.
   So I have decided to make `InternalActionProvider` for use strictly within Maven module. May be used to decompose `ActionProviderImpl` in the future.
   
   Last, in LSP, I have little optimized project opening: if a project **is being** opened, a new request to open the project will wait on the 1st one to complete. Since priming build is now part of the project open task, it may take a little longer.
   It was necessary to prime the projects **before project-open event is fired**: otherwise NB support would kick in and start to display dialogs (Project XYZ has problems, ...). These dialogs will be still displayed, if the priming build fails.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#discussion_r589216005



##########
File path: java/maven/src/org/netbeans/modules/maven/InternalActionProvider.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.maven;
+
+import org.netbeans.spi.project.ActionProvider;
+
+/**
+ * The same as ActionProvider, but won't be exported outside the module.
+ * @author sdedic
+ */
+public interface InternalActionProvider extends ActionProvider {

Review comment:
       Still a bit [dangerous](https://github.com/apache/netbeans/pull/2795#commitcomment-47981828).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#issuecomment-792725553


   > I guess real delegation has be used.
   
   True. Fixed in a1c0839
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#issuecomment-793504467


   @jtulach Yes, good idea. Tracked as [NETBEANS-5430](https://issues.apache.org/jira/browse/NETBEANS-5430] and [NETBEANS-5431](https://issues.apache.org/jira/browse/NETBEANS-5431)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#discussion_r589086890



##########
File path: ide/projectapi/apichanges.xml
##########
@@ -83,6 +83,21 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="project-priming-action">
+            <api name="general"/>
+            <summary>Added <code>ParentProjectProvider</code> and <code>RootProjectProvider</code> to improve project hierarchy discovery</summary>

Review comment:
       Stupid copy/paste error, sorry :(
   Fixed in 9fb5597448

##########
File path: ide/projectapi/apichanges.xml
##########
@@ -83,6 +83,21 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="project-priming-action">
+            <api name="general"/>
+            <summary>Added <code>ParentProjectProvider</code> and <code>RootProjectProvider</code> to improve project hierarchy discovery</summary>
+            <version major="1" minor="80"/>
+            <date day="5" month="3" year="2021"/>
+            <author login="sdedic"/>
+            <compatibility addition="yes"/>
+            <description>
+                <p>
+                    <code><a href="@TOP@/org/netbeans/spi/project/ActionProvider.html">ActionProvider.COMMAND_PRIMIE</a></code> was introduced, so that

Review comment:
       Fixed in 9fb5597448




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic edited a comment on pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic edited a comment on pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#issuecomment-793504467


   @jtulach Yes, good idea. Tracked as [NETBEANS-5430](https://issues.apache.org/jira/browse/NETBEANS-5430) and [NETBEANS-5431](https://issues.apache.org/jira/browse/NETBEANS-5431)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic edited a comment on pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic edited a comment on pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#issuecomment-793535633


   Changes from review squashed to the original commits. @dbalek:  Last chance to object before merge.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#discussion_r589088636



##########
File path: java/maven/src/org/netbeans/modules/maven/InternalActionProvider.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.maven;
+
+import org.netbeans.spi.project.ActionProvider;
+
+/**
+ * The same as ActionProvider, but won't be exported outside the module.
+ * @author sdedic
+ */
+public interface InternalActionProvider extends ActionProvider {

Review comment:
       Ok, done in 04297683b3




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#discussion_r588838032



##########
File path: ide/projectapi/apichanges.xml
##########
@@ -83,6 +83,21 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="project-priming-action">
+            <api name="general"/>
+            <summary>Added <code>ParentProjectProvider</code> and <code>RootProjectProvider</code> to improve project hierarchy discovery</summary>

Review comment:
       Summary isn't correct.

##########
File path: java/maven/src/org/netbeans/modules/maven/InternalActionProvider.java
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.maven;
+
+import org.netbeans.spi.project.ActionProvider;
+
+/**
+ * The same as ActionProvider, but won't be exported outside the module.
+ * @author sdedic
+ */
+public interface InternalActionProvider extends ActionProvider {

Review comment:
       Anyone who queries `Lookup.lookupAll(ActionProvider.class)` may get instances of `InternalActionProvider`. Is that intended? If not, I suggest to use delegation:
   ```java
   public interface InternalActionProvider {
     ActionProvider getProvider();
   }
   ```

##########
File path: ide/projectapi/apichanges.xml
##########
@@ -83,6 +83,21 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="project-priming-action">
+            <api name="general"/>
+            <summary>Added <code>ParentProjectProvider</code> and <code>RootProjectProvider</code> to improve project hierarchy discovery</summary>
+            <version major="1" minor="80"/>
+            <date day="5" month="3" year="2021"/>
+            <author login="sdedic"/>
+            <compatibility addition="yes"/>
+            <description>
+                <p>
+                    <code><a href="@TOP@/org/netbeans/spi/project/ActionProvider.html">ActionProvider.COMMAND_PRIMIE</a></code> was introduced, so that

Review comment:
       Typo `PRIMIE`

##########
File path: java/maven/src/org/netbeans/modules/maven/problems/MavenModelProblemsProvider.java
##########
@@ -328,4 +392,58 @@ private String getDescriptionText(Throwable e) {
             return TXT_NoMsg(path);
         }
     }
+    
+    //-------------------------------------------------------------------------
+    // ActionProvider implementation
+    
+    private static final String[] PROBLEM_ACTIONS = { ActionProvider.COMMAND_PRIME };
+
+    @Override
+    public String[] getSupportedActions() {
+        return PROBLEM_ACTIONS;

Review comment:
       Please add a test to verify the action is present, possibly also that it behaves kind of expected.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#discussion_r589388388



##########
File path: java/maven/src/org/netbeans/modules/maven/problems/MavenModelProblemsProvider.java
##########
@@ -328,4 +392,58 @@ private String getDescriptionText(Throwable e) {
             return TXT_NoMsg(path);
         }
     }
+    
+    //-------------------------------------------------------------------------
+    // ActionProvider implementation
+    
+    private static final String[] PROBLEM_ACTIONS = { ActionProvider.COMMAND_PRIME };
+
+    @Override
+    public String[] getSupportedActions() {
+        return PROBLEM_ACTIONS;

Review comment:
       Tests added as 7d140d0; tried to test all 3 cases: 
   - action enabled since problems were not identified yet, but the priming build itself won't run
   - action not enabled on project analyzed to been OK
   - action enabled on broken project, priming build relly executes 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795#issuecomment-793535633


   Changes from review squashed to the original commits. @dbalek:  Last change to object before merge.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic merged pull request #2795: Priming build action support

Posted by GitBox <gi...@apache.org>.
sdedic merged pull request #2795:
URL: https://github.com/apache/netbeans/pull/2795


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists