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

[ObsUX] [APM] Make anomalyDetectorTypes optional #180717

Conversation

MiriamAparicio
Copy link
Contributor

@MiriamAparicio MiriamAparicio commented Apr 12, 2024

Closes #180699

When we add the anomalyDetectorTypes we introduced a breaking change, not making this new parameter optional.
This PR is meant to make this parameter optional for backwards compatibility

@MiriamAparicio MiriamAparicio added bug Fixes for quality problems that affect the customer experience release_note:fix Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.14.0 labels Apr 12, 2024
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner April 12, 2024 15:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@pmuellr
Copy link
Member

pmuellr commented Apr 12, 2024

I think this is the appropriate fix for the problem; checking with team before approving.

I suspect the "connector params" jest integration test to fail - you'll have to update that snapshot ... this is a new test that will catch these types of changes from now on ...

https://github.com/elastic/kibana/blob/main/x-pack/plugins/alerting/server/integration_tests/serverless_upgrade_and_rollback_checks.test.ts

run with

node scripts/jest_integration.js x-pack/plugins/alerting/server/integration_tests/serverless_upgrade_and_rollback_checks.test.ts

If that test doesn't fail, I think it means the rule type is not in the list in the module. And so should be added :-)

@pmuellr
Copy link
Member

pmuellr commented Apr 12, 2024

I think this is the appropriate fix for the problem; checking with team before approving.

Concur that this seems like an appropriate fix. Once this is live, rules that previously failed execution because of the validation should just start running again successfully.

I understand there isn't supposed to be another 8.13 patch release, but of course there could be. Seems like we should backport this to 8.13.

@pmuellr
Copy link
Member

pmuellr commented Apr 12, 2024

Another flavor that should work is this:

  anomalyDetectorTypes: schema.arrayOf(detectorsSchema, {
    minSize: 1,
    defaultValue: [],
  }),

Using defaultValue is the say as schema.maybe(), but returns the specified value if no value is passed to the validator.

This would allow you to treat the validated value as string[] instead of string[] | undefined. But I think you already have code that considers this could be undefined, so may be even more work to "fix" that.

@crespocarlos
Copy link
Contributor

@elasticmachine merge upstream

@MiriamAparicio MiriamAparicio force-pushed the 180699-make-detector-types-parameter-optional branch from 6cedb35 to 8e838df Compare April 15, 2024 08:55
@MiriamAparicio MiriamAparicio requested a review from a team as a code owner April 15, 2024 08:55
@crespocarlos crespocarlos added the backport:prev-minor Backport to the previous minor version (i.e. one version back from main) label Apr 15, 2024
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM

@crespocarlos
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@crespocarlos crespocarlos merged commit 5e13701 into elastic:main Apr 16, 2024
34 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 16, 2024
Closes elastic#180699

When we add the `anomalyDetectorTypes` we introduced a breaking change,
not making this new parameter optional.
This PR is meant to make this parameter optional for backwards
compatibility

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <carloshenrique.leonelcrespo@elastic.co>
Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
(cherry picked from commit 5e13701)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.13

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 18, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

2 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

MiriamAparicio added a commit that referenced this pull request Apr 24, 2024
…80896)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[ObsUX] [APM] Make anomalyDetectorTypes opcional
(#180717)](#180717)

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

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

<!--BACKPORT
[{"author":{"name":"Miriam","email":"31922082+MiriamAparicio@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-04-16T10:30:17Z","message":"[ObsUX]
[APM] Make anomalyDetectorTypes opcional (#180717)\n\nCloses
#180699 we add the
`anomalyDetectorTypes` we introduced a breaking change,\r\nnot making
this new parameter optional.\r\nThis PR is meant to make this parameter
optional for
backwards\r\ncompatibility\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Carlos Crespo
<carloshenrique.leonelcrespo@elastic.co>\r\nCo-authored-by: Nathan L
Smith
<nathan.smith@elastic.co>","sha":"5e13701360815a6aee29ce90669ff8bf26c61479","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:prev-minor","Team:obs-ux-infra_services","v8.14.0"],"title":"[ObsUX]
[APM] Make anomalyDetectorTypes
opcional","number":180717,"url":"#180717
[APM] Make anomalyDetectorTypes opcional (#180717)\n\nCloses
#180699 we add the
`anomalyDetectorTypes` we introduced a breaking change,\r\nnot making
this new parameter optional.\r\nThis PR is meant to make this parameter
optional for
backwards\r\ncompatibility\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Carlos Crespo
<carloshenrique.leonelcrespo@elastic.co>\r\nCo-authored-by: Nathan L
Smith
<nathan.smith@elastic.co>","sha":"5e13701360815a6aee29ce90669ff8bf26c61479"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"#180717
[APM] Make anomalyDetectorTypes opcional (#180717)\n\nCloses
#180699 we add the
`anomalyDetectorTypes` we introduced a breaking change,\r\nnot making
this new parameter optional.\r\nThis PR is meant to make this parameter
optional for
backwards\r\ncompatibility\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Carlos Crespo
<carloshenrique.leonelcrespo@elastic.co>\r\nCo-authored-by: Nathan L
Smith
<nathan.smith@elastic.co>","sha":"5e13701360815a6aee29ce90669ff8bf26c61479"}}]}]
BACKPORT-->

---------

Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
Co-authored-by: Carlos Crespo <carloshenrique.leonelcrespo@elastic.co>
Co-authored-by: Jon <jon@elastic.co>
@kibanamachine kibanamachine added v8.13.3 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Apr 24, 2024
@lcawl lcawl changed the title [ObsUX] [APM] Make anomalyDetectorTypes opcional [ObsUX] [APM] Make anomalyDetectorTypes optional May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience release_note:fix Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.13.3 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ObsUX] [APM] Make anomalyDetectorTypes optional
9 participants