Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-7124] Remove use of server-side Stability type from the CLI #6309

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wildfly.core</groupId>
<artifactId>wildfly-version</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-auth-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.jboss.as.cli.operation.ParsedCommandLine;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.as.controller.client.helpers.ClientConstants;
import org.jboss.as.version.Stability;
import org.jboss.dmr.ModelNode;
import org.jboss.logmanager.LogContext;
import org.jboss.modules.ModuleLoader;
Expand Down Expand Up @@ -90,7 +89,7 @@ static EmbedHostControllerHandler create(final AtomicReference<EmbeddedProcessLa
result.removeExistingDomainConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_DOMAIN_CONFIG);
result.emptyHostConfig = new ArgumentWithoutValue(result, EMPTY_HOST_CONFIG);
result.removeExistingHostConfig = new ArgumentWithoutValue(result, REMOVE_EXISTING_HOST_CONFIG);
// TODO: Use ProductConfig.getStabilitySet()
// We must use our own Stability for tab completion choices as we can't rely on the server-side type
result.stability = new ArgumentWithValue(result, new SimpleTabCompleter(EnumSet.allOf(Stability.class)), "--stability");
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.jboss.as.cli.operation.ParsedCommandLine;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.as.controller.client.helpers.ClientConstants;
import org.jboss.as.version.Stability;
import org.jboss.dmr.ModelNode;
import org.jboss.logmanager.LogContext;
import org.jboss.modules.ModuleLoader;
Expand Down Expand Up @@ -81,7 +80,7 @@ static EmbedServerHandler create(final AtomicReference<EmbeddedProcessLaunch> se
result.removeExisting = new ArgumentWithoutValue(result, "--remove-existing");
result.removeExisting.addRequiredPreceding(result.emptyConfig);
result.timeout = new ArgumentWithValue(result, "--timeout");
// TODO: Use ProductConfig.getStabilitySet()
// We must use our own Stability for tab completion choices as we can't rely on the server-side type
result.stability = new ArgumentWithValue(result, new SimpleTabCompleter(EnumSet.allOf(Stability.class)), "--stability");

return result;
Expand Down
34 changes: 34 additions & 0 deletions cli/src/main/java/org/jboss/as/cli/embedded/Stability.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/

package org.jboss.as.cli.embedded;

/**
* Counterpart to the server-side {@code org.jboss.as.version.Stability}.
* We cannot depend on the server-side type in the strictly client-side CLI.
* <p/>
* <strong>This must only be used for tab completion suggestions. The CLI does not
* control the valid stability levels for a server, so if this class is out of sync
* with what a server allows, the only acceptable effect is incorrect suggestions.</strong>
* The alternative to this restriction is to not suggest values at all and remove this type.
*/
enum Stability {

DEFAULT("default"),
COMMUNITY("community"),
PREVIEW("preview"),
EXPERIMENTAL("experimental"),
;
private final String value;

Stability(String value) {
this.value = value;
}

@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<module name="org.jboss.modules"/>
<module name="org.jboss.as.controller-client"/>
<module name="org.jboss.as.protocol"/>
<module name="org.jboss.as.version"/>
<module name="org.wildfly.security.elytron-private" services="import"/>
<!-- optional dep that we will remove when galleon patching is used-->
<module name="org.jboss.as.patching.cli" optional="true" services="import"/>
Expand Down
Loading