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

Teach pipeline validator about terminate processor #847

Closed
wants to merge 2 commits into from

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Dec 16, 2024

What does this PR do?

Add terminate processor to list of valid processors.

Why is it important?

Currently the processor cannot be used.

Checklist

Related issues

@efd6 efd6 added enhancement New feature or request Team:Security-External Integrations Label for the Security External Integrations team labels Dec 16, 2024
@efd6 efd6 self-assigned this Dec 16, 2024
@efd6 efd6 force-pushed the terminate_processor branch from a493f90 to bb47636 Compare December 16, 2024 23:14
@efd6 efd6 changed the title Teach pipeline validator abount terminate processor Teach pipeline validator about terminate processor Dec 16, 2024
@efd6 efd6 marked this pull request as ready for review December 16, 2024 23:29
@efd6 efd6 requested a review from a team as a code owner December 16, 2024 23:29
jsoriano
jsoriano previously approved these changes Dec 17, 2024
Comment on lines +13 to +15
- description: Add `terminate` processor to list pipeline spec.
type: enhancement
link: https://github.com/elastic/package-spec/pull/847
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be added in a 3.3.2. Both spec 3.3 and the terminate processor were introduced in 8.16,

Suggested change
- description: Add `terminate` processor to list pipeline spec.
type: enhancement
link: https://github.com/elastic/package-spec/pull/847
- version: 3.3.2-next
changes:
- description: Add `terminate` processor to list pipeline spec.
type: enhancement
link: https://github.com/elastic/package-spec/pull/847

@@ -48,6 +48,7 @@ spec:
# set_security_user: false # Applicable to packages?
sort: { type: object }
split: { type: object }
terminate: { type: object }
Copy link
Member

Choose a reason for hiding this comment

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

Btw, please add a patch below, so this processor is actually not available in older versions of the spec, something like this:

  - before: 3.3.0
    patch:
      - op: remove
        path: /definitions/processors/terminate # remove terminate processor validation

@efd6 efd6 force-pushed the terminate_processor branch from 03f60e1 to d304004 Compare December 17, 2024 20:26
@efd6
Copy link
Contributor Author

efd6 commented Dec 17, 2024

@jsoriano It seems that that does not work, unless I have misunderstood your instructions.

Comment on lines +119 to +122
- before: 3.3.0
patch:
- op: remove
path: /definitions/processors/terminate # remove terminate processor validation
Copy link
Contributor

Choose a reason for hiding this comment

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

This array item should be added as the first one (as it references a newer version in the before field).

And looking at the error:

failed to load schema for "integration/elasticsearch/pipeline.spec.yml": failed to apply patch: error in remove for path: '/definitions/processors/terminate': unable to remove nonexistent key: terminate: missing value

the path should be updated too.

I think it should be like this:

versions:
  - before: 3.3.0
    patch:
      - op: remove
        path: /definitions/processor/properties/terminate # remove terminate processor validation
  - before: 3.1.0
    patch:
      - op: remove
        path: /definitions/processors/if # remove rename processor validation
      - op: remove
        path: /definitions/processors/then # remove rename processor validation
  

@jsoriano
Copy link
Member

Continuing with this change in #857.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Security-External Integrations Label for the Security External Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Change Proposal] Allow 'terminate' ingest processor
4 participants