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

Add subActionsParams to connector definition validate fields. #177025

Closed
ersin-erdal opened this issue Feb 15, 2024 · 2 comments · Fixed by #178204
Closed

Add subActionsParams to connector definition validate fields. #177025

ersin-erdal opened this issue Feb 15, 2024 · 2 comments · Fixed by #178204
Assignees
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@ersin-erdal
Copy link
Contributor

ersin-erdal commented Feb 15, 2024

Follow-on of: #175018

We are testing connector type config, secrets and params schemas in order to be notified when there is a change on them.

But, as SubActionConnectorTypes doesn't have their params schemas listed in anywhere, couldn't test them.

They are registered during the action execution: e.g. https://github.com/ersin-erdal/kibana/blob/main/x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts#L57

We can move them in to connectorType definition schema object and create in a for loop during execution, so we can have a list to check against changes.

@ersin-erdal ersin-erdal converted this from a draft issue Feb 15, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Feb 15, 2024
@ymao1 ymao1 added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Feb 15, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Feb 15, 2024
@ymao1 ymao1 moved this from Awaiting Triage to Todo in AppEx: ResponseOps - Execution & Connectors Feb 15, 2024
@cnasikas
Copy link
Member

We can move them in to connectorType definition schema object and create in a for loop during execution, so we can have a list to check against changes.

I think moving them to the connector's type definition will reduce the simplicity of the sub-actions framework and make the connector's type definition more complex. The sub-action framework uses the actions framework behind the scenes. The schema of the sub-action connectors is defined and passed to the actions framework here. We could enhance the framework to expose the schema of the parameters of the sub-actions without having to instantiate the class (connector). For example, BedrockConnector.getSubActions(). Then the framework when constructing the schema can iterate through the sub-actions and build the params schema as a union of subactions and subactions parameters. Wdyt?

@ersin-erdal ersin-erdal moved this from In Progress to In Review in AppEx: ResponseOps - Execution & Connectors Mar 7, 2024
ersin-erdal added a commit that referenced this issue Mar 11, 2024
Resolves: #177025

I figured out a way to get the SubActions schemas and used it rather
than the suggested way in the issue.

## To verify:

Change one of the SubAction's schema and run the integration test, It
should fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants