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

[ResponseOps][Rules] Move metric rule params schema to package #205492

Merged
merged 8 commits into from
Jan 8, 2025

Conversation

adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Jan 3, 2025

Connected with #195189

Summary

  • Moved params of duration metric inventory threshold rule type to /response-ops/rule_params/metric_inventory_threshold/
  • Moved params of metric threshold rule type to /response-ops/rule_params/metric_threshold/

I did NOT move the corresponding type to the rule_params package due to the recursive imports it would create.

@adcoelho adcoelho added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Jan 3, 2025
@adcoelho adcoelho self-assigned this Jan 3, 2025
@adcoelho adcoelho requested review from a team as code owners January 3, 2025 14:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

* The schema defined in response-ops-rule-params cannot import all types from the plugins
* so the executor will expect slight differences with the type InventoryMetricThresholdParams.
*/
// @ts-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was inevitable without a major refactor of the types in x-pack/solutions/observability/plugins/infra/common/alerting/metrics/types.ts.

I tried changing InventoryMetricThresholdParams to TypeOf<typeof metricInventoryThresholdRuleParamsSchema>; but it was not possible without a major refactor.

The schema is not seen as exactly the same as InventoryMetricThresholdParams because the response-ops-rule-params package cannot import from '@kbn/metrics-data-access-plugin/common' so some types are mismatched(although they are technically the same.

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file gives packages/kbn-repo-packages/package-map.json lint error. we probably don't need to commit this file.

@adcoelho adcoelho changed the title [ResponseOps][Rules] Move anomaly rule params schema to package [ResponseOps][Rules] Move metric rule params schema to package Jan 7, 2025
Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only obs-ux-infra-services changes

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @adcoelho

@adcoelho adcoelho merged commit 4873fa1 into elastic:main Jan 8, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12668091601

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 205492

Questions ?

Please refer to the Backport tool documentation

crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jan 8, 2025
…ic#205492)

Connected with elastic#195189

## Summary

- Moved params of duration metric inventory threshold rule type to
`/response-ops/rule_params/metric_inventory_threshold/`
- Moved params of metric threshold rule type to
`/response-ops/rule_params/metric_threshold/`

**I did NOT move the corresponding type to the rule_params package due
to the recursive imports it would create.**

---------

Co-authored-by: kibanamachine <[email protected]>
adcoelho added a commit to adcoelho/kibana that referenced this pull request Jan 8, 2025
…ic#205492)

Connected with elastic#195189

- Moved params of duration metric inventory threshold rule type to
`/response-ops/rule_params/metric_inventory_threshold/`
- Moved params of metric threshold rule type to
`/response-ops/rule_params/metric_threshold/`

**I did NOT move the corresponding type to the rule_params package due
to the recursive imports it would create.**

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 4873fa1)
@adcoelho
Copy link
Contributor Author

adcoelho commented Jan 8, 2025

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

adcoelho added a commit that referenced this pull request Jan 9, 2025
…205492) (#205912)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][Rules] Move metric rule params schema to package
(#205492)](#205492)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT
[{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-08T09:50:26Z","message":"[ResponseOps][Rules]
Move metric rule params schema to package (#205492)\n\nConnected with
#195189\r\n\r\n## Summary\r\n\r\n- Moved params of duration metric
inventory threshold rule type
to\r\n`/response-ops/rule_params/metric_inventory_threshold/`\r\n- Moved
params of metric threshold rule type
to\r\n`/response-ops/rule_params/metric_threshold/`\r\n\r\n**I did NOT
move the corresponding type to the rule_params package due\r\nto the
recursive imports it would
create.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"4873fa18d70142c5c2e6633d51648c45f6f481cb","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor"],"number":205492,"url":"https://github.com/elastic/kibana/pull/205492","mergeCommit":{"message":"[ResponseOps][Rules]
Move metric rule params schema to package (#205492)\n\nConnected with
#195189\r\n\r\n## Summary\r\n\r\n- Moved params of duration metric
inventory threshold rule type
to\r\n`/response-ops/rule_params/metric_inventory_threshold/`\r\n- Moved
params of metric threshold rule type
to\r\n`/response-ops/rule_params/metric_threshold/`\r\n\r\n**I did NOT
move the corresponding type to the rule_params package due\r\nto the
recursive imports it would
create.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"4873fa18d70142c5c2e6633d51648c45f6f481cb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205492","number":205492,"mergeCommit":{"message":"[ResponseOps][Rules]
Move metric rule params schema to package (#205492)\n\nConnected with
#195189\r\n\r\n## Summary\r\n\r\n- Moved params of duration metric
inventory threshold rule type
to\r\n`/response-ops/rule_params/metric_inventory_threshold/`\r\n- Moved
params of metric threshold rule type
to\r\n`/response-ops/rule_params/metric_threshold/`\r\n\r\n**I did NOT
move the corresponding type to the rule_params package due\r\nto the
recursive imports it would
create.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"4873fa18d70142c5c2e6633d51648c45f6f481cb"}}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 13, 2025
…ic#205492)

Connected with elastic#195189

## Summary

- Moved params of duration metric inventory threshold rule type to
`/response-ops/rule_params/metric_inventory_threshold/`
- Moved params of metric threshold rule type to
`/response-ops/rule_params/metric_threshold/`

**I did NOT move the corresponding type to the rule_params package due
to the recursive imports it would create.**

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants