* [Lens] Allow custom number formats on dimensions
* Fix merge issues
* Text and decimal changes from review
* Persist number format across operations
* Respond to review comments
* Change label
* Add persistence
* Fix import
* 2 decimals
* Persist number formatting on drop too
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Adds the first built-in alertType for Kibana alerting, an index threshold alert, and associated HTTP endpoint to generate preview data for it.
addresses the server-side requirements for issue https://github.com/elastic/kibana/issues/53041
* [APM] Update tsconfig.json template in optimization script
The location of the cypress tests has changed, and those files are no longer excluded in the APM type check. This change updates the tsconfig.json template to exclude the new location.
* Update link in readme
* remove obsolete legacy server deps
* licensePreRoutingFactory uses licensing plugin rather than legacy xpack
* move schemas to dir in routes
* use NP license check method for license check
* store license data in plugin for passing to check
* create server plugin files in NP plugin dir
* remove dependency on legacy xpack plugin
* add sample data links first step
* move all server dirs from legacy to np dir
* fix requiredPlugin spaces name and update import routes
* delete unnecessary files and add sample data links
* update license and privilege check tests
* add routeInit types
* Handle setup mode if security is disabled
* Rename so the test actually runs, and fix/add tests
* Use es.js api instead of transport.request
* Revert "Use es.js api instead of transport.request"
This reverts commit ae0e48f8bd.
* Explicitly handle security not enabled
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Infra] Add basic backend for metric threshold alerts
* Define separate fired/recovered action groups
* Allow alerting on arbitrary search fields besides host.name
* Add list and delete endpoioints
* Add groupBy alerts
* Remove extraneous routes and SavedObject logic
* Remove additional SavedObject code
* Remove renotify logic from executor
* Fix action group type
* Fix scheduledActions typecheck
* Fix i18n
* Migrate alerting to new platform
* Add alerting to infra dependencies
* Add comment about future use
* Adjust alert params tm names to sync with UI; default to Entire Infrastructure alert
* Add support for between comparator
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* fixes from comments on previous PR
* replaces any with unknown, adds test to show how optional chaining of array items can result in undefined even though typescript says its not
Before this pr:
Discover, Visualise and Dashboard in setup phase create own state containers which watch for pinned filters, time and refresh interval changes. This watching and state comparisons happen for each plugin separately and not only when a specific app is mounted. So we ended up with a bunch of similar synchronous work which happens every time query services state changes.
After this pr:
Query service exposes observable to watch for changes (state$). Discover, Visualise and Dashboard use this observable for sub url tracking instead of creating its own.
* ui/persisted_state 👉 src/plugins/visualizations
Part of #46926
* fix JEST
* remove sinon from tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add KQL filtering
* Schema updates
* Cursor-based pagination
* Add alert detail GET api
* A little refactoring ;)
* Add KQL filtering
* Render SearchBar that provides suggestions and executes search
* Schema updates
* Cursor-based pagination
* Bug fix with search_after type
* hook up filters, trying date range
* Multi-filter support
* Add rison encoding/decoding on the backend
* Wire up front-end for new GET request
* tiny bug fix
* use redux for state, disable saved queries
* Remove SearchBar UI code
* Remove Search Bar UI Part 2
* test 1
* test 2
* Finish integrating refactor work
* Fix fromIndex calculation
* Address feedback
* More tweaks
* Add some tests, round 1
* Add Direction enum
* Add next and prev urls for alert details
* refactor
* fixes
* No more AlertDataWrapper, less Maybe types
* change @timestamp to type number, redefine AlertListState
* moved pagination classes, moved types to alerts top level
* remove fake data mappings file
* Fix data location
* remove Maybe type, prev and next have type 'string | null'
* fix functional tests
* Create immutable AlertEvent type and an AlertMetadata type
* test updates
* make tests werk
* Address PR feedback
* No Date Immutable
* Fix test params
* Fix test type-check
Co-authored-by: Pedro Jaramillo <peluja1012@gmail.com>
Address all of the requests in #54182.
Also add a story for the Cytoscape component that shows most of these changes.
Fixes#54182.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
* Adds an exact function which allows us to do exact validation rather than allowing arbitrary keys to go through
* Adds a type dependency for parts of validation (gives us feature parity with joi.when())
* Adds several hand spun validations/codecs
* Adds several utilities such as a printer for error validations
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
* chore: move gitignore to the cypress directory
* chore: ignore more test files
* fix: do not check the Loading Message
It seems not relevant to the main purpose of these tests
* chore: use cypres + webpack + cucumber scaffolding
See https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example
* chore: add eslint and prettier for code linting
* feat: convert existing Cypress test into BDD style
* feat: add support for using proper Node version in MacOSX
* chore: use tslint
* chore: use old layout
We are keeping cypress as rootDir to follow project's structure. On the other hand,
having a second cypress directory at the 2nd level is the default structure, as shown
in the examples:
- https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example
- a240054d7f/examples/preprocessors__typescript-webpack
* chore: remove prelint script meanwhile we fix TS lint
* chore: move test results to a specific directory
* chore: rename variable following old code
* chore: remove non-needed lints, as we are going to use kibana build
* chore: import snapshot function from cypress
* chore: add readFile utils back from a bad removal
* chore: change format of JSON spec file
It was automatically changed by tests
* chore: move CI directory to the proper layout in order for Jenkins to work
* chore: store test-results from proper dir on Jenkins
* chore: store artifacts properly on Jenkins
* Fix type issues
* chore: rename test application to e2e (end-to-end)
We are keeping the build system within the test application, isolating dependencies
* docs: reorganise docs for APM UI e2e tests
* fix: Use proper cypress support file
* chore: use existing NPM script for running cypress on CI
* chore: update paths in CI scripts
* docs: document how the CI runs the tests
* chore: use Node 10 for tests
* chore: Use kibana's Node version for tests
* chore: run yarn install
* docs: update docs
* fix: path was wrong
* docs: fix paths and flags used to load data
* docs: elasticsearch fix flag
* docs: Bootstrap kibana before running it
* docs: remove outdated info
* chore: move background steps to the scenario
This would avoid not reading the background when the number of scenarios grows
Co-authored-by: Dario Gieselaar <d.gieselaar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Migrate kbn_top_nav.js to kibana_legacy
* Wrap TopNavMenu into i18nContext
* Move the kbnTopNav directive definition to kibana_legacy and remove ui/kbn_top_nav
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Metrics UI] Add custom metrics interface to Inventory View
* WIP
* Adding workflows for editing custom metrics
* Polishing visual design
* Removing extra text
* Fixing types and return values
* fixing i18n
* Adding aria labels for clearity
* Changing custom group by to match same width as custom metric
* updating integration test for custom metrics
* Fixing type def
* [Maps] add Top term aggregation
* update pew-pew source to handle terms agg
* make helper function for pulling values from bucket
* update terms source
* better join labels
* categoricla meta
* remove unused constant
* remove unused changes
* remove unused constant METRIC_SCHEMA_CONFIG
* update jest expect
* fix auto complete suggestions for top term
* get category autocomplete working with style props from joins
* pluck categorical style meta with real field name
* mock MetricsEditor to fix jest test
* review feedback
* es_agg_utils.js to es_agg_utils.ts
* typing updates
* use composit agg to avoid search.buckets limit
* i18n update and functional test fix
* stop paging through results when request is aborted
* remove unused file
* do not use composite agg when no terms sub-aggregations
* clean up
* pass indexPattern to getValueAggsDsl
* review feedback
* more review feedback
* ts-ignore for untyped imports in tests
* more review feedback
* add bucket.hasOwnProperty check
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Factor our the license checking logic and messaging to common
* Add licensing plugin as a dependency of the APM plugin
* Throw a forbidden error on the server if trying to access the service map routes
* es-archiver call _migrate endpoint instead of creating a migrator
* fix crlf....
* use promise instead of callback accessor
* attempt with disabled authent
* enable security again
* set mapping to dynamic before calling migration endpoint
* rename space data from non-spaced tests
* add documentation on the `rerun` flag
* create router with the `/api/saved_objects` prefix
* add unit test about strict mapping
* add integration test on migrate endpoint
* wrap route handler with handleLegacyErrors
* add remark about limitations of the rerun flag
* Apply suggestions from code review
Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* do not return detailed index result
* add access tag to migrate route
* use /internal prefix for migrate endpoint
* fix integ tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* Refactor the all rules page to be easier to test
* review with Garrett
* bring back utility bar under condition
* fix bugs tags and allow switch to show loading when enable/disable rule
* fix rules selection when trigerring new rules
* fix imports/exports can only use rule_id as learned today
* review I
* Add async search strategy
* Add async search
* Fix async strategy and add tests
* Move types to separate file
* Revert changes to demo search
* Update demo search strategy to use async
* Add cancellation to search strategies
* Add tests
* Simplify async search strategy
* Move loadingCount to search strategy
* Update abort controller library
* Bootstrap
* Abort when the request is aborted
* Add utility and update value suggestions route
* Fix bad merge conflict
* Update tests
* Move to data_enhanced plugin
* Remove bad merge
* Revert switching abort controller libraries
* Revert package.json in lib
* Move to previous abort controller
* Fix test to use fake timers to run debounced handlers
* Revert changes to example plugin
* Fix loading bar not going away when cancelling
* Call getSearchStrategy instead of passing directly
* Add async demo search strategy
* Fix error with setting state
* Update how aborting works
* Fix type checks
* Add test for loading count
* Attempt to fix broken example test
* Revert changes to test
* Fix test
* Update name to camelCase
* Fix failing test
* Don't require data_enhanced in example plugin
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Until these are officially supported in new platform, it's best to not
rely on this behavior. We can achieve roughly the same functionality
with a GET request. Modifies the existing script accordingly, in case
anyone's still using it.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* use links instead of click handlers when switching spaces
* remove unused imports
* remove use of deprecated injectedMetadata service
* simplify SpacesManager constructor
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Partially addresses #50897
updates visualizations plugin
makes visualizations/saved_visualizations np_ready
makes visualizations/embeddable np_ready
remove DefaultVisEditor dependency from visualizations
import AggConfigs directly instead of ui/public
Clean up imports from root. use relative imports
Remove bind directive import
* updates read privileges route tests
* fixes test for 404 when alertsClient is not present, adds new test for catching errors at the route level for prepackaged rules route
* fixes test for happy path on create rules bulk route (missing mock resulted in 200, but was still throwing an error), adds tests for covering case where a rule with a matching rule id is found to have already existed, adds a test covering the case where createRules throws an error and that error is caught in the catch block, and appears in the response
* adds more jest functions to beforeEach to ensure mockImplementation state used by spyOn is not carried over between tests, increases test coverage for create rules route
* updates unit test coverage for delete rules route and bulk delete
* increase unit test coverage for find_rules_route
* add test case to get_prepackaged_rules where findRules throws an error
* adds unit test for missing alertsClient in patch_rules_bulk route
* adds unit test coverage for transform error and pathRules throwing an error on patch rules route
* adds unit test coverage for rule not found, transform error, and readRules throws an error on read_rules_route
* adds unit test coverage for update rules (bulk) routes
* increases unit test coverage for open close signals route
* updates coverage for signals query route
* adds unit tests for rules status route, updates utils test coverage. Removed unreachable code.
* updates test coverage, removes usage of pipes from ndjson to stream conversion and returns arrays of tranformers to be used in createPromiseFromStreams so that unhandled promise rejections can be handled appropriately.
* fixes type errors
* fix bug on transform when rulestatus saved objects array is empty because we are no longer passing in the current status, we are passing in the whole saved object.
* adds unit test for when readRules throws an error inside of get export by object ids
* adds unit tests for catching errors on read rules and fixes property undefined bug in catch block
* removes unused function from utils
* adds the 'else' clause back to the getTupleDuplicateErrorsAndUniqueRules function and adds a test case for when an attempt to import rules with missing ruleIds is made, and the expected outcome.
* Create x-pack/plugins skeleton for upgrade assistant
* Move public folder contents
Move the public folder of Upgrade Assistant and migrate public to use HttpSetup (remove axios)
* Include stylesheets in public
* Move server side out of legacy
Begin migration of Reindex worker to new platform
Move imports around so that it satsifies new platform constraints like not importing
server side code (even types) in client.
* Updated the routes with new dependencies and removed server shim
* Fix router unit tests
* Fix server lib tests
After changing function signatures for the reindex server factory (and others) all
of the tests needed to be revisited and brought in line with the new APIs.
Also used core/server mocks where appropriate
* Clean up types issues
* Fix setting credentials on request header
* Removed the security plugin from Upgrade Assistant
The security plugin is a potential future consumer of the Upgrade Assistant's deprecation feature
and we would therefore not want to create a circular depedency here. We pull in the licensing plugin
rather (as it is less likely that we will depend on that) and use it to determine whether security
is available and enabled.
* Migrate to config to new platform config
xpack.upgrade_assistant.enabled
* Remove unused types
* Fix import issue
* Move upgrade assistant back to Elasticsearch management section
* Update dotfiles
Added elasticsearch ui team as upgrade assistant code owner
Updated i18nrc.json path
* Alphabetical ordering in xpack/i18nrc.json
* Implemented PR feedback
Renamed callCluster -> callAsUser to be more consistent
with platform naming.
Added comment about why we are not using security plugin
directly inside of Upgrade Assistant.
Fixed long path imports and use 'src/core/..' throughout.
Fixed import ordering.
Renamed variables inside of telemetry lib.
* Revert to longer import path
In plugin.ts importing from 'kibana/server' or 'src/core/server'
results in a module not found error.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [ML] Adding filebeat config to file dataviz
* adding extra help text
* removing commented out code
* adding extra blank line to processors section
* cleaning up types
* moving hosts line out of function
* typo in config text
* updating config based on review
* tiny refactor
* translating paths text
When generating test data we refresh excessively, this can fill up the
ES queues and break the tests if we run massive tests. I originally ran
into this with https://github.com/elastic/kibana/pull/58078/ which I
closed due to finding a better approach.
While none of our current tests have the scale to expose this problem,
we certainly will add tests that do later, so we should keep this
change.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
In the NP the routes have already the app name on them. Adding it to
this button made the app name double
/app/metrics/metrics/settings
/app/logs/logs/settings
The button only needs to go to the settings page within the app where
it's being loaded, so we can safely drop the prefix.
Closes#58233
* [Telemetry] Merge OSS and XPack usage collectors
* Create X-Pack collector again
* Separate the license retrieval from the stats
* Fix telemetry tests with new fields
* Use Promise.all to retrieve license and stats at the same time
* Fix moment mock
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes#58079
This is an improved version of #58078
Note, this is a bugfix targeting 7.6.1 . I've decided to open this PR directly against 7.6 in the interest of time. We can forward-port this to 7.x / master later.
This patch improves the handling of timespans with snapshot counts. This feature originally worked, but suffered a regression when we increased the default timespan in the query context to 5m. This means that without this patch the counts you get are the maximum total number of monitors that were down over the past 5m, which is not really that useful.
We now use a scripted metric to always count precisely the number of up/down monitors. On my box this could process 400k summary docs in ~600ms. This should scale as shards are added.
I attempted to keep memory usage relatively slow by using simple maps of strings.
* Bug fix update
update to toggle footer edit controls "off" when locking edit controls.
* Update to toggle
Update to toggle, so that only the "Expression Editor" and tray are hidden when locking controls.
* Update to toggle logic
Added canUserWrite property, and added a condition to ensure the "page" tray still shows once the Expression editor is locked
* Update to property definition
Update to consolidate isWriteable and canUserWrite into one variable instead of two.
* Adding Test (in progress) code
Adding Toolbar test code (so far) - needs to be completed to address nested compononet storybook issue
* Adding issue link
Adding issue link in TODO comments
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Show blank lines instead of N/A on service map popovers
Because RUM agents never show CPU or memory usage, we don't want to always show the metric with N/A. If a metric is null, just hide the lines.
Break up the display and fetching components and update the popover stories to show the list.
Update some types.
* Fix metric typings
Fixes an error where the transforms page would load blank with an expired license. Fixes the issue by adding a type guard. With an expired license, the page now renders again correctly the error message.
* use NP savedObjects and createInternalRepository for usage collection
* fix route doc typo
* update MlTelemetrySavedObject type
* remove fileDataVisualizer routes dependency on legacy es plugin
* update mlTelemetry tests
* remove deprecated use of getSavedObjectsClient
* Remove old route ref, no longer used
* Use core elasticsearch service
* Remove getSavedObjectsRepository, use NP internalRepository
* Update tests and clean up
* Remove unused test vars
* [FieldIcon] Refactor to extend EuiToken and props
* [Add to FieldIcon] Export props
* [Graph] Updated instances of FieldIcon
* [Maps] Update FieldIcon instance
* [Lens] Update FieldIcon usage
* [Discover] Update FieldIcon usage
* Remove comment
* [Lens] Delete unused files
* [Graph] Fix alignments
* More cleanup
* Fixing snaps
* [Lens] Removing method `getColorForDataType`
The method no longer returns the correct color and EuiProgress doesn’t currently support all the colors from the token map. @cchaos will follow up with a PR to address the coloring of the field data charts. Right now they will fallback to pink for progress and default for charts.
* [Maps] Fixing implementations of FieldIcon
* [Graph] Using css utility class instead of custom class
* Snap
* Fix css to use var
* Added UI support for the default action group for Alert Type Model
* Fixed set default on alert type select
* Fixed type check
* Moved setting of default alert type to the server api
* Added default value for actionGroups if it is empty in register alert type functions
* Fixed type check
* Fixed due to comments aed89377b9 Yuliia Naumenko <yuliia.naumenko@elastic.com> Feb 20, 2020 at 12:40 PM
* Renamed defaultActionGroup to defaultActionGroupId
* Fixed failing tests
Adds a Clone action to the transform management list. The action opens the transform wizard with prepopulated configurations based on the selected transform. The fields for the transform name and target index will not be populated to avoid the obvious "already exists" warnings.
PR #57452 added an empty savedObjects plugin with the same name as the
core plugin. Due to the way we were spreading into our context coupled
with the fact that we don't get NP's whitelisting of plugins on legacy,
we were overriding the core plugin here.
If this happens again, we should perhaps whitelist our plugins here.
* add monaco to kbn/ui-shared-deps and load required features for all uses
* forgot to save a change
* remove unused imports
* include a cache buster to counteract issue #58077
* include monaco.ts in ts project
* Move saved_objects to NP
* Update path for imports
* Remove ui/saved_objects
* Update i18n IDs
* Convert test
* Replace Bluebird to Promise; fix unit tests
* Mock openConfirm in test
* Add kibana.json
* Check unit test
* Update unit tests
* Ensure only one element has scroll
Apparently having multiple elements with scroll confuses the
`react-beautiful-dnd` mechanism to determine the position of the
elements. Adding `overflowY` to the app root fixes it.
* Fix upper bound check for log column reordering
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* add unit test for rules api
* add unit test for useFetchIndexPatterns
* fix useFetchIndexPatterns and add unit test for usePersistRule
* add more unit test for container/rules
* review
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Adds toggle to open links in new tab within markdown element
* Updating test for markdown function
* Switch to using Markdown Component
* Update ui.ts
Update to change toggle verbiage per Ryan's request, and reuse the Kibana Markdown per Corey's help and recommendation. Still working on updating the styles (consulting Ryan)
* Update toggle.js
Update to prevent text for "Open links in new tab from wrapping" - the example from the horizontal bar chart is quite differently, and reads from "axisConfig" - when I changed the argType to "axisConfig", the layout was the same, but I'll need some input on which specific styles to add to the "ToggleArgInput" - I think this is where the style updates need to occur to get the toggle to stay on the same line, but may be wrong.
* Update ui.ts
Update to original message string per Ryan's feedback, now that there is no wrapping
* Update to UI styles per Ryan's feedback
* updating message per Ryan's request
* Update ui.ts
update to fix internationalization issues
Co-authored-by: Corey Robertson <crob611@gmail.com>
This PR adds transform bootstrapping to the functional test transform.api service and demonstrates the usage in a new cloning test file, which will be completed as part of the transform cloning PR.
* Remove elasticsearch setup service from route deps
Removed the callWithRequestFactory entirely. This setup was introducing a pattern where
route handlers were not pulling the ES client fromt the route handler context. For this
refactor we need to extend the route handler context with watcher specific client actions
and so we also extend RequestHandlerContext globally.
In this commit we also update the types for params, query and body schema on each route to avoid
using any everwhere.
* Add generic types to license wrapper
Adding <P, Q, B> to the license wrapper made it a transparent
wrapper from a type perspective so we can remove the need to
eplicitly set RequestHandler<P, Q, B> on the handler.
Also cleaned up a variable name "response" -> "searchResults"
Also removed elasticsearch from the RouteDependencies type.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Moved all of the show/hide toggles outside of ordered lists.
* Fixed styling issues for indice list.
* Fixed i10n tag that I accidentally changed.
* Added component to show/hide indices.
* Abstracted out some of the common parts of the Show Hide component and implemented the general component in the pages. Also made conditional for the i18n tags.
* Fixed changes per comments. Restored <EuiText> to fix the issue with the bullet points. Updated the i18n tags to be more generic. Created 2 components for formatted message.
* Fixed internalization issues..
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Closes @56832 Migrates uses of the saved objects client to the internal
and context scoped clients exposed in the new platform core setup
* moves apm server, common, and typings dirs to the new plugin directory
* fixes path imports and type errors
* fixes some lint errors
* fixes CI failure. Use internal saved objects client like before.
* uses the context-scoped saved objects client for saving runtime APM indices,
and uses the internal saved objects client when creating apm index
pattern, so that any user who navigates to apm can trigger it
* fixes the type check error by updating import paths
* renamed files and directories to snake_case to pass scripts/check_file_casing
* rebase fixes and commit filename case changes
* moves get_indices_privileges.ts out of legacy path
* Move maps telemetry to NP. Some clean-up, some ts conversion
* Update naming & org to be more in-line with guidelines
* Get TELEMETRY_TYPE from constants
* Ignore ts error importing from js file
* Set original array type passed into the function to array of ILayerTypeCount. Set return type on reduce function
* Remove unneeded 'any' types where used. Add in interfaces for map & index pattern saved objects
* Review feedback. Add layer, source, map saved object types and use
* Review feedback. Updates based on type check
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Create edit node component
* Accept EditNodeComponent
* Switch to old header
* test
* Remove iconType
* Remove isEditTitle
* Move translations
* Delete header_page_new component
* Move editable title component to different folder
* Update jest snapshot
* Rename prop
* Make EditableTitleComponent more generic
* useCallback instead of inline functions in props
* Hardcode titles
* Move UI state inside EditableTitleComponent
* Seperate title's tests
* Create tests for EditableTitleComponent
* useCallbacks on EditableTitle component
* Create translation for aria-label in edit icon
* Check if switched to edit mode after pressing submit
* Test title when canceled
Co-authored-by: patrykkopycinski <contact@patrykkopycinski.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [APM] Don’t include UI filters when fetching transaction
When fetching an error sample, the related transaction is also fetched. This transaction should not be filtered by ui filters
* Fix snapshot
* Update term mock term used for ui filter
* added pagination on alert instances page
* extracted default page size to a constant for alerting UI as a whole
* Fix test failure
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
* Added unit tests for detection engine import_rules_route and moved out small portion of import_rules_route into a util to be unit tested as well.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* get indices privileges from has_privileges api
* changing to ES privileges api
* changing missing permission page
* always show dimiss button
* always show dimiss button
* changing message and unit test
* fixing react warning message
* [APM] Remove PaginationContainer
Removing the old pagination from the trace summary title.
* [APM] Removing PaginationContainer component ref
* [APM] Change the vertical alignment to center
* [APM] Leaving the EuiPagination component in place
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR runs all functional ML and transform tests (except existing security and feature controls tests) as a poweruser instead of the default superuser.
* [Fleet] Add permissions checks (#48143)
* Add permissions check to API
* Add permissions check to UI
* Undo changes
* Update index.tsx
* Update enroll.ts
* add API tests for permissions
* add fleet to trial license check
* Agent enrollment flyout (#48173)
* Fix agent table empty prompt
* First pass at agent enrollment flyout with placeholders
* Move enrollment commands into separate file and enable templated vars
* Use default double braces for templating
* [Fleet] unenroll agent from the details page (#48286)
* [Fleet] add API to unenroll agents
* [Fleet] return a 403 for inactive agent
* [Fleet] UI to unenroll an agent from the detail page
* [Fleet] Filter inactive agent from the listing (#48466)
* [Fleet] Expose policy change method from fleet plugins (#48562)
* [IM] add screenshot detail view and image endpoint (#48149)
* add api endpoint to handle images
* #47978 add screenshots component with single image
* update padding around screenshot
* import existing API_ROOT
* move ImageRequestParams interface and fix type
* pass the content-type through and add test
* fix ie11 issues with nested flex items, change radius to use eui variable
* use eui variables for padding
* add aria label and image description
* [IM] Use EPM in variables & types (#48453)
* IntegrationsManager -> EPM
* integrationsManager -> epm
* [iI]ntegration -> [pP]ackage. Update tests.
* Don't rename integrations registry URL.
* Update i18n key in x-pack/.i18nrc.json
* Update path to functional test config
* Add epm to recently re-enabled privileges test
* Update two values recently added in main feature branch
* Move/update screenshot tests
* [Fleet] Allow to edit metadata (#48682)
* [Fleet] Add a toggle to show Inactive users (#48917)
* Multiselect to unenroll agents (#48852)
* Initial pass at multiselect to unenroll agents
* Adjust loading state button text
* Fix types; use unenroll provider in agent details
* Update select all agents kuery
* Prevent inactive agents from being selected
* [Fleet] Fix privilege tests after merge of master (#49118)
* [Fleet] Temporary use the elastic user as kibana user to be able to create API keys (#49037)
* [EPM] Fix package version requirement structure (#49172)
* [EPM] Fix package version requirement structure
In https://github.com/elastic/integrations-registry/pull/134 the API structure changes. This PR should adjust to the new structure.
* Update x-pack/legacy/plugins/integrations_manager/common/types.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/integrations_manager/common/types.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/integrations_manager/common/types.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/integrations_manager/common/types.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* [EPM] 48799 markdown into readme (#49180)
* add markdown component and fetch markdown
* add package.json file with react-markdown dependency
* add markdown renderers, use readme path
* remove description and rename to readme
* remove dropshadow on images
* add loading component for readme request
* comment on loading components
* Add command to spin up a mock server for ingest endpoints (#49259)
* 48654 files from registry (#49580)
* Replace image path/handler with generic file one
* Incorporate tests from #48696
* [EPM] Make screenshot image captions optional (#48912)
* Make screenshot image captions optional
* fix typos, type, rename variable
* [EPM] update to layout and and spacing (#49413)
* fix height and color issues
* make container full height
* remove panels per design update and make white bg color
* adjust spacing
* check for empty response
* fix eslint issue
* fix layout in safari
* remove unused component
* [EPM] Rename registry url to new path (#49598)
The integrations-registry repository was renamed to package-registry and with it also all the assets inside. The url under which the service is served will also be changed (not done yet). As soon as this is done, this PR should be merged.
* [EPM] rewrite relative image paths (#49637)
* rewrite relative image paths
* remove EuiImage, use transformImageUri, clean up
* [EPM] Use NP registerFeature (#49625)
* Use NP registerFeature
* Added features plugin to deps. Used it in setup.
Moved `registerFeature` from `init` to plugin setup.
Moved rest of init into `createSetupShim`. `init` is now
```ts
init(server: Legacy.Server) {
const { initializerContext, coreSetup, pluginsSetup } = createSetupShim(server);
new Plugin(initializerContext).setup(coreSetup, pluginsSetup);
},
```
Moved feature (argument for `registerFeature`) to separate file.
Renamed plugin-specific `CoreSetup` to `EPMCoreSetup`
* [Fleet] Filter agents list table by policy name (#49968)
* Add policies lib and adapters
* Fix mock server headers
* Initial pass at policy filter dropdown by manipulating kuery string
* Adjust spec return values
* Use separate state for policy filter; fix typings and disable some eslint rules
* Fix react-related eslint errors
/Users/jfsiii/work/kibana/x-pack/legacy/plugins/integrations_manager/public/hooks/use_links.tsx
26:20 error React Hook "useCore" is called in function "addBasePath" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
/Users/jfsiii/work/kibana/x-pack/legacy/plugins/integrations_manager/public/screens/detail/readme.tsx
26:35 error React Hook "useLinks" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function react-hooks/rules-of-hooks
39:6 error React Hook useEffect has a missing dependency: 'readmePath'. Either include it or remove the dependency array react-hooks/exhaustive-deps
/Users/jfsiii/work/kibana/x-pack/legacy/plugins/integrations_manager/public/screens/home/search_results.tsx
27:42 error `"` can be escaped with `"`, `“`, `"`, `”` react/no-unescaped-entities
27:49 error `"` can be escaped with `"`, `“`, `"`, `”` react/no-unescaped-entities
✖ 5 problems (5 errors, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
* Remove ui/* imports (#50094)
* [Fleet] Use ES api keys for agent authentication (#49639)
* add collapsible read me component (#49990)
* add collapsible read me component
* Update x-pack/legacy/plugins/integrations_manager/public/components/content_collapse.tsx
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* add empty array as second argument to useLayoutEffect
* [EPM] Make API consistent for package installation and removal (#48745)
* Adjust type names
* Install package in one go.
* Integration -> Package
* Really install all known assets
* Remove ingest pipelines on package deletion.
* [EPM] Replace image paths/handlers with generic ones for file (#48688)
* Replace image path/handler with generic file one
* Incorporate tests from #48696
* Fix merge error.
* Type tuning
* Adjust types
* Remove asset types from routes altogether
* Add timelion-sheet back to types.
* Respond with full package info to install/delete
* Be specific in return type.
* Keep installAssets() as separate step
* [EPM] Add unit tests for pathParts (#50279)
* [EPM] Add unit tests for pathParts
This adds unit tests for the pathParts function. I initially wanted to enhance the function to also support paths like `iptables-1.0.4/dataset/log/elasticsearch/ingest-pipeline/pipeline.json`. But without unit tests it was hard for me to make the changes.
This adds a unit test driven by a table so we can extend it later. Adding these tests also helps me to better understand the code.
As a note for myself, the command to run these tests is:
```
node scripts/jest --watch ./legacy/plugins/integrations_manager/server/registry/index.test.ts
```
* Update docs for merging master into feature branch (#50396)
* [Fleet] Remove in memory repository (#50431)
* [EPM] Documentation of HTTP routes & TS types for Ingest (#48798)
* Add beginning models and two routes for Ingest
* Update types & models per discussion w/Ruflin
Also reviewed data structures listed at https://docs.google.com/document/d/1IBR3f9dpHqJmXYEdg06WV34KSMd3g5k4aMGa4jde_Eg/edit#
* Update: /policies always returns array. /policy returns single policy
* Add pagination for /policy & /datasources. Uses per_page & page params
* Add API metadata. Standardize policy_id param name.
* Update descriptions to match Google Doc. Move use case to Policy.
Disabled the '@typescript-eslint/array-type' rule because it was going around in circles. It didn't like Datasource[] or Array<Datasource>
* Return to initial TS annotation for Arrays
Remove the line disabling @typescript-eslint/array-type now that it's behaving normally again 🤷
* [EPM] Add directory structure for server/lib. (#50469)
* Add directory structure for server/lib.
* 'tests' seems to be more common than 'test'
* Make CI happy
* [EPM] Add basic documentation directory (#50478)
* [EPM] Add basic documentation directory
Having the doc directory around allows us to easily add docs from here on to document how EPM works.
To run the docs build, use the following command from the kibana directory:
```
../docs/build_docs --doc docs/epm/index.asciidoc --open
```
The above assumes that docs (https://github.com/elastic/docs) are checked out in the same directory as Kibana.
With this change, the EPM docs build is not included yet in the overall docs build. For this adjustments to https://github.com/elastic/docs/blob/master/conf.yaml must be made.
* [EPM] Add basic index template (#50471)
This PR adds the very basic index template we will use for the packages. It contains all the basic settings and some examples. The examples will be remove as soon as we have an actual implementation with packages but for now is convenient to see if it is a valid package.
This code is put into the lib directory as it does not tie directly into any handlers.
It also adds an functional tests for loading a template. This means we have a way to check if a template is valid in Elasticsearch. Based on this we can check in the future all our generated templates for validity with Elasticsearch.
To run the functional test, go to the Kibana x-pack directory. Start the first command:
```
node scripts/functional_tests_server.js --config test/epm_api_integration/config.ts
```
Keep the above running and switch to an other Terminal. Now run:
```
node scripts/functional_test_runner.js --config x-pack/test/epm_api_integration/config.ts
```
* 40752 rewrite ingest pipeline (#50627)
* Add directory structure for server/lib.
* 'tests' seems to be more common than 'test'
* Make CI happy
* Implement pipeline rewriting.
* Add more testcases
* For posterity (comment change)
* Allow beats-style template delimiters
* Be more succinct
* Document better
* Replace AssetType enum with union type (#50696)
See https://github.com/elastic/kibana/pull/50609#discussion_r346080439
Discussed in Slack and agree to revert for now. Can track down the issues & restore later
* Remove unnecessary await if we can return the promise (#50329)
* Fix whitespace per figma comments. Closes#47348 (#47350)
* Add fix & comment for TS 3.7.2 regression
* [EPM] cleanup assets, filter assets for those currently supported (#50609)
* cleanup assets, filter assets for those currently supported
* removed unused type
* fix type
* add comment for better type
* change type name to be more descriptive
* hardcode image width for ie11 (#49796)
* hardcode image width for ie11
* eslint
* improve comment
* add maxWidth
* [EPM] useKibana hook & render in plugin.start (#50110)
* plugin.start now does reactdom.render vs returning react element
export plugin function from public/index
* Move setClient call from plugin.start to plugin.setup
* Use `useUiSetting$` from `useKibana` hooks
* Fix broken app due to bad hooks usage
Can't use useKibana outside a React component.
Reverting to prior approach since it's still NP. Can revisit context usage in a followup PR
* [EPM] Install package from detail view on button click (#50735)
* Support basic "click button -> show spinner -> installed" install flow
* Remove incorrect comments. Add TS return types to data functions.
* [EPM] Use NP feature_catalogue.register (#50108)
* Use NP feature_catalogue.register
* Use type from NP plugin
* fix linting
* fix types
* fix headers in Fleet
* skipping test due to ES param change
* Revert "skipping test due to ES param change"
This reverts commit d05f20decf.
* remove type field
* remove unused import
* [EPM] Final(?) update from integrations_manager -> EPM (#50976)
* Update (all remaining?) references from integrations_manager to EPM
* Update path in i18n file
* [EPM] update compatibility section (#50975)
* change min max version to single range value
* add elastic stack icon and change text
* remove badge from version and use code font
* remove euistyled
* add back version component lost in merge
* remove euiStyled
* remove old file
* Restore RequirementVersionRange type
* Disable test for elasticsearch username.
Temporary work around until we know how the stack wants to add the permissions we need. Either adding to the kibana user or creating a new user.
* Revert "Disable test for elasticsearch username."
This reverts commit f1020e4eab.
* Disable test for elasticsearch username.
Temporary work around until we know how the stack wants to add the permissions we need. Either adding to the kibana user or creating a new user.
* Fix EPM typing issues in register feature
* Fix typings after master merge
* [EPM] CI fixes (#51284)
* Initialize es in test.
* Add it(), no es.init()
* Clean up.
* [EPM] add confirmation modal (#51172)
* add confirmation modal, move install state to Header
* update callout to use title
* move components only used in detail view to detail dir
* use better variable names
* update to more descriptive variable names
* Restore prior response vaulues for install & delete package (#51252)
Discussed this with @skh https://github.com/elastic/kibana/pull/51112#commitcomment-35961413 & https://github.com/elastic/kibana/pull/51112#commitcomment-35970664 as well as in a video call
Also added some TS type annotations for data fetching functions to make the contracts more explicit
* [EPM] /package API only lists installable assets. Restore enums. (#51414)
* API only shows installable assets. Server types to own file. Restore enums
* Fix type imports
* Only return installable asset types (kibana for now)
* server/types now only has code from hapi which shouldn't go to client
* Add more restricted TS types to DisplayAssets object
* Flip order of arguments to Extract
In these cases it still works the same, but looking at https://www.typescriptlang.org/docs/handbook/advanced-types.html the signature is
`Extract<T, U>` - Extract from `T` those types that are assignable to `U`
so the larger set should be first
* [Fleet] Enrollment api key UI (#51495)
* Make button pretty in dark mode as well. (#51610)
* [EPM] Add docs entry about registryUrl config (#51697)
This documentation is at the moment mainly for internal use. I found myself searching for this URL several times in the code or PRs so I thought I rather add it to the docs for now.
* [EPM] Remove encoding of Kibana objects as not needed anymore
* [Fleet] Move agent status server side and API to get aggregated status for a policy (#51673)
* [EPM] Add basic docs around install/delete API endpoint (#51728)
This is mainly for internal usage at the moment to look up.
* Ingest/policy (#51741)
* wip policy
* tweaks
* tweaks
* FIX TYPOS
* WIP move policy => agent config conversion to fleet, WIP policy changed method
* fix tests and bugs
* updates tests and snaps
* more fixes
* use AGENT_POLLING_INTERVAL
* cleanup and fix some formatting
* Update x-pack/legacy/plugins/ingest/server/libs/datasources.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/ingest/server/libs/datasources.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/ingest/server/libs/outputs.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* Update x-pack/legacy/plugins/fleet/server/libs/policy.ts
Co-Authored-By: John Schulz <github.com@jfsiii.org>
* fix things broken by PR review suggestions
* remove unused field
* fix types
* fix mappings
* add datasource mappings
* Fix mappings and remove get full policy from checkin
* Fix ingest api integration tests
* run es-lint to fix fleet
* Fix typescript issues
* [EPM] Track package install state and add toast notification (#51734)
* add notifications from core to plugin
* add package install state hook
* fix type error
* use toMountPoint helper to add jsx to notification
* add warning notification to failed install
* make notifications dependency explicit prop
* move PackageInstall provider lower
* add comment about InstallStatus type overlapping InstallationStatus
* use InstallStatus type in InstallationButton component
* fix type
* [Ingest] Adds support for a working default output (#51841)
* aadding config
* add working settings to the default output
* remove default username and password
* update libs
* [EPM] Add basics for creating the ILM setup (#50474)
This contains the basic objects to setup ILM
* Create index and alias with a write index
* Get the policy
The code does not contain any functional tests yet as it is still open on how to do it best. I suggest to get this in as a foundation and then iterate on top of it.
* [EPM] Add datasource (ingest pipeline) from package (#51851)
## Summary
This mixes a few concerns but I think it's worth it to show the parts working together.
Take a look at the individual commits for a better separation of features.
This adds
- the `/datasource/install/{pkgkey}` endpoint which installs ingest pipelines from a package into ES and saves a reference to them in the EPM state Saved Object
- Connects the "Add datasource" button in the successful installation Toast to the new API
- Adds a toast notification to inform the user the datasource was added correctly
- Adds a "Delete Package" button on the details page so we can uninstall a package while we're waiting for the separate view which allows deletes
- b99eda6 Pushes logic that was in the detail view into `InstallationButton`. This consolidates the logic in one component (or one component & the existing hook) and, iiic, means we can put `<InstallationButton package={...} />` on any view and get the same behavior
I'm marking this as a normal PR so people can merge if they wish
![add-datasource-delete-package-small](https://user-images.githubusercontent.com/57655/69775686-7fb39280-1167-11ea-8d41-e2b8a02252a1.gif)
* [EPM] Add basic processing of fields.yml file (#51148)
The fields.yml is used to generate the Elasticsearch template and Kibana index pattern. This PR adds a very basic implementation of processing the fields.yml and then create an Elasticsearch template out of it. The only fields that are supported at the moment are keyword fields, more will be added as a follow up.
The testing was implemented with a golden file. The output from the method is compared to a json file. If the input is changed or the method is changed, it is possible to regenerate the files with the `-generate` flag as following:
```
node scripts/jest ./legacy/plugins/epm/server/lib/template/template.test.ts -generate
```
This will allow us to quickly test many inputs / outputs in the future, make adjustments to the existing files and generate the new outputs. We then can compare it in the diff it the changes make sense.
* [EPM] Create basic implementation to merge input template and dataset manifest (#51803)
* [EPM] Create basic implementation to merge input template and dataset manifest
With this code it is possible to take an input template for the agent and merge it with the config variables from the dataset manifest file. Currently only the name and the default value are merged. Later on we must implement to be able to pass user configured variables to it and make decision based on OS selection.
Closing https://github.com/elastic/kibana/issues/51794
* [EPM] Refactoring of lib structure (#51885)
This refactors the structure of lib. As so far all the lib parts are related to assets in the package, it is organised the same way with the same structure. Each directory has its own tests directory if it needs one. This makes it possible to (almost) not need relative paths for tests.
* [EPM] Allow to read files from fields directory (#51958)
This change allows to also extract files from the `fields` directory. Previously this was not possible because it always assumed a service must be there.
* [EPM] Install Elasticsearch Index Template for data source (#51878)
This installs the Elasticsearch index template for each dataset in a package. For now the names are hardcoded based on package key and dataset name but will be more dynamic later on when we pass the full dataset information.
The dataset extractions is a bit "hacky" at the moment and we should get a full implementation of dataset at a later stage and replace this code.
* [Fleet] Policy list, details, create, edit UIs (#51950)
* Set up simple policies list view
* Adjust spec to return single policy
* Set up simple policy details page
* Add demo stats/chart to policy details
* Add description string
* Initial setup of policy form and create policy UI
* Policy create/edit form; integrate policy list api
* Integrate create policy api
* Integrate policy detail, agent status, and policy edit APIs; adjust policy list api integration in agent enrollment
* Fix edit policy mock meta
* Fix policy list search bar
* PR and linting fixes; use typings from ingest plugin
* Fix i18n
* [EPM] Add datasource saved object type (#51871)
## Summary
This PR makes a few assumptions, and contains a lot of refactoring. It might be beneficial to look at the resulting directory structure under `server` first to get the (new) big picture.
Assumptions:
- our API deals with several concerns, for now these are packages and datasources
- we manage our own HTTP API endpoints for these concerns (in particular, don't use the ingest plugin for that)
- we manage (for now) the Kibana saved object in which datasources are saved. importing and calling methods from the ingest plugin to do that down the road will (hopefully) be a manageable change
This led to the following decisions:
- the code is separated into subdirectories by concern, containing all the route handlers and tightly coupled code
- for now, these directories are in `server/packages` and `server/datasources`. I'm tempted to move them into `server/api/{packages,datasources}` but wanted to limit the amount of refactoring in one PR
- shared code lives in `server/lib`
- some code from `server/packages` has been almost duplicated to handle saving to Datasource saved objects, some has been refactored and is used from both places. The deduplication needs further improvement
- maybe `server/registry` should also move under `server/lib` (but see above, I'm trying to not move everything around all at once)
Testing:
* Please note that this is a breaking change because the saved object type for package information
has also been renamed. You'll need to start with a fresh `.kibana-*` index. Restarting `yarn es snapshot` (withouth specifying a data directory) should do the trick.
* Package installation should still work, e.g. with a GET request to `http://localhost:5601/api/epm/package/coredns-1.0.1`. The saved objects for packages can be inspected with a GET request to `http://localhost:5601/api/saved_objects/epm-package/$PKG_KEY`, e.g. `http://localhost:5601/api/saved_objects/epm-package/coredns-1.0.1`
* Datasource creation should still work, e.g. with a GET request to `http://localhost:5601/api/epm/datasource/install/coredns-1.0.1`. The saved objects for datasources can be inspected with a GET to `http://localhost:5601/api/saved_objects/epm-datasource/$PKG_KEY`, e.g. `http://localhost:5601/api/saved_objects/epm-datasource/coredns-1.0.1`
* [Fleet] Expose policy during agent checkin (#51968)
* [EPM] Add /epr prefix to the tar.gz download path (#51881)
The registry slightly changed the .tar.gz path because of download stats reason. This adjusts for it. See https://github.com/elastic/package-registry/pull/169
* [EPM] Move template installation to lib and add asset helper (#52049)
* [EPM] Move template installation to lib and add asset helper
All the logic related to the installation of the templates for a package should be inside the template library folder. This moves the logic into this folder.
A few refactorings were made to simplify installation:
* Introduction of DataSet interface: This interface is needed to extract the data sets inside a package and install one template per data set.
* Pass package instead of package key to installation process: Passing the package instead of the package key means fetching of package information is decoupled from the installation process and abstracted. This separates the two concerns and should simplify testing.
* getAsssets method: The getAssets methods works on top of the package object to extract asset paths. It is inspired by get_objects methods but supports passing a package and a dataset.
Currently one problem with testing that exists is that to fetch the content of an asset is not decoupled yet.
* [EPM] Reduce data source to one type (#52061)
Between Fleet / Ingest / EPM there had been several interface definitions of Datasource and the related types. This reduces it to one place for the definition. The same applies to the policy definition.
The goal of this is that from now on we all rely on the same definition. If we make changes, we make them in all parts of the code.
In this PR is only the minimal change needed to get us all on one interface. Further changes will be needed that we all rely on the same saved objects etc.
* add export command
* revert 2 more files to rely on export
* revert imports
* Fix types for Datasource Saved Object
* merge in master
* fix type check
* Run VSCode's organize imports on EPM files (#52234)
Learned about it on Slack from https://twitter.com/ryanchenkie/status/1201883268527927301
Blog at https://code.visualstudio.com/updates/v1_23#_run-code-actions-on-save
Basically does the order we've been loosely following (3rd party, then relative) & alphabetic by location and variable name.
It's not customizable but it's reasonable and, afaict, consistent.
* [EPM] More realistic datasource SO. Error if package not installed. (#52229)
* Move cache 'hack' into getAssetsData
* p -> pkg. package is reserved. pkgkey is used in many places
* Remove unnecessary type cast
* Clarify reasons behind asset path manipulation
* Return the Datasource; not the Saved Object.
* Use real values from package in fake datasource SO
* Error if /datasource/install before /package/install
```
> curl --user elastic:changeme localhost:5601/api/epm/datasource/install/coredns-1.0.1
{
"statusCode": 403,
"error": "Forbidden",
"message": "coredns-1.0.1 is not installed"
}
> curl --user elastic:changeme localhost:5601/api/epm/install/coredns-1.0.1
[
{
"id": "53aa1f70-443e-11e9-8548-ab7fbe04f038",
"type": "dashboard"
},
{
"id": "Metricbeat-CoreDNS-Dashboard-ecs",
"type": "dashboard"
},
{
"id": "75743f70-443c-11e9-8548-ab7fbe04f038",
"type": "visualization"
},
{
"id": "36e08510-53c4-11e9-b466-9be470bbd327-ecs",
"type": "visualization"
},
{
"id": "277fc650-67a9-11e9-a534-715561d0bf42",
"type": "visualization"
},
{
"id": "cfde7fb0-443d-11e9-8548-ab7fbe04f038",
"type": "visualization"
},
{
"id": "a19df590-53c4-11e9-b466-9be470bbd327-ecs",
"type": "visualization"
},
{
"id": "a58345f0-7298-11e9-b0d0-414c3011ddbb",
"type": "visualization"
},
{
"id": "9dc640e0-4432-11e9-8548-ab7fbe04f038",
"type": "visualization"
},
{
"id": "3ad75810-4429-11e9-8548-ab7fbe04f038",
"type": "visualization"
},
{
"id": "57c74300-7308-11e9-b0d0-414c3011ddbb",
"type": "visualization"
},
{
"id": "27da53f0-53d5-11e9-b466-9be470bbd327-ecs",
"type": "visualization"
},
{
"id": "86177430-728d-11e9-b0d0-414c3011ddbb",
"type": "visualization"
},
{
"id": "4804eaa0-7315-11e9-b0d0-414c3011ddbb",
"type": "visualization"
}
]
> curl --user elastic:changeme localhost:5601/api/epm/datasource/install/coredns-1.0.1
[
{
"id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_plaintext_json",
"type": "ingest-pipeline"
},
{
"id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_json_json",
"type": "ingest-pipeline"
},
{
"id": "coredns_1_0_1_dataset_log_elasticsearch_ingest_pipeline_pipeline_entry_json",
"type": "ingest-pipeline"
}
]
```
* fix duplicated imports
* [EPM] Move golden files generation over to jest snapshot (#52203)
* [EPM] Move golden files generation over to jest snapshot
I initially used my own implementation to write the generated files. It runs out jest has a feature to write snapshots which simplifies the code a lot.
I added a loop with an additional test file so in the future we can just keep adding test files without having to modify the test code.
To updated the snapshots, the param `-u` has to be used:
```
node scripts/jest legacy/plugins/epm/server/lib/fields/field.test.ts -u
```
* [EPM] Create metrics-* and logs-* Kibana index pattern (#52277)
This creates the very basic Kibana index patterns metrics-* and logs-* for Kibana. At the moment it is overwritten every time. We need to change this in the future to take the fields from all installed data sources and regenerate it.
* [EPM] Create helper for elasticsearch asset names (#52265)
Most of the Elasticsearch assets have the same base name. This creates a helper to get the base name for the assets. In case we decide to change the base name in the future, we can change it in one place.
* fix tests and destructing
* [EPM] Update Registry types. Prevent errors installing certain datasources. (#52285)
* Update RegistryPackage type
* Use download key from EPR to fetch archive
* Fix errors caused by correcting the Registry types.
The issues were largely that some Registry types like `title, `datasets` and `assets` where marked as required, but are actually optional. This highlighted area in the code were we relied on them always being present.
We added to the issue by wrapping Registry types in `Required` which made those items which were correctly listed as optional, required for EPM code. Updated EPM types to reflect the largely pass-through nature of the EPM types.
There are two properties which we ensure are in every EPM response, those were put into their own (unexported) type.
Confirm by trying to add a datasource to a package which has no datasources, like apache-1.0.1 or system-2.0.1. In `feature-ingest` and the earlier version of this PR, the `/datasource/install` call returns a 500. In this PR it succeeds.
* [EPM] Add setup of default ILM policies (#52272)
This creates two ILM policies: logs-default and metrics-default. These are the default ILM policies used. Currently the policy content is hardcoded in the code but should be fetched from the base package in the future. The setup happens as part of the datasource installation. When a data source is installed it is a good time to check if the assets are there but we might extract this to a better place in the future.
* [EPM] 52075 add data source first page (#52320)
* Update RegistryPackage type
* add first page of add data source
* fix for ie11 flex min width bug
* remove toDetailViewRelative
* remove unneeded spread
* Update TS type names for EPR search results (#52512)
* `RegistryList -> RegistrySearchResults`
* `RegistryListItem -> RegistrySearchResult`
* Restore import sort order from #52234 (#52548)
Many of the changes from #52234 were lost. Presumably due to PR(s) merging which were based on branches which had the previous unsorted order.
* [EPM] Replace wildcard export (#52554)
* PackageNotInstalledError -> packages/index.ts
* pkgToPkgKey -> registry/index.ts (will convert existing `${name}-${version}` instances later)
* Replace export * from packages.
There's an argument that the import sites should be updated to import from `packages/get`, `packages/install`, etc but that can wait for a later PR.
* [EPM] Reduce usage of epm-package SavedObject (#52576)
* Delete existing Installation type. Rename InstallationAttributes to Installation
* Reduce usage of EPM SO. Add getInstallation().
Replaced two calls of getInstallationObject() with getInstallation().
Two less places with knowledge of SO internals.
Lots of potential improvements for EPM TS types remain (refactoring/removing Installable, etc), but this is a good incremental step, IMO
* [EPM] Fix missing export link (#52628)
Without it, things break. I am surprised CI did not catch this.
* [EPM] Cleanup ILM loading (#52632)
Before the check for the ILM policy to exist triggered an exception. With this change it is a normal response also if the policy does not exist yet.
A follow up issue will be created in Elasticsearch to get a HEAD request for this available.
* [EPM] Switch to staging URL for registry (#52626)
The old cluster with the registry will be removed as soon as this is merged.
* [EPM] Use Dataset interface to generate template (#52255)
This will make sure we have to pass much feature params and can fully rely on the datasource object to create names for assets.
* [Fleet] Use agent events to compute agent health (#52513)
* [EPM] Data source integration tests (#52542)
* Add fixtures for data source integration test.
* Move test setup to beforeEach
* Add test for datasource creation
* Handle pipelines in yml format.
* Make integration test for adding a data source pass.
* Use EPR staging URL with CDN. (#52776)
See https://github.com/elastic/kibana/pull/52626#pullrequestreview-330622868
* [EPM] Add Data Source page updates (#52705)
* remove dupe type RegistryPackage
* change switches to checkboxes, use datasets to create checkboxes, add some local form state
* update types
* [EPM] redirect after package install (#52771)
* add callback after successful installation and redirect
* add temp data sources tab content to access add data source page
* remove assets tab for mvp
* hide data sources link and redirect from data sources tab if package not installed
* change callback name
* remove commented out assets logic
* add redirect to hook
* fix type
* Use ingest datasource api (#52964)
Incremental change. Uses HTTP API for datasource creation. Will do follow-up PR which uses JS function instead
* Remove duplicate fetchInfo & installTemplates
I think this was from a bad merge, but pretty sure we don't want these functions called twice in the same function
* WIP. Pushing so others can see
* Improve correctness/flexibility of absolute URL
* Disable datasource test & template installation
* [Ingest] Data source APIs (#52448)
* Clean up ingest imports and remove unneeded mock_spec files
* Initial pass at datasources lib and API endpoints
* Add add/remove datasource to/from policy API endpoints
* Add datasource contract tests and related policy contract tests; update snapshots
* Fix tests
* Fix tests again
* Fix tests 3
* Adjust routes, PR feedback
* modify epm createDatasource endpoint to use user data (#52971)
* change epm/datasource/install/{pkg} to POST, send user data to endpoint, install pipelines and templates based on user selected datasets
* change test to post for installing a datasource
* change some names and types around
* delete request.headers['transfer-encoding'] being passed through from epm request
* [EPM] Don't share CreateFakeDatasource type (#53068)
It's not shared between client & server so it doesn't need to be in common. Also, it imports server code which would try to bring server types to the client. It's types so they're compiled away but it's important to keep common to what's truly common. Breaking this separation is why we thought enums broke the client. A lint rule just landed in master to prevent this.
* [EPM] Index template generation fixes (#53104)
* Only add keyword type field to mappings.
* Index template installation
* Handle empty fields definition files
* Re-enable index template installation
* [Fleet] Assign/Unassign data source from policy UI (#53058)
* Add index files to export various modules; normalize imports
* Clean up unused files; extract datasources table component from policy details page
* Expose http client to frontend libs; remove unused types; import ES UI's useRequest lib
* Adjust shape of rest api adapter interface to better match with rest of kibana; remove unused node adapter; change per_page param to perPage in agent events route
* Initial pass at assign data sources flyout
* Initial pass at unassigning data sources from policy
* Make data sources table searchable by package values
* Fix enrollment key lib for rest adapter param changes
* Fix imports and types
* `yarn.lock` changes after bootstrapping
* [EPM] Implement getConfig for dataset (#53261)
* [EPM] Implement getConfig for dataset
* Implements a getConfig method on a dataset object.
* Build the configuration for each dataset in a package.
* construct and save streams into datasource saved object
* [EPM] Fix template installation (#53272)
As dataset.package was not set, the installed templates contained undefined in the template name. This changes fixes this.
* [EM] Refactor ingest pipeline installation (#53309)
* Refactor ingest pipeline installation
* Only install index templates for requested datasets
* Add index.default_pipeline to index template
* Hook up pipeline rewriting
* Add correct types.
* change POST create datasources path (#53165)
* change POST create datasources path
* remove pkgkey from params
* Fix creation of a data source with a custom ID (#53537)
* [Ingest] Return associated policy IDs in data source info (#53350)
* Return number of policies from data source, surface in assign data source UI
* Update snapshots
* [EPM]: Assign data source to policy in UI (#53597)
* Let ES generate source ids. Refactor along the way.
* Datasource.id isn't optional. It's just missing before we send to Ingest
* Delete EPM's mapping of datasources saved object. Ingest handles that.
* Keep datasource object-related work in constructDatasource
* Move asset installation into own function. Keep entry point high-level.
* More descriptive (less ambiguous) names for these two functions
* Use enum values from Ingest instead of plain strings
* Limit the 'type' key of references to known asset types.
* Update variable names to clarify that we're merging arrays of references
* Use [].flat instead .reduce + .concat to avoid error on empty arrays.
* Pass PackageInfo value directly to component vs pulling off n properties
* Name handlers/options based on the data, not the UI element
* Populate policy combo box based on values from Ingest policy API
* Mark Dataset.vars as optional.
* Add TODOs
* Add commands to run API tests to README (#53847)
* Limit functions to 3 params max. Update those which used more (#53848)
* [EPM] Code in 'common' directories shouldn't import server code (#53854)
* [Fleet] Code in 'common' directories shouldn't import server code (#53938)
* [Fleet] Remove server code from common folder in fleet
* [Fleet] Fix typescript issues after master merge
* [EPM] Fix typescript issues after master merge
* Fix eslint issues
* Fix typescript issues after merge
* Fix merge master missing line
* Fix merge conflict
* [Fleet] Fix registration of Ingest management section (#54065)
* Fix registration of Ingest management section
* Fix i18n key
* [Fleet] Remove server code from common folder in ingest (#53969)
* [Fleet] Connect fleet to policy change update (#53201)
* [Fleet] Send created event when a policy is created
* [Fleet] updated created event when a policy is created
* [Fleet] Send deleted event when a policy is deleted
* [Fleet] Rename output.url => output.hosts (#54258)
* [Ingest] Remove policies UI (#54308)
* Remove meta field UI from policy add/edit form
* Initial pass at policy bulk+single delete UI and API
* Adjust policy links from agent list and detail pages so that links are only active if policy exists
* Add delete policy UI to policy detail page
* Disable policy delete button for default policy
* Commit updated kbn-pm artifact.
CI is failing with messages like
14:52:28 ERROR: 'yarn kbn run build -i @kbn/pm' caused changes to the following files:
14:52:28
14:52:28 packages/kbn-pm/dist/index.js
Following advice from https://elastic.slack.com/archives/C0D8P2XK5/p1570032166063400 and running/committing build
* Update kbn/pm package
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* [EPM] create logs metrics index patterns (#54037)
* fixes bug in for loop returning too early and not looping through all yaml files creating incomplete index template, move loading yaml files to own function, other cleanup
* use reduce in place of for loop
* basic functionality for creating index patterns
* separate logs and metrics index patterns
* dedupe fields
* adjust flattenFields to rename nested fields with parent name path
* some tests
* use yml files for tests
* add awaits as part of installing the package
* optimize loading of yaml files
* fix typo
* change type packageName to package
* update tests to use all files from the beginning
* fix type errors
* fix test
* Use dataset.package from registry
https://github.com/elastic/kibana/pull/54037#pullrequestreview-340362812
* Form validation on add datasource page. (#53920)
* [Ingest] Add support for policy `label` field (#54413)
* Allow `label` field in policy APIs, update UIs to support `label` field
* PR review changes, typo fixes, update tests
* [Fleet] Fix api key creation (#54498)
* [Fleet] Move agent acks to his own endpoint (#54401)
* [Ingest] Fix MaxListenersExceededWarning during kibana boot (#54745)
* [Fleet] Create a default api key for the default output (#54658)
* [EPM] update index pattern fields (#54862)
* add DatasetType type
* move loadFieldsFromYaml to fields
* add logic to determine field values
* update tests
* add back accidentally removed readFromDocValues
* remove DatasetType and add IndexPatternType
* rename dedup to dedupe
* group tests
* use null coalescing operator
* Fix typing issues
* [Fleet] Support agent event subtype STOPPING (#55231)
* [EPM] Prevent double submit when creating data sources
Update installationRequested state after submit (#55100)
* [EPM] handle alias fields when creating kibana index pattern (#55254)
* add alias support, update flattenFields to handle alias copying, update and add tests
* update snapshot
* update findFieldByPath to return undefined if not leaf node
* remove temporary alias type from map
* [EPM] handle multi fields when creating index patterns (#55554)
* handle mult_fields
* move nested function out
* [Fleet] Fleet/spec docs (#55619)
* [EPM] Start to document definitions (#55361)
This is a first stab at creating a place where we define the terms we use across ingest management. This is not complete but defines a place where we can add all the future defintions.
* [EPM] Indexing strategy docs (#55301)
* [EPM] Indexing strategy docs
This documentation is to start documenting our new indexing strategy in a public place and have it versioned. This will allow us to share the current state of the indexing strategy more easily in a single place, track it when updated and also already have it ready for our future users to look it up and understand the benefits of it.
* update typos
* fix one more typo
* apply review feedback
* skip fields that are disabled (#55735)
* [Fleet] Fix fleet typing issues after merging master
* [EPM] Create fieldFormatMap in kibana index pattern (#55892)
* add support for fieldFormatMap
* output params must be camel case
* fix case
* add url_template param
* [Fleet] Use user from saved object to create apiKeys (#55458)
* [EPM] Document package upgrade behaviour (#56138)
This PR adds more detailed documentation on what should happen when a package is upgraded.
* Remove some explicit typing to pass type checks.
This abstraction will be removed in the single plugin going into master.
* remove readFromDocValues (#56227)
* Add symlink to yarn.lock to fix(?) CI
https://github.com/elastic/kibana/pull/56443/checks?check_run_id=418123781 failed saying EPM directory "MUST have a 'yarn.lock' symlink"
Seems to have originated with https://github.com/elastic/kibana/pull/55440
Following example from other legacy/plugins/* in that PR
* Like 441d9ed, but correct
* [Ingest] Convert `ingest` plugin to new platform `ingest_manager` plugin (#56262)
* Seed Ingest Manager as a new NP plugin
* Add contexts for core, deps, and config. Begin routing and nav UI
* Export NP ready request from top-level es_ui_shared/public/
* Add nav styling w/ theming, add useRequest hook
* Set up license and config server-side services; add test routes
* Move most types and constants into /common
* Initial pass at:
* data stream and agent config models
* data stream routes and schemas
* Initial pass at agent config api route handlers
* Change plugin id to camel case
* Fix circular schema dependency, add security as optional plugin
* Create appContext service, use request user info in agent config routes + libs
* Create default agent config
* Add default output host config, output typings, and create default output and its api key
* Move saved object mapping to new plugin
* Change data streams -> datasources
* Add legacy plugin to bootstrap mappings
* Adjust fleet's ingest dependencies
* Disable policies UI in Fleet
* Adjust EPM's ingest dependencies
* Adjust ingest manager base API route
* Adjust fleet's client side ingest dependencies
* Remove more ingest dependencies from fleet
* REMOVE MOST OF LEGACY INGEST PLUGIN
* Add section for agent configs in UI nav
* Allow useRequest and sendRequest consumers to specify typing for response
* Initial pass at porting over agent config list UI
* Port over agent config creation
* Port over delete agent config functionality
* Fix app routing
* Port over fleet setup routes
* Adjust fleet's ingest dependencies
* Make fleet happy path work, skip some tests (MESSY! :))
* Remove policy list UI code from fleet
* Change useRequestResponse error type
* Add missing agent config schemas and hooks
* Fix type check issues
* Register IM under management
* Fix type issues as a result of changes to use/sendRequest interfaces
* Make all ingest saved objects *not* space-aware
* Fix i18n path
* Fix app categories import
* Fix datasource package assets schema (array of asset objects)
* Seed Ingest Manager privileges to fix tests
* Change `features` to optional plugin instead of required
* Fix security privileges tests
* Fix feature test
* Fix duplicate enrollment key created for default agent config
* Fix fleet agent enrollment by catching agent config 404
* PR feedback
* First pass at deleting everything related to EPM & Fleet plugins
* Remove EPM-specific react-markdown
* Remove some unwanted differences from master.
Removed more EPM and Fleet changes
* React.FC -> React.FunctionComponent to match the pattern in master
* Selectively enable features based on config values
* Fix typing and(?) CI
* Enable xpack.ingestManger during tests
Follow example from xpack.endpoint flags
* Don't create BASE_URL value based on PLUGIN_ID
* Don't add optional routes. Use config for registry url
* Add README with some skeleton docs on tests, etc
* Undo changes to some files based on PR feedback
* Commit the result of 'yarn kbn run build -i @kbn/pm'
* Commit the result of 'yarn kbn run build -i @kbn/pm'
* WIP. But add some passing api integration tests
└-: apis
└-> "before all" hook
└-: Ingest Manager plugin
└-> "before all" hook
└-: /agent_configs
└-> "before all" hook
└-> should get agent configs
└-> "before each" hook: global before each
└- ✓ pass (42ms) "apis Ingest Manager plugin /agent_configs should get agent configs"
└-> should create agent config
└-> "before each" hook: global before each
└- ✓ pass (63ms) "apis Ingest Manager plugin /agent_configs should create agent config"
└-> should have new agent config
└-> "before each" hook: global before each
└- ✓ pass (41ms) "apis Ingest Manager plugin /agent_configs should have new agent config"
└-> should delete that new config
└-> "before each" hook: global before each
└- ✓ pass (1.0s) "apis Ingest Manager plugin /agent_configs should delete that new config"
└-> should get datasources
└-> "before each" hook: global before each
└- ✓ pass (26ms) "apis Ingest Manager plugin /agent_configs should get datasources"
└-> should 404 from EPM package api
└-> "before each" hook: global before each
└- ✓ pass (41ms) "apis Ingest Manager plugin /agent_configs should 404 from EPM package api"
└-> "after all" hook
└-> "after all" hook
└-> "after all" hook
6 passing (1.2s)
* WIP
* Fix TS type errors.
Types are created tests. Should they come from test project?
* Add route to delete datasources (mirrors agent_configs api)
* Remove old ESArchiver files
* Add integration tests for each /agent_config & /datasources route
* Update README
Remove bash integration test scripts
* More updates to README
* Remove xpack.kueryAutocomplete from x-pack/.i18n.json
* Use default appRoute. We can't use /app/ingest (at least for now).
Looking at the app_router it seems like any route starting with `/app` must be `/app/:appId`.
I also don't think appRoute is fully supported. I'll follow up with Platform.
* Use appBasePath from app mount params for React Router basename
* Remove out-of-date comments
* Use the ES client from core
* Move License & Config services WIP. Pushing to share
* Move config & license services into App Context service.
* Remove FTR tests for Ingest Manager
* Remove license-related propperties
* Remove clusterClient properties
* Don't set this.security if not in dependencies
* WIP (failing) integration_test
* No more unknown key errors. Timeouts now
* Test routes with default (disabled) and manager-only flags
* Add tests to cover all permutations of flags (A, AB, AC, ABC)
* Use TS types vs config-schema in common & public
Move all @kbn/config-schema usage to server
Co-authored-by: Matt Apperson <me@mattapperson.com>
Co-authored-by: Jen Huang <its.jenetic@gmail.com>
Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com>
Co-authored-by: Sandra Gonzales <neptunian@users.noreply.github.com>
Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
Co-authored-by: Sonja Krause-Harder <krauseha@gmail.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Revert "Skip flaky test (#57675)"
This reverts commit c965a9efa8.
* Revert "disable firefox smoke tests so we can fix flakiness out of band"
This reverts commit fe3864282a.
* Revert "skip flaky tests (#57643)"
This reverts commit b22045433e.
* Revert "skip flaky suite (#50018)"
This reverts commit b058dc2fe7.
* Revert "skip settings tests (#57608)"
This reverts commit 64625b282c.
* Revert "skip failing suite (#44631)"
This reverts commit 8aa718d11e.
* Revert "skip flaky suite (#44631)"
This reverts commit 6e4efdfa7c.
* Revert "skip flaky test (#57377)"
This reverts commit 59672ab5da.
* Revert "Skip save query tests (#57589)"
This reverts commit 431a1e9c89.
* remove hard coded timeouts
* Revert "Revert "disable firefox smoke tests so we can fix flakiness out of band""
This reverts commit 271f8814d5.
* Revert "remove hard coded timeouts"
This reverts commit 8b843d0aa6.
* wait for managementHome to exist, don't bail early if it's missing
* Revert "skip flaky suite (#45244)"
This reverts commit 0cee1a4adb.
* extend timeouts for common existsOrFail() calls
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Over the last few years we've increased the number of test runners.
Entry points by test type have become too lage of a category for unique
names, so this moves top level test scripts under yarn and replaces test
types with the runner name.
e.g. `yarn test:browser` -> `yarn test:karma`
Closes#41133
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fully migrates metrics and logs to the NP
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
* Stubbed route, static tree
Changing commit author to me
* Starting the queries
* Built out children api
* using agent id instead of labels and implementing the get node route
* Adding pagination, need to write tests
* Removing track_total_hits because it defaults to 10k
* Allowing null for origin information
* Building out tests
* Adding more response tests
* Adding test for children route
* Forgot to save
* Reverting first commit and keeping my changes to resolver route
* Working search handler tests
* Adding api test
* Trying to figure out the query issue
* Working api tests
* A little refactoring of common types
* Fixing tests
* Some clean up and fixing bad merge
* Working api
* Changing phse0 names
* Refactoring duplicate code in route
* Adding test for count query and fixing api test
* Renaming phase 1 to elastic endpoint
* Removing test files without tests
* Restructuring things
* Building events for process handler
* Working unit tests
* Working integration tests
* Pagination test is failing
* More refactoring
* Add alternative fields to support other datasources
* Working refactored routes
* Strip out 'synthetic id' stuff
* allow ppid to be undefined
* Some clean up and fixing typescript lint errors
* Removing changes to alerts
* Remove the additional query with the _id cursor
* Use Buffer.from instead of new Buffer
* Fixing import
* Fix decoding
* Fix Promise return type
* Fixing linter used before assigned problem
* Removing unused import
* gzipping the test file
* Addressing feedback, more clean next cursor
* Fixing cast for search_after
* Fixing test failure and adding comments
* Fixing timestamp string type failure
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrew Stucki <andrew.stucki@gmail.com>
* wip: convert jobValidation routes to NP
* fix typo in np migration docs
* replace legacy es plugin with callAsInternalUser from context
* add schema info for job validation routes
* update types and schema for job + cardinality validation
* update bucketSpanEstimator test
* update job validation schema
* [Maps] only request field in docvalue_fields when the field supports doc values
* do not include scripted fields in sourceOnlyFields
* review feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes a regression introduced by #56358. We're reusing the KqlFilterBar from the ML plugin in the transform plugin and missed updating the dependency management. Note this PR is only about fixing that regression. Future work on NP migration should take care of cleaning up the dependency management in the transforms plugin in general.
* transaction actions menu
* transaction actions menu
* fixing pr comments
* fixing pr comments
* fixing pr comments
* fixing pr comments
* fixing unit test
* fixing unit test
* using moment to calculate the timestamp
* renaming labels
* Changing section subtitle
* fixing unit tests
* replacing div for react fragment
* refactoring
* removing marginbottom property
* div is needed to remove the margin from the correct element
* [Telemetry] Refactor to TS Monitoring telemetry_collection files
* [Telemetry] Fetch side documents generated by monitoring to build up the Kibana plugins stats
* Update x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.ts
Co-Authored-By: Ahmad Bamieh <ahmadbamieh@gmail.com>
* Fix import in test file
* Move mocha tests to Jest + TS
* Fix extended telemetry in functional tests
* Fix types
* [Telemetry] Fix bug in usage_collector wrong function override
* Revert integration tests (change not needed)
Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Fixes hiding the global date picker on anomaly detection settings pages.
- Consolidates various timefilter usages for enabling/disabling the date picker into a useTimefilter() hook.
* Move mode and lexer rules to shared space
* Update searchprofiler mode rules
* Moved x-json worker out of searchprofiler and into es_ui_shared (for use in Watcher)
Renamed ace/mode -> ace/modes
* Moved collapse and expand literal string functions to es_ui_shared
* Fix some imports
Enable Watcher editor to parse XJson using XJsonMode
* Fix imports
Import JSON highlight rules in XJSONHighlight rules
* Move console_lang, fix Jest tests
Exporting console_lang through the es_ui_shared/public barrel caused the XJsonMode to imported to a index_management too and any other plugin that may
import something from that directory. console_lang was moved to it's own top level directory es_ui_shared/console_lang.
We also included a mock for tests using XJsonMode to import from console_lang.
* Fixed OSS Jest tests
Console Jest tests were still failing because they did not mock out the raw-loader imported worker file
* Expand triple quotes in editor
Upon entering the advanced watcher creation view, the JSON should be scanned for triple quote expansion
* Bring all editors themes in line
Editors had github theme, which diverged from the textmate theme used in Console and SearchProfiler
* Added XJSON mode to simulate alternative input editor
Slight refactor to the logic for using XJSON mode. Created an adhoc hook for wrapping the
logic of useState and moved lanugage util imports there too to reduce the number of imports
in both the watcher form and simulate tabs in advanced creation.
* Moved x-json worker to x-pack
x-json worker is currently only used inside of x-pack. Also testing
for if this will fix the CI/prod build
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Made eui search field not a controlled component
Added validateRegExpString util
* Update error message display. Use EuiCallOut and i18n to replicate other search filter behaviour, e.g. index management.
* Remove unused variable
* Update Jest snapshot
* Updated layout for callout
The previous callout layout looked off-center next to the controls in the table.
* Update copy and remove intl
Update "Filter Invalid:" to sentence case
Remove inject intl wrapper from CheckupControls component
Remove unnecessary grow={true}
* Updated Jest component snapshot
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>