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

New Integration Assistant plugin #184296

Merged
merged 101 commits into from
Jun 13, 2024
Merged

New Integration Assistant plugin #184296

merged 101 commits into from
Jun 13, 2024

Conversation

P1llus
Copy link
Member

@P1llus P1llus commented May 27, 2024

Summary

This is a PR to add a new backend plugin (frontend will be done in separate PR).

The purpose of the plugin is to provide a set of API routes that is used to perform a variety of GenAI workflows to generate new integrations based on provided inputs.

It reuses the existing GenAI connectors for its LLM communication, and provides a set of API's to create ECS mapping, Categorization, Related Fields and an API to generate the actual integration package zip, which is forwarded to the UI component.

Planned follow-up changes:

As the PR is getting way too large, some planned changes would be added in much smaller follow-ups. This includes mostly more improved try/catch for certain routes, adding debug/error log entries where relevant, especially for the API endpoints themself, some more unit and end2end tests.

  • OpenAPI spec for the API will be handled in a separate PR
  • All the missing unit tests will be added as a followup PR

Testing

The integration_assistant plugin will be disabled by default while it's being implemented so we can iterate and merge partial PRs without interfering with the releases. This config will work as our feature flag:

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: false }),
});

To test it add this to your kibana.dev.yml:

xpack.integration_assistant.enabled: true

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@semd
Copy link
Contributor

semd commented May 30, 2024

I've disabled the plugin by default here: 6aefd4f
PR description updated

@semd
Copy link
Contributor

semd commented May 30, 2024

@elasticmachine merge upstream

@semd
Copy link
Contributor

semd commented May 30, 2024

/ci

@bhapas
Copy link
Contributor

bhapas commented Jun 11, 2024

/ci

@semd
Copy link
Contributor

semd commented Jun 11, 2024

Do we actually want this labeled as release_note:skip?

@ebeahan My idea was to add the release_note:feature label only to the PR enabling the feature flag by default. Otherwise, we'll have multiple PRs with this same feature label. I think this way is less confusing when creating the release notes. But that's just my opinion, feel free to change it if you prefer to have the feature label 👍

@ebeahan
Copy link
Member

ebeahan commented Jun 11, 2024

@semd Makes great sense! Thanks for clarifying the intent for me. 😄

@bhapas
Copy link
Contributor

bhapas commented Jun 12, 2024

@elasticmachine merge upstream

@semd
Copy link
Contributor

semd commented Jun 12, 2024

@elasticmachine merge upstream

@bhapas
Copy link
Contributor

bhapas commented Jun 13, 2024

@elasticmachine merge upstream

@bhapas
Copy link
Contributor

bhapas commented Jun 13, 2024

@elasticmachine merge upstream

@bhapas
Copy link
Contributor

bhapas commented Jun 13, 2024

@elasticmachine merge upstream

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Checked out, tested locally, and code reviewed GenAI Team changes -- LGTM!

Fantastic work Marius and team landing this amazing automation effort!! Setting the stage for our agentic future and task automation with LLM's and LangGraph. 🙌 🚀🎉

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 536 534 -2
osquery 347 345 -2
securitySolution 5510 5505 -5
total -9

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
integrationAssistant - 69 +69

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.5MB 3.5MB -5.0B
cloudSecurityPosture 450.2KB 450.2KB -5.0B
dashboard 497.2KB 489.3KB -7.8KB
lens 1.5MB 1.5MB -5.0B
mapsEms 95.8KB 95.8KB -5.0B
ml 4.1MB 4.1MB -5.0B
monitoring 533.3KB 533.3KB -5.0B
observability 308.6KB 308.6KB -5.0B
osquery 1.0MB 1.0MB -7.8KB
profiling 405.7KB 405.7KB -5.0B
securitySolution 13.6MB 13.6MB -14.5KB
triggersActionsUi 1.7MB 1.7MB -5.0B
unifiedSearch 221.5KB 221.5KB -5.0B
total -30.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
embeddable 70.7KB 70.7KB -5.0B
fleet 165.7KB 165.7KB -5.0B
indexManagement 43.5KB 43.5KB -5.0B
kibanaUtils 71.7KB 71.7KB -5.0B
upgradeAssistant 24.7KB 24.7KB -5.0B
total -25.0B
Unknown metric groups

API count

id before after diff
integrationAssistant - 69 +69

ESLint disabled in files

id before after diff
integrationAssistant - 3 +3

ESLint disabled line counts

id before after diff
integrationAssistant - 2 +2

Total ESLint disabled count

id before after diff
integrationAssistant - 5 +5

History

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

cc @bhapas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.