Skip to content

[Connectors] Allow pre-configured connectors to opt-in to exposing their config by setting exposeConfig #207654

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

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

YulNaumenko
Copy link
Contributor

@YulNaumenko YulNaumenko commented Jan 22, 2025

Resolves #206433

Added optional exposeConfig field to the preconfiguredActionSchema to allow return the configuration for the pre-configured connectors, which set this value as true.
This change is completely backward compatible, because this field is optional and all the connectors, which don't have the value will remain to work the same way as before the change (won't return the config).

Changed get and getAll methods of the ActionsClient to reflect opt-in config based on the set exposeConfig value.

@YulNaumenko YulNaumenko self-assigned this Jan 22, 2025
@YulNaumenko YulNaumenko requested a review from a team as a code owner January 22, 2025 04:45
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM, but we're discussing this in Slack right now :-)

@@ -32,6 +32,7 @@ const preconfiguredActionSchema = schema.object({
actionTypeId: schema.string({ minLength: 1 }),
config: schema.recordOf(schema.string(), schema.any(), { defaultValue: {} }),
secrets: schema.recordOf(schema.string(), schema.any(), { defaultValue: {} }),
exposeConfig: schema.maybe(schema.boolean()),
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to make this schema.boolean({ defaultValue: false}) (or whatever)?

@pmuellr
Copy link
Member

pmuellr commented Jan 22, 2025

This doc should be updated to reflect the changes: https://github.com/elastic/kibana/blob/main/docs/management/connectors/pre-configured-connectors.asciidoc

@YulNaumenko YulNaumenko requested a review from pmuellr January 22, 2025 16:31
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@YulNaumenko YulNaumenko enabled auto-merge (squash) January 22, 2025 17:31
@YulNaumenko YulNaumenko merged commit c15674f into elastic:main Jan 22, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
actions 325 326 +1
Unknown metric groups

API count

id before after diff
actions 331 332 +1

cc @YulNaumenko

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 22, 2025
…eir config by setting `exposeConfig` (elastic#207654)

Resolves elastic#206433

Added optional `exposeConfig` field to the `preconfiguredActionSchema`
to allow return the configuration for the pre-configured connectors,
which set this value as `true`.
This change is completely backward compatible, because this field is
optional and all the connectors, which don't have the value will remain
to work the same way as before the change (won't return the config).

Changed get and getAll methods of the ActionsClient to reflect opt-in
config based on the set `exposeConfig` value.

(cherry picked from commit c15674f)
@kibanamachine
Copy link
Contributor

💚 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

kibanamachine added a commit that referenced this pull request Jan 23, 2025
…ing their config by setting `exposeConfig` (#207654) (#207902)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Connectors] Allow pre-configured connectors to opt-in to exposing
their config by setting `exposeConfig`
(#207654)](#207654)

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

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

<!--BACKPORT [{"author":{"name":"Yuliia
Naumenko","email":"jo.naumenko@gmail.com"},"sourceCommit":{"committedDate":"2025-01-22T18:51:16Z","message":"[Connectors]
Allow pre-configured connectors to opt-in to exposing their config by
setting `exposeConfig` (#207654)\n\nResolves #206433\r\n\r\nAdded
optional `exposeConfig` field to the `preconfiguredActionSchema`\r\nto
allow return the configuration for the pre-configured
connectors,\r\nwhich set this value as `true`.\r\nThis change is
completely backward compatible, because this field is\r\noptional and
all the connectors, which don't have the value will remain\r\nto work
the same way as before the change (won't return the
config).\r\n\r\nChanged get and getAll methods of the ActionsClient to
reflect opt-in\r\nconfig based on the set `exposeConfig`
value.","sha":"c15674f6d1e670b4210e31031ed93a8c95fdba3b","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:version","8.18
candidate","v8.18.0"],"title":"[Connectors] Allow pre-configured
connectors to opt-in to exposing their config by setting
`exposeConfig`","number":207654,"url":"https://github.com/elastic/kibana/pull/207654","mergeCommit":{"message":"[Connectors]
Allow pre-configured connectors to opt-in to exposing their config by
setting `exposeConfig` (#207654)\n\nResolves #206433\r\n\r\nAdded
optional `exposeConfig` field to the `preconfiguredActionSchema`\r\nto
allow return the configuration for the pre-configured
connectors,\r\nwhich set this value as `true`.\r\nThis change is
completely backward compatible, because this field is\r\noptional and
all the connectors, which don't have the value will remain\r\nto work
the same way as before the change (won't return the
config).\r\n\r\nChanged get and getAll methods of the ActionsClient to
reflect opt-in\r\nconfig based on the set `exposeConfig`
value.","sha":"c15674f6d1e670b4210e31031ed93a8c95fdba3b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207654","number":207654,"mergeCommit":{"message":"[Connectors]
Allow pre-configured connectors to opt-in to exposing their config by
setting `exposeConfig` (#207654)\n\nResolves #206433\r\n\r\nAdded
optional `exposeConfig` field to the `preconfiguredActionSchema`\r\nto
allow return the configuration for the pre-configured
connectors,\r\nwhich set this value as `true`.\r\nThis change is
completely backward compatible, because this field is\r\noptional and
all the connectors, which don't have the value will remain\r\nto work
the same way as before the change (won't return the
config).\r\n\r\nChanged get and getAll methods of the ActionsClient to
reflect opt-in\r\nconfig based on the set `exposeConfig`
value.","sha":"c15674f6d1e670b4210e31031ed93a8c95fdba3b"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Yuliia Naumenko <jo.naumenko@gmail.com>
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
…eir config by setting `exposeConfig` (elastic#207654)

Resolves elastic#206433

Added optional `exposeConfig` field to the `preconfiguredActionSchema`
to allow return the configuration for the pre-configured connectors,
which set this value as `true`.
This change is completely backward compatible, because this field is
optional and all the connectors, which don't have the value will remain
to work the same way as before the change (won't return the config).

Changed get and getAll methods of the ActionsClient to reflect opt-in
config based on the set `exposeConfig` value.
@KOTungseth KOTungseth added Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jan 27, 2025
@elasticmachine
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.18 candidate backport:version Backport to applied version labels Feature:Actions release_note:enhancement 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.

[ResponseOps][Connectors] allow pre-configured connectors to opt-in to exposing their config
5 participants