Skip to content

Commit

Permalink
[8.x] Use getUrlPartsWithStrippedDefaultPort instead of getUrlParts (#…
Browse files Browse the repository at this point in the history
…199264) (#199288)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Use getUrlPartsWithStrippedDefaultPort instead of getUrlParts
(#199264)](#199264)

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

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

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-07T10:45:33Z","message":"Use
getUrlPartsWithStrippedDefaultPort instead of getUrlParts
(#199264)\n\n## Summary\r\n\r\nUse getUrlPartsWithStrippedDefaultPort to
avoid
this\r\n[issue](https://github.com/elastic/kibana/pull/195902#issuecomment-2411667499)\r\non
MKI:\r\n\r\n```\r\nServerless Observability - Deployment-agnostic api
integration - Custom Threshold rule AVG - PCT - FIRED Rule creation
should set correct action variables\r\n\r\nError: expected
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\nto
sort of equal
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud:443/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\n```","sha":"996104f2eae2a3eb2412d5bb4ca52e89a5dbb1db","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management"],"title":"Use
getUrlPartsWithStrippedDefaultPort instead of
getUrlParts","number":199264,"url":"https://github.com/elastic/kibana/pull/199264","mergeCommit":{"message":"Use
getUrlPartsWithStrippedDefaultPort instead of getUrlParts
(#199264)\n\n## Summary\r\n\r\nUse getUrlPartsWithStrippedDefaultPort to
avoid
this\r\n[issue](https://github.com/elastic/kibana/pull/195902#issuecomment-2411667499)\r\non
MKI:\r\n\r\n```\r\nServerless Observability - Deployment-agnostic api
integration - Custom Threshold rule AVG - PCT - FIRED Rule creation
should set correct action variables\r\n\r\nError: expected
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\nto
sort of equal
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud:443/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\n```","sha":"996104f2eae2a3eb2412d5bb4ca52e89a5dbb1db"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199264","number":199264,"mergeCommit":{"message":"Use
getUrlPartsWithStrippedDefaultPort instead of getUrlParts
(#199264)\n\n## Summary\r\n\r\nUse getUrlPartsWithStrippedDefaultPort to
avoid
this\r\n[issue](https://github.com/elastic/kibana/pull/195902#issuecomment-2411667499)\r\non
MKI:\r\n\r\n```\r\nServerless Observability - Deployment-agnostic api
integration - Custom Threshold rule AVG - PCT - FIRED Rule creation
should set correct action variables\r\n\r\nError: expected
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\nto
sort of equal
'https://bk-serverless-ftr-3067-e697d43e3ad9-e0ac80.kb.eu-west-1.aws.qa.elastic.cloud:443/app/observability/alerts/1e0c2d3e-e5c2-4bfe-9df0-d46681253b9f'\r\n```","sha":"996104f2eae2a3eb2412d5bb4ca52e89a5dbb1db"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <[email protected]>
  • Loading branch information
kibanamachine and maryam-saeidi authored Nov 7, 2024
1 parent daa1b3c commit c3bf0b4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});

const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
`${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});

const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();

expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
const resp = await alertingApi.waitForDocumentInIndex<ActionDocument>({
indexName: ALERT_ACTION_INDEX,
});
const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();

expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
docCountTarget: 1,
});

const { protocol, hostname, port } = kbnTestConfig.getUrlParts();
const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort();
expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold');
expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql(
`${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}`
Expand Down

0 comments on commit c3bf0b4

Please sign in to comment.