-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[alerting] add mustache variable for Kibana's publicly exposed base URL #90525
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ export interface CreateExecutionHandlerOptions< | |
actions: AlertAction[]; | ||
spaceId: string; | ||
apiKey: RawAlert['apiKey']; | ||
kibanaBaseUrl: string | undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were a couple of paths of threading this new variable into the right place, this required the fewest number of changes |
||
alertType: NormalizedAlertType< | ||
Params, | ||
State, | ||
|
@@ -82,6 +83,7 @@ export function createExecutionHandler< | |
spaceId, | ||
apiKey, | ||
alertType, | ||
kibanaBaseUrl, | ||
eventLogger, | ||
request, | ||
alertParams, | ||
|
@@ -126,6 +128,7 @@ export function createExecutionHandler< | |
context, | ||
actionParams: action.params, | ||
state, | ||
kibanaBaseUrl, | ||
alertParams, | ||
}), | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,10 +44,18 @@ describe('transformActionVariables', () => { | |
"description": "The alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroup", | ||
}, | ||
Object { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I double-checked the variables we're making available, |
||
"description": "The alert action subgroup that was used to scheduled actions for the alert.", | ||
"name": "alertActionSubgroup", | ||
}, | ||
Object { | ||
"description": "The human readable name of the alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroupName", | ||
}, | ||
Object { | ||
"description": "The configured server.publicBaseUrl value or empty string if not configured.", | ||
"name": "kibanaBaseUrl", | ||
}, | ||
] | ||
`); | ||
}); | ||
|
@@ -91,10 +99,18 @@ describe('transformActionVariables', () => { | |
"description": "The alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroup", | ||
}, | ||
Object { | ||
"description": "The alert action subgroup that was used to scheduled actions for the alert.", | ||
"name": "alertActionSubgroup", | ||
}, | ||
Object { | ||
"description": "The human readable name of the alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroupName", | ||
}, | ||
Object { | ||
"description": "The configured server.publicBaseUrl value or empty string if not configured.", | ||
"name": "kibanaBaseUrl", | ||
}, | ||
Object { | ||
"description": "foo-description", | ||
"name": "context.foo", | ||
|
@@ -146,10 +162,18 @@ describe('transformActionVariables', () => { | |
"description": "The alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroup", | ||
}, | ||
Object { | ||
"description": "The alert action subgroup that was used to scheduled actions for the alert.", | ||
"name": "alertActionSubgroup", | ||
}, | ||
Object { | ||
"description": "The human readable name of the alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroupName", | ||
}, | ||
Object { | ||
"description": "The configured server.publicBaseUrl value or empty string if not configured.", | ||
"name": "kibanaBaseUrl", | ||
}, | ||
Object { | ||
"description": "foo-description", | ||
"name": "state.foo", | ||
|
@@ -204,10 +228,18 @@ describe('transformActionVariables', () => { | |
"description": "The alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroup", | ||
}, | ||
Object { | ||
"description": "The alert action subgroup that was used to scheduled actions for the alert.", | ||
"name": "alertActionSubgroup", | ||
}, | ||
Object { | ||
"description": "The human readable name of the alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroupName", | ||
}, | ||
Object { | ||
"description": "The configured server.publicBaseUrl value or empty string if not configured.", | ||
"name": "kibanaBaseUrl", | ||
}, | ||
Object { | ||
"description": "fooC-description", | ||
"name": "context.fooC", | ||
|
@@ -280,10 +312,18 @@ describe('transformActionVariables', () => { | |
"description": "The alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroup", | ||
}, | ||
Object { | ||
"description": "The alert action subgroup that was used to scheduled actions for the alert.", | ||
"name": "alertActionSubgroup", | ||
}, | ||
Object { | ||
"description": "The human readable name of the alert action group that was used to scheduled actions for the alert.", | ||
"name": "alertActionGroupName", | ||
}, | ||
Object { | ||
"description": "The configured server.publicBaseUrl value or empty string if not configured.", | ||
"name": "kibanaBaseUrl", | ||
}, | ||
Object { | ||
"description": "fooC-description", | ||
"name": "context.fooC", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ interface CreateTestConfigOptions { | |
ssl?: boolean; | ||
enableActionsProxy: boolean; | ||
rejectUnauthorized?: boolean; | ||
publicBaseUrl?: boolean; | ||
} | ||
|
||
// test.not-enabled is specifically not enabled | ||
|
@@ -97,7 +98,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) | |
...xPackApiIntegrationTestsConfig.get('kbnTestServer'), | ||
serverArgs: [ | ||
...xPackApiIntegrationTestsConfig.get('kbnTestServer.serverArgs'), | ||
'--server.publicBaseUrl=https://localhost:5601', | ||
...(options.publicBaseUrl ? ['--server.publicBaseUrl=https://localhost:5601'] : []), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed so |
||
`--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, | ||
'--xpack.encryptedSavedObjects.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', | ||
'--xpack.alerts.invalidateApiKeysTask.interval="15s"', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new instance variable so we can capture the path in
setup
and use it instart