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

W-14572210: Remove compatibility-plugin support #13782

Open
wants to merge 2 commits into
base: master
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
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ public class MuleProperties {
public static final String OBJECT_STATISTICS = "_muleStatistics";
public static final String OBJECT_RESOURCE_LOCATOR = "_muleResourceLocator";
public static final String OBJECT_ARTIFACT_AST = "_muleArtifactAst";
/**
* @deprecated since 4.9 there are no uses of this constant
*/
@Deprecated
public static final String COMPATIBILITY_PLUGIN_INSTALLED = "_compatibilityPluginInstalled";
public static final String MULE_PROFILING_SERVICE_KEY = "_muleProfilingService";
public static final String MULE_CORE_EVENT_TRACER_KEY = "_muleCoreEventTracer";
Expand Down
1 change: 0 additions & 1 deletion runtime-extension-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
--add-exports=org.mule.runtime.api/org.mule.runtime.internal.dsl=ALL-UNNAMED
--add-exports=org.mule.runtime.extension.model/org.mule.runtime.config.internal.validation.test=ALL-UNNAMED
--add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.loader=org.mule.runtime.extension.model
--add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.spi=ALL-UNNAMED
--add-exports=org.mule.runtime.dsl.api/org.mule.runtime.dsl.internal.xml.parser=ALL-UNNAMED
--add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.dsl=ALL-UNNAMED
${surefire.args.base}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package org.mule.runtime.config.internal.validation;

import static org.mule.runtime.ast.api.validation.Validation.Level.ERROR;
import static org.mule.runtime.ast.api.validation.Validation.Level.WARN;
import static org.mule.runtime.ast.api.validation.ValidationResultItem.create;

import static java.lang.String.format;
Expand All @@ -30,12 +29,6 @@
*/
public class AllComponentsBelongToSomeExtensionModel implements Validation {

private final boolean shouldBeError;

public AllComponentsBelongToSomeExtensionModel(boolean isCompatibilityPluginInstalled) {
this.shouldBeError = !isCompatibilityPluginInstalled;
}

@Override
public String getName() {
return "All components belong to some extension model";
Expand All @@ -48,7 +41,7 @@ public String getDescription() {

@Override
public Level getLevel() {
return shouldBeError ? ERROR : WARN;
return ERROR;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@ public class CoreValidationsProvider implements ValidationsProvider, ArtifactAst
@Inject
private ExpressionLanguage expressionLanguage;

@Inject
@Named("_compatibilityPluginInstalled")
private Optional<Object> compatibilityPluginInstalled;

@Override
public List<Validation> get() {
List<Validation> validations = new ArrayList<>(asList(new AllComponentsBelongToSomeExtensionModel(isCompatibilityInstalled()),
List<Validation> validations = new ArrayList<>(asList(new AllComponentsBelongToSomeExtensionModel(),
new SingletonsAreNotRepeated(),
new SingletonsPerFileAreNotRepeated(),
new NamedTopLevelElementsHaveName(),
Expand Down Expand Up @@ -127,10 +123,6 @@ public List<Validation> get() {
return validations;
}

private boolean isCompatibilityInstalled() {
return compatibilityPluginInstalled != null && compatibilityPluginInstalled.isPresent();
}

public static Level getExpressionSyntacticValidationErrorLevel(Optional<FeatureFlaggingService> featureFlaggingService) {
// Honour the system property consistently with MuleConfiguration#isValidateExpressions
boolean validateExpressions = true;
Expand Down Expand Up @@ -158,7 +150,7 @@ public List<ArtifactValidation> getArtifactValidations() {
new ConfigReferenceParametersStereotypesValidations(featureFlaggingService, ignoreParamsWithProperties,
artifactAstDependencyGraphProviderForValidator),
new ReferenceParametersStereotypesValidations(artifactAstDependencyGraphProviderForValidator),
new MelNotEnabled(isCompatibilityInstalled()));
new MelNotEnabled());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
*/
public class MelNotEnabled implements ArtifactValidation {

private final boolean compatibilityInstalled;

public MelNotEnabled(boolean compatibilityInstalled) {
this.compatibilityInstalled = compatibilityInstalled;
}

@Override
public String getName() {
return "MEL not enabled";
Expand All @@ -55,9 +49,7 @@ public Level getLevel() {

@Override
public List<ValidationResultItem> validateMany(ArtifactAst artifact) {
if (compatibilityInstalled) {
return singletonList(create(emptyList(), this, "Deployed artifact uses the compatibility plugin."));
} else if (isMelDefault()) {
if (isMelDefault()) {
return singletonList(create(emptyList(), this,
"Runtime has the '" + MULE_MEL_AS_DEFAULT + "' system property set to true."));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@
*/
package org.mule.runtime.config.internal.validation;

import static org.mule.test.allure.AllureConstants.MuleDsl.DslValidationStory.DSL_VALIDATION_STORY;
import static org.mule.test.allure.AllureConstants.MuleDsl.MULE_DSL;
import static org.mule.test.allure.AllureConstants.MuleDsl.DslValidationStory.DSL_VALIDATION_STORY;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;

import org.mule.runtime.ast.api.validation.Validation;
import org.mule.runtime.ast.api.validation.ValidationResultItem;
import org.mule.runtime.config.internal.validation.test.AbstractCoreValidationTestCase;

import java.util.Optional;

import org.junit.Test;

import io.qameta.allure.Feature;
import io.qameta.allure.Story;
import org.junit.Test;

@Feature(MULE_DSL)
@Story(DSL_VALIDATION_STORY)
public class AllComponentsBelongToSomeExtensionModelTestCase extends AbstractCoreValidationTestCase {

@Override
protected Validation getValidation() {
return new AllComponentsBelongToSomeExtensionModel(false);
return new AllComponentsBelongToSomeExtensionModel();
}

@Test
Expand Down