Skip to content

Commit

Permalink
[8.16] [ResponseOps][Rules]Deprecate `ruleFormV2` flag. (#1…
Browse files Browse the repository at this point in the history
…96507) (#196702)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ResponseOps][Rules]Deprecate `ruleFormV2` flag.
(#196507)](#196507)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T13:48:36Z","message":"[ResponseOps][Rules]Deprecate
`ruleFormV2` flag. (#196507)\n\nFixes #196493\r\n\r\n##
Summary\r\n\r\nIn a previous PR the `ruleFormV2` feature flag was
renamed when it\r\nshould have been deprecated. This PR fixes
that.","sha":"7988ced8ea04966a02901e68791eb6f24d6ea40e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","Feature:Alerting/RulesFramework","backport:prev-minor","v8.16.0"],"title":"[ResponseOps][Rules]Deprecate
`ruleFormV2`
flag.","number":196507,"url":"https://github.com/elastic/kibana/pull/196507","mergeCommit":{"message":"[ResponseOps][Rules]Deprecate
`ruleFormV2` flag. (#196507)\n\nFixes #196493\r\n\r\n##
Summary\r\n\r\nIn a previous PR the `ruleFormV2` feature flag was
renamed when it\r\nshould have been deprecated. This PR fixes
that.","sha":"7988ced8ea04966a02901e68791eb6f24d6ea40e"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196507","number":196507,"mergeCommit":{"message":"[ResponseOps][Rules]Deprecate
`ruleFormV2` flag. (#196507)\n\nFixes #196493\r\n\r\n##
Summary\r\n\r\nIn a previous PR the `ruleFormV2` feature flag was
renamed when it\r\nshould have been deprecated. This PR fixes
that.","sha":"7988ced8ea04966a02901e68791eb6f24d6ea40e"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Antonio <[email protected]>
  • Loading branch information
kibanamachine and adcoelho authored Oct 21, 2024
1 parent 0f87c3d commit 1f26be2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const allowedExperimentalValues = Object.freeze({
isUsingRuleCreateFlyout: false,
});

const deprecatedExperimentalValues = new Set(['ruleFormV2']);

type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
type Mutable<T> = { -readonly [P in keyof T]: T[P] };

Expand Down Expand Up @@ -56,7 +58,10 @@ export const parseExperimentalConfigValue = (configValue: string[]): Experimenta
};

export const isValidExperimentalValue = (value: string): boolean => {
return allowedKeys.includes(value as keyof ExperimentalFeatures);
return (
allowedKeys.includes(value as keyof ExperimentalFeatures) ||
deprecatedExperimentalValues.has(value)
);
};

export const getExperimentalAllowedValues = (): string[] => [...allowedKeys];

0 comments on commit 1f26be2

Please sign in to comment.