Skip to content

Conversation

mashhurs
Copy link
Collaborator

@mashhurs mashhurs commented Jan 22, 2025

Description

We don't have yet the integrations with elastic_integration unsupported processors. This PR adds a script to search processors the plugin cannot run.

E2E run: https://buildkite.com/elastic/logstash-filter-elastic-integration-e2e/builds/195

@mashhurs mashhurs changed the title Add a step to scan unsupported processors. Add an E2E step to scan unsupported processors. Jan 22, 2025
@mashhurs mashhurs linked an issue Jan 22, 2025 that may be closed by this pull request
Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

👍

The only actual issue I have is that we should keep a dict-of-lists-of-filenames instead of a dict-of-filenames.

Other notes are just future improvement ideas.

LOGSTASH_CONTAINER_NAME = "elastic-package-stack-e2e-logstash-1"
PLUGIN_NAME = "logstash-filter-elastic_integration"

SUPPORTED_PROCESSORS: list = [
Copy link
Member

Choose a reason for hiding this comment

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

it would be nice to codify this in a shared yaml that is consumed by the EventProcessorBuilder.

Not a blocker, though. Could you file an issue to unify it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is good idea! Otherwise we need to maintain both places. Yup let me see if I can do it with change. Otherwise I will create an issue and follow up later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created an issue: #249
We can utilize https://github.com/c2nes/javalang to parse the Java class and compare with the processors found from the file. I will follow up and add separately.

curr_dir = os.getcwd()
pipeline_definition_file_path = "integrations/packages/**/data_stream/**/elasticsearch/ingest_pipeline/*.yml"
files = glob.glob(os.path.join(curr_dir, pipeline_definition_file_path))
unsupported_processors: dict = {} # {type: file}
Copy link
Member

@yaauie yaauie Jan 24, 2025

Choose a reason for hiding this comment

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

should this be a dictionary of lists, so that we can get all integrations that use an unsupported processor?

Copy link
Collaborator Author

@mashhurs mashhurs Jan 24, 2025

Choose a reason for hiding this comment

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

Updated with 1c46477 commit and tested by intentionally updating some files:

Exception: Unsupported processors found: {'rename_s': ['/logstash-filter-elastic_integration/integrations/packages/1password/data_stream/audit_events/elasticsearch/ingest_pipeline/default.yml', '/logstash-filter-elastic_integration/integrations/packages/1password/data_stream/signin_attempts/elasticsearch/ingest_pipeline/default.yml'], 'json_s': ['/logstash-filter-elastic_integration/integrations/packages/1password/data_stream/audit_events/elasticsearch/ingest_pipeline/default.yml']}

self.__download_elastic_package()
self.__make_elastic_package_global()
self.__clone_integrations_repo()
self.__scan_for_unsupported_processors()
Copy link
Member

Choose a reason for hiding this comment

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

🤔 so if the elastic/integrations begin using an unsupported processor, our build breaks.

I think we might end up needing a "known incompatibilities" list so that we can mark something as known and get our build back to green once we file an issue to address it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup this is the idea for the long term. As soon as we will have unsupported plugin (assuming the plugin really cannot support), we will have a white list to continue the E2E without failing. For now, for better visibility breaking CI (since it is important to know which integration will become problematic) seems better to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will comment this plan in the raising failure part of the source.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@mashhurs mashhurs requested a review from yaauie January 24, 2025 02:53
@mashhurs mashhurs merged commit 4b0654a into elastic:main Jan 24, 2025
2 checks passed
@mashhurs mashhurs deleted the scan-for-unsupported-processors branch January 24, 2025 18:22
@mashhurs
Copy link
Collaborator Author

FYI: no need to backport since E2E runs on main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regularly monitor unsupported integrations.

3 participants