You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "sdedic (via GitHub)" <gi...@apache.org> on 2023/03/24 13:01:55 UTC

[GitHub] [netbeans] sdedic opened a new pull request, #5711: Remove dependencies on Autoupdate UI

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

   This PR creates a mini-API for installing plugins. Currently modules depend on Autoupdate UI when they need to initiate installation of a plugin - but that's not necessary.  This PR creates a SPI, which is implemented by AU UI. In absence of UI, the installation fail - most of the modules do not check the outcome of the installation anyway.
   
   With the dependency removed, AU UI can be removed from LSP distribution, which replaces the implementation done in #5620.
   


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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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 #5711: Remove dependencies on Autoupdate UI

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #5711:
URL: https://github.com/apache/netbeans/pull/5711#issuecomment-1484034483

   > 
   > I'd personally still like to see the bug side of #5620 fixed.
   
   No problem with that - but still I am not sure it is a bug or what I can break by fixing it. The current state ensures that an installation has (although possibly obsolete) information on what plugins are there in UCs.


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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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] lbownik commented on a diff in pull request #5711: Remove dependencies on Autoupdate UI

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
lbownik commented on code in PR #5711:
URL: https://github.com/apache/netbeans/pull/5711#discussion_r1147872559


##########
platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java:
##########
@@ -1751,74 +1775,97 @@ private void maybeAddToEnableList(Set<Module> willEnable, Set<Module> mightEnabl
             // Cannot satisfy its dependencies, exclude it.
             return;
         }
+        if (reported.add(m)) {
+            if (addedBecauseOfDependent == null) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + m.getCodeNameBase() + '"' + (eagerActivation ? "[color=cornsilk]" : ""));
+            } else if (!addedBecauseOfDependent.getCodeNameBase().equals(m.getCodeNameBase())) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + addedBecauseOfDependent.getCodeNameBase() + "\" "+ "->\""  
+                        + (reason != null ? "[label=\"" + reason + "\"]" : "")
+                        + " " + m.getCodeNameBase() + '"');
+            }
+        }
+
         if (!willEnable.add(m)) {
             // Already there, done.
             return;
         }
