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

[FTR] Merge Alerting Apis from x-pack/test_serverless/shared into x-pack/test/api_integration/deployment_agnostic #193975

Merged
merged 9 commits into from
Sep 30, 2024

Conversation

wayneseymour
Copy link
Member

@wayneseymour wayneseymour commented Sep 25, 2024

Summary

Follow up of this pr, per this discussion.

Also, switch from svlCommonApi to samlAuth for internal headers.

@wayneseymour wayneseymour added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting FTR labels Sep 25, 2024
@wayneseymour wayneseymour self-assigned this Sep 25, 2024
@wayneseymour
Copy link
Member Author

/ci

@wayneseymour wayneseymour marked this pull request as ready for review September 25, 2024 15:10
@wayneseymour wayneseymour requested review from a team as code owners September 25, 2024 15:10
@wayneseymour
Copy link
Member Author

@dmlemeshko
It just hit me to run the cypress tests once more...after I put in review. Apologies

Comment on lines 195 to 1095
async findRule(ruleId: string, roleAuthc: RoleCredentials) {
async findRuleInRules(roleAuthc: RoleCredentials, ruleId: string) {
const response = await supertestWithoutAuth
.get('/api/alerting/rules/_find')
.set(roleAuthc.apiKeyHeader)
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by the naming, but I saw there is another findRule function and I think it was confusing initially.

Since you anyways work on the service, what do you think about the following:

findRule -> findRuleById(ruleId: string, roleAuthc: RoleCredentials)
when /api/alerting/rule/${ruleId} is used in API call

findRule -> findInRules(ruleId: string, roleAuthc: RoleCredentials) (or findInAllRules)
when /api/alerting/rules/_find is used in API call and later we filter response

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah there were two originally, due to merging the helpers
It's like the helpers were quickly made, instead of doing what we are doing now: discussing where they fit best, not just fit...good enough to compile and run

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -8,12 +8,12 @@
import _ from 'lodash';

import { services as apiIntegrationServices } from '@kbn/test-suites-xpack/api_integration/services';
import { AlertingApiProvider } from './alerting_api';
import { services as apiIntegrationDeploymentAgnosticServices } from '@kbn/test-suites-xpack/api_integration/deployment_agnostic/services';
Copy link
Member

Choose a reason for hiding this comment

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

Do we want load all the deployment-agnostic services or only AlertingApiProvider ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Glad you caught this.

I took the risk when I did to see if it would pass all the tests.
That said, I do not mind merging it with less risk.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Well, I can quickly see a conflict with the same service sloApi already existing in serverless.

It is really hard to find which service file was loaded, so I suggest explicitly picking only the ones that we need for particular PR. Ideally we can revisit it when more tests are migrated to deployment-agnostic format and "remove" duplicated services, but I would anyway keep importing explicitly 1 by 1 to speedup debug process

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, I like that. Will do

Copy link
Member

Choose a reason for hiding this comment

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

plus folks might update sloApi in test_serverless, but FTR will still pickup deployment-agnostic version of it. Or the opposite, it depends on lines order :)

Copy link
Member Author

@wayneseymour wayneseymour Sep 25, 2024

Choose a reason for hiding this comment

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

yeah, that sounds like smth we should fix.
This is not the PR for it, but constantly re-exporting * from abc is prolly not the best for visibility.
If it's not great for us, it's gonna be worse for others

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

obs-ux-management changes LGTM

@wayneseymour
Copy link
Member Author

@elasticmachine merge upstream

@wayneseymour
Copy link
Member Author

@dmlemeshko ok it's looking good with all the cypress tests passing as well.

Anything else you can think of here before merging?

@dmlemeshko dmlemeshko self-requested a review September 30, 2024 07:51
Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

Code changes LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

Metrics [docs]

✅ unchanged

History

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

cc @wayneseymour

@wayneseymour wayneseymour merged commit 10c3373 into elastic:main Sep 30, 2024
52 checks passed
@wayneseymour wayneseymour removed the backport:skip This commit does not require backporting label Oct 25, 2024
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 25, 2024
@wayneseymour wayneseymour added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Oct 25, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

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

You might need to backport the following PRs to 8.x:
- fix: [Obs Infrastructure > Hosts][KEYBOARD]: Host flyout has buggy scrolling when I expand the State dropdown menu (#192372)
- Shutdown Kibana on usages of PKCS12 truststore/keystore config (#192627)

Manual backport

To create the backport manually run:

node scripts/backport --pr 193975

Questions ?

Please refer to the Backport tool documentation

@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 193975

Questions ?

Please refer to the Backport tool documentation

@wayneseymour
Copy link
Member Author

💚 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

wayneseymour added a commit to wayneseymour/kibana that referenced this pull request Oct 25, 2024
…x-pack/test/api_integration/deployment_agnostic` (elastic#193975)

## Summary

Follow up of [this pr](elastic#192216),
per [this
discussion](elastic#192216 (comment)).

Also, switch from `svlCommonApi` to `samlAuth` for internal headers.

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Dzmitry Lemechko <[email protected]>
(cherry picked from commit 10c3373)

# Conflicts:
#	x-pack/test_serverless/shared/services/alerting_api.ts
wayneseymour added a commit that referenced this pull request Oct 25, 2024
…into `x-pack/test/api_integration/deployment_agnostic` (#193975) (#197822)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[FTR] Merge Alerting Apis from `x-pack/test_serverless/shared` into
`x-pack/test/api_integration/deployment_agnostic`
(#193975)](#193975)

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

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

<!--BACKPORT
[{"author":{"name":"Tre","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-30T09:41:22Z","message":"[FTR]
Merge Alerting Apis from `x-pack/test_serverless/shared` into
`x-pack/test/api_integration/deployment_agnostic` (#193975)\n\n##
Summary\r\n\r\nFollow up of [this
pr](https://github.com/elastic/kibana/pull/192216),\r\nper
[this\r\ndiscussion](https://github.com/elastic/kibana/pull/192216#discussion_r1760894369).\r\n\r\nAlso,
switch from `svlCommonApi` to `samlAuth` for internal
headers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>\r\nCo-authored-by: Dzmitry
Lemechko
<[email protected]>","sha":"10c337387485d77fd264c11888b2c28131ee515a","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:all-cypress-suites","backport:prev-minor","FTR"],"number":193975,"url":"https://github.com/elastic/kibana/pull/193975","mergeCommit":{"message":"[FTR]
Merge Alerting Apis from `x-pack/test_serverless/shared` into
`x-pack/test/api_integration/deployment_agnostic` (#193975)\n\n##
Summary\r\n\r\nFollow up of [this
pr](https://github.com/elastic/kibana/pull/192216),\r\nper
[this\r\ndiscussion](https://github.com/elastic/kibana/pull/192216#discussion_r1760894369).\r\n\r\nAlso,
switch from `svlCommonApi` to `samlAuth` for internal
headers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>\r\nCo-authored-by: Dzmitry
Lemechko
<[email protected]>","sha":"10c337387485d77fd264c11888b2c28131ee515a"}},"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/193975","number":193975,"mergeCommit":{"message":"[FTR]
Merge Alerting Apis from `x-pack/test_serverless/shared` into
`x-pack/test/api_integration/deployment_agnostic` (#193975)\n\n##
Summary\r\n\r\nFollow up of [this
pr](https://github.com/elastic/kibana/pull/192216),\r\nper
[this\r\ndiscussion](https://github.com/elastic/kibana/pull/192216#discussion_r1760894369).\r\n\r\nAlso,
switch from `svlCommonApi` to `samlAuth` for internal
headers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>\r\nCo-authored-by: Dzmitry
Lemechko
<[email protected]>","sha":"10c337387485d77fd264c11888b2c28131ee515a"}}]}]
BACKPORT-->
wayneseymour added a commit to wayneseymour/kibana that referenced this pull request Dec 19, 2024
…x-pack/test/api_integration/deployment_agnostic` (elastic#193975)

Follow up of [this pr](elastic#192216),
per [this
discussion](elastic#192216 (comment)).

Also, switch from `svlCommonApi` to `samlAuth` for internal headers.

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Dzmitry Lemechko <[email protected]>
(cherry picked from commit 10c3373)
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) ci:all-cypress-suites FTR release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants