-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Show pipelines and mappings editor for input packages #154077
[Fleet] Show pipelines and mappings editor for input packages #154077
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/fleet (Team:Fleet) |
|
||
import { useLink } from '../../../../hooks'; | ||
import { sendRequestForRq, useLink } from '../../../../hooks'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
...olicy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx
Show resolved
Hide resolved
…-ref HEAD~1..HEAD --fix'
f40bf32
to
061f280
Compare
}) { | ||
const { method, path, body, contentType } = opts; | ||
const Authorization = `Basic ${Buffer.from( | ||
`elastic:${config.env.ELASTICSEARCH_PASSWORD}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone know how to add an env var with the elastic
user in? We currently only have one with system_indices_superuser I can't see how they are set!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried config.env.ELASTICSEARCH_USERNAME
?
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @hop-dev |
cy.get('button').contains('Change defaults').click(); | ||
cy.get('[data-test-subj^="advancedStreamOptionsToggle"]').click(); | ||
} | ||
describe('Input package create and edit package policy', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these tests Mark!
> = ({ packageInputStream, packageInfo, customDataset }) => { | ||
const dataStream = customDataset | ||
? { ...packageInputStream.data_stream, dataset: customDataset } | ||
: packageInputStream.data_stream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could extract this ternary in a small function to be reused below, since it's the same code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for just 2 uses I'm going to keep it as is as it's not likely to be used anywhere else in the future
['indexTemplateExists', templateName], | ||
() => | ||
sendRequestForRq({ | ||
path: `/api/index_management/index_templates/${templateName}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is the best way to call another Kibana API directly or use a service/hook from the index management plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just had a go at this but it creates a cyclic dependency in the plugins so I'm going to leave it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
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:
logs-helloworld
index template is not created as integration packages only create index templates on install (custom logs createslogs-log.log
)@custom
or@package
component template to customize, we do not show the pipeline editor.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 it can be added to a deployment using curl:
logs.log