-        // need to register fragments eagerly, so they are available during
-        // dependency sort
-        Module host = attachModuleFragment(m);
-        if (host != null && !host.isEnabled()) {
-            maybeAddToEnableList(willEnable, mightEnable, host, okToFail);
-        }
-        // Also add anything it depends on, if not already there,
-        // or already enabled.
-        for (Dependency dep : m.getDependenciesArray()) {
-            if (dep.getType() == Dependency.TYPE_MODULE) {
-                String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
-                Module other = get(codeNameBase);
-                // Should never happen:
-                if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
-                if (! other.isEnabled()) {
-                    maybeAddToEnableList(willEnable, mightEnable, other, false);
-                }
-            } else if (
-                dep.getType() == Dependency.TYPE_REQUIRES || 
-                dep.getType() == Dependency.TYPE_NEEDS ||
-                dep.getType() == Dependency.TYPE_RECOMMENDS
-            ) {
-                Set<Module> providers = getProvidersOf().get(dep.getName());
-                if (providers == null) {
-                    assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
-                    continue;
-                }
-                // First check if >= 1 is already enabled or will be soon. If so, great.
-                boolean foundOne = false;
-                for (Module other : providers) {
-                    if (other.isEnabled() ||
-                            (other.getProblems().isEmpty() && mightEnable.contains(other))) {
-                        foundOne = true;
-                        break;
+        Module outer = addedBecauseOfDependent;
+        boolean outerEagerActivatioon = eagerActivation;
+        Set<Module> outerReported = reported;
+        try {
+            reported = new HashSet<>();
+            addedBecauseOfDependent = m;
+            // need to register fragments eagerly, so they are available during
+            // dependency sort
+            Module host = attachModuleFragment(m);
+            if (host != null && !host.isEnabled()) {
+                maybeAddToEnableList(willEnable, mightEnable, host, okToFail, "Fragment host");
+            }
+            
+            // Also add anything it depends on, if not already there,
+            // or already enabled.
+            for (Dependency dep : m.getDependenciesArray()) {
+                if (dep.getType() == Dependency.TYPE_MODULE) {
+                    String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
+                    Module other = get(codeNameBase);
+                    // Should never happen:
+                    if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
+                    if (! other.isEnabled()) {
+                        maybeAddToEnableList(willEnable, mightEnable, other, false, null);
                     }
-                }
-                if (foundOne) {
-                    // OK, we are satisfied.
-                    continue;
-                }
-                // All disabled. So add them all to the enable list.
-                for (Module other : providers) {
-                    // It is OK if one of them fails.
-                    maybeAddToEnableList(willEnable, mightEnable, other, true);
-                    // But we still check to ensure that at least one did not!
-                    if (!foundOne && willEnable.contains(other)) {
-                        foundOne = true;
-                        // and continue with the others, try to add them too...
+                } else if (
+                    dep.getType() == Dependency.TYPE_REQUIRES || 
+                    dep.getType() == Dependency.TYPE_NEEDS ||
+                    dep.getType() == Dependency.TYPE_RECOMMENDS
+                ) {
+                    Set<Module> providers = getProvidersOf().get(dep.getName());
+                    if (providers == null) {
+                        assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
+                        continue;
                     }
+                    // First check if >= 1 is already enabled or will be soon. If so, great.
+                    boolean foundOne = false;
+                    for (Module other : providers) {

Review Comment:
   wouldn't the following be more readable?
   if(providers.stream().anyMatch(other -> other.isEnabled() ||
                                   (other.getProblems().isEmpty() && mightEnable.contains(other))) {
    continue; 
   }



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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 #5711: Remove dependencies on Autoupdate UI

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic merged PR #5711:
URL: https://github.com/apache/netbeans/pull/5711


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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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] lbownik commented on a diff in pull request #5711: Remove dependencies on Autoupdate UI

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
lbownik commented on code in PR #5711:
URL: https://github.com/apache/netbeans/pull/5711#discussion_r1147872559


##########
platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java:
##########
@@ -1751,74 +1775,97 @@ private void maybeAddToEnableList(Set<Module> willEnable, Set<Module> mightEnabl
             // Cannot satisfy its dependencies, exclude it.
             return;
         }
+        if (reported.add(m)) {
+            if (addedBecauseOfDependent == null) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + m.getCodeNameBase() + '"' + (eagerActivation ? "[color=cornsilk]" : ""));
+            } else if (!addedBecauseOfDependent.getCodeNameBase().equals(m.getCodeNameBase())) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + addedBecauseOfDependent.getCodeNameBase() + "\" "+ "->\""  
+                        + (reason != null ? "[label=\"" + reason + "\"]" : "")
+                        + " " + m.getCodeNameBase() + '"');
+            }
+        }
+
         if (!willEnable.add(m)) {
             // Already there, done.
             return;
         }
-        // need to register fragments eagerly, so they are available during
-        // dependency sort
-        Module host = attachModuleFragment(m);
-        if (host != null && !host.isEnabled()) {
-            maybeAddToEnableList(willEnable, mightEnable, host, okToFail);
-        }
-        // Also add anything it depends on, if not already there,
-        // or already enabled.
-        for (Dependency dep : m.getDependenciesArray()) {
-            if (dep.getType() == Dependency.TYPE_MODULE) {
-                String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
-                Module other = get(codeNameBase);
-                // Should never happen:
-                if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
-                if (! other.isEnabled()) {
-                    maybeAddToEnableList(willEnable, mightEnable, other, false);
-                }
-            } else if (
-                dep.getType() == Dependency.TYPE_REQUIRES || 
-                dep.getType() == Dependency.TYPE_NEEDS ||
-                dep.getType() == Dependency.TYPE_RECOMMENDS
-            ) {
-                Set<Module> providers = getProvidersOf().get(dep.getName());
-                if (providers == null) {
-                    assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
-                    continue;
-                }
-                // First check if >= 1 is already enabled or will be soon. If so, great.
-                boolean foundOne = false;
-                for (Module other : providers) {
-                    if (other.isEnabled() ||
-                            (other.getProblems().isEmpty() && mightEnable.contains(other))) {
-                        foundOne = true;
-                        break;
+        Module outer = addedBecauseOfDependent;
+        boolean outerEagerActivatioon = eagerActivation;
+        Set<Module> outerReported = reported;
+        try {
+            reported = new HashSet<>();
+            addedBecauseOfDependent = m;
+            // need to register fragments eagerly, so they are available during
+            // dependency sort
+            Module host = attachModuleFragment(m);
+            if (host != null && !host.isEnabled()) {
+                maybeAddToEnableList(willEnable, mightEnable, host, okToFail, "Fragment host");
+            }
+            
+            // Also add anything it depends on, if not already there,
+            // or already enabled.
+            for (Dependency dep : m.getDependenciesArray()) {
+                if (dep.getType() == Dependency.TYPE_MODULE) {
+                    String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
+                    Module other = get(codeNameBase);
+                    // Should never happen:
+                    if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
+                    if (! other.isEnabled()) {
+                        maybeAddToEnableList(willEnable, mightEnable, other, false, null);
                     }
-                }
-                if (foundOne) {
-                    // OK, we are satisfied.
-                    continue;
-                }
-                // All disabled. So add them all to the enable list.
-                for (Module other : providers) {
-                    // It is OK if one of them fails.
-                    maybeAddToEnableList(willEnable, mightEnable, other, true);
-                    // But we still check to ensure that at least one did not!
-                    if (!foundOne && willEnable.contains(other)) {
-                        foundOne = true;
-                        // and continue with the others, try to add them too...
+                } else if (
+                    dep.getType() == Dependency.TYPE_REQUIRES || 
+                    dep.getType() == Dependency.TYPE_NEEDS ||
+                    dep.getType() == Dependency.TYPE_RECOMMENDS
+                ) {
+                    Set<Module> providers = getProvidersOf().get(dep.getName());
+                    if (providers == null) {
+                        assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
+                        continue;
                     }
+                    // First check if >= 1 is already enabled or will be soon. If so, great.
+                    boolean foundOne = false;
+                    for (Module other : providers) {

Review Comment:
   wouldn't the following be more readable?
   if(providers.stream().anyMatch(other -> other.isEnabled() ||
                                   (other.getProblems().isEmpty() && mightEnable.contains(other))) {
            continue; 
   }



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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] lbownik commented on a diff in pull request #5711: Remove dependencies on Autoupdate UI

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
lbownik commented on code in PR #5711:
URL: https://github.com/apache/netbeans/pull/5711#discussion_r1147872559


##########
platform/o.n.bootstrap/src/org/netbeans/ModuleManager.java:
##########
@@ -1751,74 +1775,97 @@ private void maybeAddToEnableList(Set<Module> willEnable, Set<Module> mightEnabl
             // Cannot satisfy its dependencies, exclude it.
             return;
         }
+        if (reported.add(m)) {
+            if (addedBecauseOfDependent == null) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + m.getCodeNameBase() + '"' + (eagerActivation ? "[color=cornsilk]" : ""));
+            } else if (!addedBecauseOfDependent.getCodeNameBase().equals(m.getCodeNameBase())) {
+                DEPLOG.log(Level.FINE, "DEP: \"" + addedBecauseOfDependent.getCodeNameBase() + "\" "+ "->\""  
+                        + (reason != null ? "[label=\"" + reason + "\"]" : "")
+                        + " " + m.getCodeNameBase() + '"');
+            }
+        }
+
         if (!willEnable.add(m)) {
             // Already there, done.
             return;
         }
-        // need to register fragments eagerly, so they are available during
-        // dependency sort
-        Module host = attachModuleFragment(m);
-        if (host != null && !host.isEnabled()) {
-            maybeAddToEnableList(willEnable, mightEnable, host, okToFail);
-        }
-        // Also add anything it depends on, if not already there,
-        // or already enabled.
-        for (Dependency dep : m.getDependenciesArray()) {
-            if (dep.getType() == Dependency.TYPE_MODULE) {
-                String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
-                Module other = get(codeNameBase);
-                // Should never happen:
-                if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
-                if (! other.isEnabled()) {
-                    maybeAddToEnableList(willEnable, mightEnable, other, false);
-                }
-            } else if (
-                dep.getType() == Dependency.TYPE_REQUIRES || 
-                dep.getType() == Dependency.TYPE_NEEDS ||
-                dep.getType() == Dependency.TYPE_RECOMMENDS
-            ) {
-                Set<Module> providers = getProvidersOf().get(dep.getName());
-                if (providers == null) {
-                    assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
-                    continue;
-                }
-                // First check if >= 1 is already enabled or will be soon. If so, great.
-                boolean foundOne = false;
-                for (Module other : providers) {
-                    if (other.isEnabled() ||
-                            (other.getProblems().isEmpty() && mightEnable.contains(other))) {
-                        foundOne = true;
-                        break;
+        Module outer = addedBecauseOfDependent;
+        boolean outerEagerActivatioon = eagerActivation;
+        Set<Module> outerReported = reported;
+        try {
+            reported = new HashSet<>();
+            addedBecauseOfDependent = m;
+            // need to register fragments eagerly, so they are available during
+            // dependency sort
+            Module host = attachModuleFragment(m);
+            if (host != null && !host.isEnabled()) {
+                maybeAddToEnableList(willEnable, mightEnable, host, okToFail, "Fragment host");
+            }
+            
+            // Also add anything it depends on, if not already there,
+            // or already enabled.
+            for (Dependency dep : m.getDependenciesArray()) {
+                if (dep.getType() == Dependency.TYPE_MODULE) {
+                    String codeNameBase = (String)Util.parseCodeName(dep.getName())[0];
+                    Module other = get(codeNameBase);
+                    // Should never happen:
+                    if (other == null) throw new IllegalStateException("Should have found module: " + codeNameBase); // NOI18N
+                    if (! other.isEnabled()) {
+                        maybeAddToEnableList(willEnable, mightEnable, other, false, null);
                     }
-                }
-                if (foundOne) {
-                    // OK, we are satisfied.
-                    continue;
-                }
-                // All disabled. So add them all to the enable list.
-                for (Module other : providers) {
-                    // It is OK if one of them fails.
-                    maybeAddToEnableList(willEnable, mightEnable, other, true);
-                    // But we still check to ensure that at least one did not!
-                    if (!foundOne && willEnable.contains(other)) {
-                        foundOne = true;
-                        // and continue with the others, try to add them too...
+                } else if (
+                    dep.getType() == Dependency.TYPE_REQUIRES || 
+                    dep.getType() == Dependency.TYPE_NEEDS ||
+                    dep.getType() == Dependency.TYPE_RECOMMENDS
+                ) {
+                    Set<Module> providers = getProvidersOf().get(dep.getName());
+                    if (providers == null) {
+                        assert dep.getType() == Dependency.TYPE_RECOMMENDS : "Should have found a provider of " + dep;
+                        continue;
                     }
+                    // First check if >= 1 is already enabled or will be soon. If so, great.
+                    boolean foundOne = false;
+                    for (Module other : providers) {

Review Comment:
   wouldn't the following be more readable?
   boolean foundOne = providers.stream().anyMatch(other -> other.isEnabled() ||
                                   (other.getProblems().isEmpty() && mightEnable.contains(other)));



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

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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