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/02/16 11:20:37 UTC

[GitHub] [netbeans] sdedic opened a new pull request #2764: Prevent unnecessary Gradle model reloads, temporary script trust.

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


   There are three commits in this PR ... If necessary (or partially disapproved), I can split.
   
   ## Introduce "temporary trust"
   If the user acknowledges run of the gradle build script in the IDE, the script may be reloaded from time to time, for example as result of __Fix project problems__ or other occasions. If the user did not check "Trust permanently" in the question, the IDE would ask the user repeatedly even during the same IDE session.
   This change in 932c71c will change the behaviour that after user's acknowledgement, the IDE trust the buildscript within this IDE run only - and won't ask again.
   
   ## Prevent unnecessary reloads
   When the project problem is being fixed, the project model is loaded again, but then the model is thrown away and loaded once again (unnecessarily). In 22424fb I've changed the behaviour to reuse the model - if another action did not alter the model in the meantime.
   
   ## Synchronization fixes
   The `project` variable is accessed from several threads, at least from RELOAD_RP and any random thread that calls `NbGradleProjectImpl` getters. I've tried to synchronize that so the reference is replaced, but the `loadProject` is still executed outside mutexes and events are fired in RELOAD_RP.
   


----------------------------------------------------------------
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 #2764: [NETBEANS-5318] Temporary script trust.

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


   BTW - you were very quick ! reviewing this PR :) In the meantime, I've discovered that I bugged Project Customizer: there's a checkbox, that gets turned on from the temporary trust, and after changes are written from the customizer, will promote the trust to permanent. 
   I'll try to fix this by using a tri-state checkbox, the intedeterminate state reserved for "trusted, but not permanently" so the user can decide (permanent, revoke, no change).


----------------------------------------------------------------
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 #2764: [NETBEANS-5318] Prevent unnecessary Gradle model reloads, temporary script trust.

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


   @lkishalmi No problem; later in the evening.


----------------------------------------------------------------
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] lkishalmi merged pull request #2764: [NETBEANS-5318] Temporary script trust.

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


   


----------------------------------------------------------------
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] lkishalmi commented on pull request #2764: [NETBEANS-5318] Prevent unnecessary Gradle model reloads, temporary script trust.

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


   @sdedic Would I be rude if I'd ask to split this PR into two? One for the Temporal Project Trust, the other for the reload work?
   As of #2747 I'm working on the project loading at the moment. We might collide there, but generally I'm for getting the internal GradleProject synchronized.


----------------------------------------------------------------
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] neilcsmith-net commented on a change in pull request #2764: [NETBEANS-5318] Temporary script trust.

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on a change in pull request #2764:
URL: https://github.com/apache/netbeans/pull/2764#discussion_r577653766



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ProjectTrust.java
##########
@@ -65,14 +72,31 @@
         projectTrust = prefs.node(NODE_PROJECT);
         key = new SecretKeySpec(salt, HMAC_SHA256);
     }
-
+    
     /**
      * Returns true if the specified project is trusted.
      *
      * @param project of the trust check.
      * @return true if the given project is trusted.
      */
     public boolean isTrusted(Project project) {
+        synchronized (this) {
+            if (temporaryTrustedIds.contains(getPathId(project))) {
+                return true;
+            }
+        }
+        return isTrustedPermanetly(project);
+    }
+
+    /**
+     * Returns true if the specified project is trusted <b>permanently</b>.
+     * You should be probably using {@link #isTrusted} to avoid duplicate questions
+     * during one IDE run.
+     *
+     * @param project of the trust check.
+     * @return true if the given project is trusted.
+     */
+    public boolean isTrustedPermanetly(Project project) {

Review comment:
       Just noticed this method name has a typo (it was highlighted while using `git show` :smile: ).




----------------------------------------------------------------
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