Skip to content

Permit EQL feature flag in release builds #52201

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

Merged
merged 1 commit into from
Feb 11, 2020
Merged
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
5 changes: 2 additions & 3 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ testClusters.integTest {
setting 'indices.lifecycle.history_index_enabled', 'false'
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
systemProperty 'es.eql_feature_flag_registered', 'true'
}
setting 'xpack.autoscaling.enabled', 'true'
if (BuildParams.isSnapshotBuild()) {
setting 'xpack.eql.enabled', 'true'
}
setting 'xpack.eql.enabled', 'true'
}

// enable regexes in painless so our tests don't complain about example snippets that use them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@

public class EqlPlugin extends Plugin implements ActionPlugin {

private static final boolean EQL_FEATURE_FLAG_REGISTERED;

static {
final String property = System.getProperty("es.eql_feature_flag_registered");
if (Build.CURRENT.isSnapshot() && property != null) {
throw new IllegalArgumentException("es.eql_feature_flag_registered is only supported in non-snapshot builds");
}
if ("true".equals(property)) {
EQL_FEATURE_FLAG_REGISTERED = true;
} else if ("false".equals(property) || property == null) {
EQL_FEATURE_FLAG_REGISTERED = false;
} else {
throw new IllegalArgumentException(
"expected es.eql_feature_flag_registered to be unset or [true|false] but was [" + property + "]"
);
}
}

public static final Setting<Boolean> EQL_ENABLED_SETTING = Setting.boolSetting(
"xpack.eql.enabled",
false,
Expand Down Expand Up @@ -83,7 +101,7 @@ private Collection<Object> createComponents(Client client, String clusterName, N
*/
@Override
public List<Setting<?>> getSettings() {
if (isSnapshot()) {
if (isSnapshot() || EQL_FEATURE_FLAG_REGISTERED) {
return List.of(EQL_ENABLED_SETTING);
} else {
return List.of();
Expand Down