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

[Fleet] Display pipelines and mappings sections in the policy editor for input packages #153105

Closed
hop-dev opened this issue Mar 10, 2023 · 5 comments · Fixed by #154077
Closed
Assignees
Labels
Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@hop-dev
Copy link
Contributor

hop-dev commented Mar 10, 2023

In #145617 the pipelines and mappings editor is disabled for input packages. Customisation is one of the big advantages of input packages so we should give users a way of easily accessing customisation options.
Screenshot 2023-02-24 at 12 11 57

Open questions

  • Input packages can send data to the streams of other packgaes, what would we show in this scenario?
    • option 1 - show the pipelines and mappings editor with links to the pipelines and mappings of the destination data stream
    • option 2 - do not show the pipelines and mappings editor, show a message saying why it isn't displayed.
@hop-dev hop-dev added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@hop-dev
Copy link
Contributor Author

hop-dev commented Mar 10, 2023

@P1llus I created this based on our conversation earlier 👍

@jlind23
Copy link
Contributor

jlind23 commented Mar 10, 2023

@kpollich As you sneaked it into our next sprint, could you please think about what we can pull out?

@kpollich
Copy link
Member

@jlind23 - To be honest I think it can fit in next sprint without moving anything else out. @hop-dev has no other assignments in Sprint 9, and the policy secrets technical definition task is nearing completion. Mark would be the targeted engineer to work on this, and he's of the mind that it'd be a fairly low-effort enhancement.

@jlind23
Copy link
Contributor

jlind23 commented Mar 10, 2023

@kpollich Thanks for the feedback then, much appreciated 😄

hop-dev added a commit that referenced this issue Apr 3, 2023
## Summary

Closes #153105

Show the pipelines and mappings editor for input packages. This can be
seen when editing an input package integration policy.

Previously this was hidden for input packages and any integration
package which allowed datastream to be configured. I have tweaked this
logic so that we check if the matching index template for a stream
exists, if it does then show the editor.
<img width="407" alt="Screenshot 2023-03-30 at 17 02 26"
src="https://user-images.githubusercontent.com/3315046/228896543-192e5fc5-3dc3-4a0f-a08f-a7ff83555ef3.png">

This allows us to handle an edge case (which will become more common as
input packages are rolled out) when integration package which has since
been upgraded to an input package, for example:
- user installs the custom logs integration package and sets dataset to
helloworld
- the `logs-helloworld` index template is not created as integration
packages only create index templates on install (custom logs creates
`logs-log.log`)
- there is therefore no ingest pipeline `@custom` or `@package`component
template to customize, we do not show the pipeline editor.
- The user upgrades to an input package version of custom logs (coming
in v2.0.0) there still isn't an index template because we do not create
them on upgrade, so we still don't want to show the pipelines and
mappings editor
- Just checking for input package in this scenario would mean we showed
the editor incorrectly

I have opted to show the editors even if the stream is owned by another
package e.g custom logs data is being sent to an nginx stream.


### Automated tests

I have added cypress tests for checking that the mappings pipelines
editors are shown for input packages.

### Manual test cases

Here is version 2.0.0 of logs which is an input package:
[log-2.0.0.zip](https://github.com/elastic/kibana/files/11113579/log-2.0.0.zip)
it can be added to a deployment using curl:

```
curl -XPOST -H 'content-type: application/zip' -H 'kbn-xsrf: true' http://localhost:5601/mark/api/fleet/epm/packages -u elastic:changeme --data-binary @/path/to/log-2.0.0.zip
```


- Create a policy for an integration package which does not allow
dataset to be configured (e.g Apache)
    - pipelines & editor should be visible when editing package policy
- Create a policy for an integration package which does allow dataset to
be configured (e.g custom logs 1.6.1)
- pipelines & mappings editor should not be shown if dataset doesn't
match the one installed by the package `logs.log`
- Upgrade custom logs to the input package version (2.0.0)
    - pipelines and mappings editor still should not be shown

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants