* Update Result component to render a custom drag handle
* Update Result library with a draggable example
- note: this doesn't actually handle reorder logic, it's purely a UI/UX example
* Update CurationResult to pass dragHandleProps through to Result
* Fix incorrect copy
* Fix incorrect copy
* Update Box icon to match other icon sizes
* Add missing spacer on connector configuration screen
* Add missing spacer to Manage Source modal on Group page
* Remove shadows on Security page
* Align the last column content in tables to the right
* Fix colors on save custom source page
"Secondary" is greenish in new version is EUI, we need "subdued"
* Fix link to personal dashboard
* Add missing breadcrumbs to Security and Settings pages
* Deduplicate Security tests on Basic and Platinum licenses
* Prevent range slider from shifting to left when priority is 10
When priority is 10, the number become wider and it pushes the range slider to the left. This commit is a quick fix for that. We could improve it later by adding a proper input.
* Fix i18n duplicate ID
* Revert "Fix link to personal dashboard"
This reverts commit 5fc3ad2937.
* fix get_legend_config error in canvas/lib/index
* convert resolve_dataurl to ts to fix canvas/lib/index failure
* convert expression_form_handler to ts to fix canvas/lib/index failure
* convert canvas lib/error into ts
* canvas: do not compile json file due to effect on performance
* remove type. it is not exported and inferred as any implicitly
* fix datatable error in lib/index.d.ts file
* fix url resolver
* case manually to avoid incompatibility error
* merge all the typings at root level
* merge x-pack/tsconfig into tsconfig.json
* fix tsconfig after changes in master
* remove unnecessary typings
* update paths to the global typings
* update paths to the global elaticsearch typings
* fix import
* fix path to typings/elasticsearch in fleet plugin
* remove file deleted from master
* fix lint errors
* block node allocation notices on cloud
* added test to check that notices are not showing
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Added text help for each entry input option
* Add new unit test
* Fix wrong import on test file
* Change entry variable to readonly. Use it.each instead of a for loop
* Move function inside useMemo since it is only used there
* Remove old commented code
* Update failing test
- Adds a Kibana API endpoint transforms/_nodes
- Adds number of nodes to the stats bar in the transforms list.
- Shows a callout when no transform nodes are available.
- Disable all actions except delete when no transform nodes are available.
- Disables the create button when no transform nodes are available.
* WIP: Add basic structure of our ML Job callout
* Tests are not implemented
* logic is questionable
* Detections now makes redundant ML API calls
* Fix JSDoc reference
* Move ML Jobs callout to Rules page
As opposed to the more general Detections page.
* Extends callout logic to include installation of any affected jobs
* If old jobs are used with new ECS data, you'll be missing
anomalies/alerts
* If new jobs are used with old ECS data, you'll be missing
anomalies/alerts
* Flesh out our link to ML Job compatibility docs
This page doesn't exist yet; the URI/copy is subject to change.
* ML Job Upgrade -> ML Job Compatibility
This is a more accurate name for the concept since the problem is more
general than presence/absence of an upgrade.
* Add some placeholder copy to get the ball rolling
* Test callout behavior with different API responses
* Prevent fetching ML data when ML popover is opened/closed
We already fetch this data when the component is initially rendered. In
the normal workflow of page load -> open popover, we perform six (6) ML
API calls, 3 of which are redundant.
The one downside of this is that opening/closing the popover will not
refresh data; however, this workflow would previously have resulted in 6
API calls as well.
* Revert "Prevent fetching ML data when ML popover is opened/closed"
This reverts commit 810b78d2b9.
* Update link to relevant documentation
We're going to add a new section to this existing page, and link
directly to that heading. We should be able to generate whatever anchor
we need here, so choosing one arbitrarily on the assumption that docs
can make it work.
* Update copy from product
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Update CurationLogic to handle queries management
- updating the active query
- adding queriesLoading and organicDocumentsLoading state
- clean up / refactor updateCurations slightly - instead of taking a {queries} param, we should opt for a separate updateQueries action and storing a queries state
- this allows us to more granularly hook into activeQuery when queries is updated without the current activeQuery and correct for that
* Add ActiveQuerySelect component
- used for switching the currently active query
* Add ManageQueriesModal component
- used for editing/adding/removing the queries a curation manages
- primarily a light wrapper around the existing reusable CurationQueries component (also used in the create new curation view)
* Add OrganicDocuments and CurationResult components
* Update Curation view with new components
+ update breadcrumb to pull from queries instead of curation.queries, mostly for consistency w/ other usages & slightly faster responsiveness when updating queries
* Fix unnecessary import
* Meeting feedback: organic documents title copy tweak
* PR feedback - test assertion
* ensure feature influence column is shown for outlier jobs
* add popoverContent schema type featureInfluence
* add featureInfluence cell content check to functional test
* update types
* ensure computeFeatureInfluence is added to jobConfig
* always remove invalid feature influence columns for outlier jobs
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fixed Pagerduty dedupKey is not set via API for Uptime alerts
* fixed test
* fixed test
* fixed test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* When xpack.securitySolution.fleetServerEnabled is true, then Endpoint artifact manifest will use a fleet-server relative url for the artifacts generated (note: this flag is temporary until we ship v7.13)
* Refactors the security solution fleet integration extension point callbacks so that some action handlers can be executed in parallel (the creation of detection engine prepackaged rules can sometime take some time to complete
* chore(NA): ensure scripts run with --preserve-symlinks
* chore(NA): run webpack configs with symlinks: false
* chore(NA): fix pkg json load on kbn test
* chore(NA): add script into setup node env
* chore(NA): fix kbn test for relative improt
* chore(NA): fix change on docs
* chore(NA): move ensure node preserve symlinks into setup node env
* chore(NA): update changed docs
* chore(NA): update jest unit test
* chore(NA): fix wrapper script exit code
* chore(NA): updated generated plugin list docs
* fix(NA): make functional test runner use kbn utils repo_root
* chore(NA): fix eslint imports
* chore(NA): missing react correct config on eslint package
* chore(NA): use correct value to make test pass locally
* chore(NA): fix jest tests
* chore(NA): try remove extra preserve symlinks
* chore(NA): fix windows environment
* chore(NA): fix kbn-optimizer to run with preserve-symlinks
* chore(NA): fix integration jest test for kbn/optimizer
* chore(NA): remove require.resolve from eslintrc.js
* chore(NA): avoid load json file
* chore(NA): move kbn/utils import into kbn/dev-utils
* chore(NA): use correct dependencies on eslint config package
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes and unskips tests. Also makes the tests less picky. Although I enjoy seeing the changes on ES promotions of error messages in case we see something really bad happening, it's too manual of a process to fix and puts too much of a burden on operations to skip the error messages.
### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* add num_top_classes and feature_importance checks to validation
* ensure validation details view up to date
* ensure topClasses messages shows correct number. update types
* update functional test
* update cloning functional test for regression type job
* EsArchiver: support for injecting kibana version and use it for speeding up spaces tests
* Use kbn/utils to get current kibana version in tests
* Review feedback: improve test by splitting variable over chunks
## Summary
Increases the pre-packaged socket timeout and chunks the requests. Existing e2e tests should cover the changes. Interesting enough, when the server sends back a 408, Chrome will re-send the same request again which can cause socket/network saturations. By increasing the timeout, Chrome will not resend the same request again on timeout.
Right now, there is not a way to increase the timeouts for the alerting framework/saved objects as far as I know for connections. That would be an additional safety measure in additional to doing chunked requests. Chunked requests will ensure that the pre-packaged rule does not exhaust ephemeral ports and limit the concurrent requests.
See this issue talked about below:
https://github.com/sindresorhus/ky/issues/233https://groups.google.com/a/chromium.org/g/chromium-dev/c/urswDsm6Pe0https://medium.com/@lighthopper/connection-retry-schedule-in-chrome-browser-a9c814b7dc20
**Manual testing**
You can bump up the rule version numbers manually through a search and replace and then install them. You can add a `console.trace()` to the backend and slow down the requests to ensure they are not happening more than once.
```
Trace:
at updatePrepackagedRules (/Users/frankhassanabad/projects/kibana/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts:34:11)
at createPrepackagedRules (/Users/frankhassanabad/projects/kibana/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts:140:9)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at /Users/frankhassanabad/projects/kibana/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts:66:27
at Router.handle (/Users/frankhassanabad/projects/kibana/src/core/server/http/router/router.ts:272:30)
at handler (/Users/frankhassanabad/projects/kibana/src/core/server/http/router/router.ts:227:11)
at exports.Manager.execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
at Object.internals.handler (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
at exports.execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
at Request._lifecycle (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/request.js:371:32)
at Request._execute (/Users/frankhassanabad/projects/kibana/node_modules/@hapi/hapi/lib/request.js:279:9)
```
### Checklist
Delete any items that are not applicable to this PR.
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* added osquery mode to autocomplete
* clean up and formatting
* arm wrestling with the compiler
* more fighting with ace types
* Delete v4.5.0.json
removed unused schema file
* playing the hokey pokey with import statements
* lazy load the schema file
* remove include rule now that we are lazy loading schema json
* update out of date comment
* reduce schema file to what is currently being used, add script for formatting generated api files
* added a readme, and points the compiler at the scripts directory
* swip-swapped the argument order, fixed linting complaints
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Creates a new plugins, maps_ems, with `map.*` configs and shared EMS-settings. `maps_legacy` now only supports the `region_map` and `coordinate_map` plugins.
### Summary
Addresses #92732
7.11+ versions of threshold preview histogram were aggregating by "event.category". This PR updates the preview histogram to take into account threshold field groups and cardinality.
It may need to be called out in documentation or updated to remind users that preview is not an exact guarantee of what signals will be produced as it does not take into account interval and any timestamp_override. Threshold gets a tad bit more confusing because of the multiple aggregations occurring (threshold --> group by field --> histogram).
* [Metrics UI] Use memory limit for K8S when available
* removing duplicate key
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Problem
There's a circular dependency https://github.com/elastic/kibana/issues/91111 between the `fleet` and `security_solution` plugins
* `security_solution` depends on `fleet`, but
* `fleet` has (_had_ with this PR) an `import` from `security_solution` (migrations for the 7.11 and 7.12 package policy objects)
## Proposed solution
### (A) This PR
Move the two imported functions from `security` into `fleet`.
### (B) Follow up issue
Putting integration-specific code into `fleet` doesn't scale (technically or cognitively). Discuss if this use case (specifying saved object migrations, etc) applies to other plugins. e.g. can `apm` do this? `nginx`? If so, should we find a way to move this out of `fleet`?
### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
closes https://github.com/elastic/kibana/issues/91111
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add server side API routes & update types expected from server
* Create CurationLogic with GET and PUT listeners
- PUT is mostly placeholder for now, we'll actually use it later in future Curation PRs
* Create Curation view component & page load effect
* Update CurationsRouter to use new view + remove add_result route
- Per design discussion w/ Davey, we'll be removing the standalone add result route in favor of an in-page flyout
* Fleet: adds new service for Artifact storage management
* Fleet: Expose new `createArtifactsClient()` from Fleet `Plugin#start` interface
* Endpoint: Change Endpoint to use FleetArtifactClient and initial implementation of EndpointArtifactClient
* Endpoint: Add `fleetServerEnabled` feature flag to security solution plugin (will be used in next PR)
* Endpoint: Artifact download api adjusted to get artifact from fleet index
* Endpoint: Added new esArchive for artifacts stored in .fleet-artifacts index for API integration tests
* Add custom actions prop to Result component
- will be used by upcoming Curations work to promote and hide documents
* Add Result custom actions to library
+ [misc] export main Result component from index
This PR addresses a potential problem that we have *not yet* encountered in the wild, but could in theory happen.
When choosing the sort value to use as the value of the `latestTimestamp` in the ES Query Rule Type, we assumed that the sort value would be parsable as a Date.
In this PR we ensure we only try to use a sort value *if* it can be parsed into a date.
* Update text and icons to align with Cloud
* Update test to reflect new page title prefix
* Change links conditionally
* Simplify profile link logic
* Add setAsProfile prop for overriding default link
* Address feedback
* remove translations since message has changed
* Tidying up
* Add unit tests.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* [ML] Adding support for saved object based ml modules
* updating icon mapping
* cleaning up code
* missed private variable
* removing mappings json file
* renaming module id
* updating test
* removing unrelated file
* type clean up
* changing logo type
* changes based on review
* removing fleet changes
* updating type guards
* fixing list module return type
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix test suite name
https://github.com/elastic/kibana/pull/94038/files#r590545670
* Move types out of AttributeSelector component to shared types
* Fix random typo
* Add routes and path generator util
* Move constants to shared
* Fix types in mock
* Fix routes
* Fix failing tests
* Make indicator enrichment tests order-independent
Due to the fact that we use named queries to determine matches, and the
fact that the order in which named queries are returned is undefined, we
cannot guarantee a consistent ordering of enrichments if a given event
matches multiple named queries.
Because the ordering is not in itself important to enrichment, in order
to assert the multi-match functionality we must make the assertions
order independent.
* PR feedback
* Since we're only looping for side effects, prefer forEach to map for
more idiomatic FP.
* Remove redundant "_" from icon names
* Move all icons from sources_full_bleed to source_icons
Overwrite existing icons in case of conflicts
* Remove fullbleed prop from source_icon
* Minimize the only unminimized icon
* Remove unused icons
* script that finds the chromium commit
* use run from dev-utils
* update docs and inch towards build pipeline
* more docs updates
* move the scripts the root
* review feedback
* DataPanel: fix icons showing unaligned & w/ too much flex space
* LoadingOverlay: add new loading component w/ overlay
- should have an opacity'd overlay to hide content underneath
- specify z-index
* DataPanel: add flag to display a LoadingOverlay
- update CSS to contain LoadingOverlay
- add isLoading prop
* adding time comparison to latency chart
* adding time comparison to latency chart
* fixing TS
* fixing api test
* addressing PR comments
* adding api test
* addressing PR comments
* fixing api test
* rounding date diff
* addressing PR comments
* fixing api test
* refactoring
* fixing ts issue
* fixing offset function
* fixing offset function
* addressing PR comments
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Converted some js files to ts as preparation for remote clusters work for Cloud
* Updated the snapshots
* Removed non-null assertion operator in favor of a more explicit nullish coalescing operator
### Summary
Addresses #93559
In a previous PR where we added id to exception entries, this case was missed where the exceptions are prepopulated for endpoint alerts.
* Enhance our LogicMounter helper to accept and build props
* Update logic tests in AS that require props to now use LogicMounter
* Upgrade Kea to 2.3.0 for future BindLogic use
In #92898 the `alerts` plugin was renamed to `alerting`. We were checking if this plugin is enabled with a check like `'alerts' in plugins`, which is not type checked.
Change the check to use `!!plugins.alerting` so this type of change will be caught in the future.
Rename `get_alert_capabilities` to `get_alerting_capabilities` to match the name of the exported function. Add a test for it.
* Revert "[APM] Hoist HeaderMenuPortal to prevent unmounts (#92012)"
Revert the change from #92012 to put the `HeaderMenuPortal` back within the routing context so getting data from the path params works.
Use a context to fetch the list of jobs and use it in the callout and the header menu icon. This makes it so the fetch only happens once.
A refetch function is exposed from the context and called when a new job is created.
* Make package validation be based on types
* Add package info to cache after it is generated from ES storage
* Add logging around package info retrieval and when cache is set
* Add snapshot api integration test for uploaded package info
* Use the apache package for snapshot test instead
* Remove date field from snapshot
* Update docs
* Fix streams getting overridden
* Add back package field to data streams
* PR fixes
* Add delete engine route to App Search
* Add new deleteEngine listener to EnginesLogic
* Convert EnginesTable Manage into a proper EuiBasicTable action
* Call EnginesLogic.actions.deleteEngine using new action in EnginesTable
* Manage action on EnginesTable should use eye icon
* Confirmation alert for delete action on EnginesTable
* Only display manage/delete actions to users with canManageEngines
* Add success message and reload after successful engine delete
* Jest tests for EngineTable actions
* Copy change for engine delete success message
* Fixing EnginesTable tests
* Adding more tests for DELETE engine route
* engineNameLink -> EngineNameLink
* Remove redundant test
* Convert Engine.type to enum EngineTypes
* Must use mountWithIntl
* Use platinum license instead of role ability check
Improves error handling for the transform wizard when Kibana index pattern or saved search fails to load.
Previously a non-existing index pattern or saved search or corrupt saved object could cause the page to end up blank. Improved error reporting will catch the problem and display an error callout.
* add nested field inside of dataprovider
* make sure to get nested
* fix elq server side
* add mock for nested attributes
* Add basic tests for nested fields query generation
* Update snapshots and failing tests with nestedFields
* fix nested date
Co-authored-by: Kevin Qualters <kevin.qualters@elastic.co>
* Removing duplicate ActionVariable interface. Updating common action variables in UI
* Passing in alert values as rule variables in transform_action_params
* Fixing unit tests
* Fixing functional test
* Adding functiional test
* Updating paths
* Fixing i18n
* Fixing i18n
* Fixing api docs
* Plugin api build
* Moving spaceId and tags under rule prefix
* Using top level alert prefix
* Fixing i18n
* build api docs
* Fixing functional test
* Fixing functional test
* Store session data sent from Enterprise Search server
This modifies the EnterpriseSearchRequestHandler to remove any data in a
response under the _sessionData key and instead persist it on the server
side.
Ultimately, this data will be persisted in the login session, but for
now we'll just store it in a cookie. https://github.com/elastic/kibana/issues/92558
Also uses this functionality to persist Workplace Search's OAuth token
package.
* Only return a modified response body if _sessionData was found
The destructuring I'm doing to remove _sessionData from the response is
breaking routes that currently expect an empty response body. This
change just leaves those response bodies alone.
* Refactor from initial feedback & add tests
* Decrease levity
* Changes from PR feedback
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Prevent EuiFocusTrap from blocking focus to global search
* Only run when flyout is open
* Remove unused import
* Fix broken cypress test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Retrieve SOs by ID in a space-aware manner by using bulkGet
We were previously using a manual invocation of find(), which was a)
tied to the current implementation of how SOs generate their _ids, and
b) didn't respect spaces.
By replacing this with a call to bulkGet, which automatically respects
the space of the current request, and which abstracts away the building
of the actual _id based on the SO ID and type, we address the issues
above.
* Surface SO errors to the finalize/delete APIs
Now that we're using bulkGet, we receive an object with errors if the
object is not found, which by default breaks our subsequent validation.
In order to provider better UX, we re-raise the first of these errors
that we find, if present, and return that to the user.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Support for number, date and IP ranges
* Update tests
* Ranges don't work with range agg
* Fix test case
* Allow Discover to create range filters
* Supports ranges in Visualize, KQL, remove Lens support
* Fix test mappings
* Bring back field cache to work around bug
* Fix some tests
* Fix test expectation
* Respond to review comments
* Fix type error
* Remove added sample data
* Fix api_docs
* Fix test
* [Maps] chunk geojson upload to keep import requests under 1MB
* fix geojson_importer tests
* update failure.item to reflect location in file
* remove console statement
* clean up
* return instead of break if upload is no longer active
* add unit test for createChunks
* update file_upload API
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* add first version of preview chart for inventory alerts
* Make preview chart collapsible
* Add margin to expressions without charts
* Remove some duplication in metric alerts preview charts
* Add warning thresholds to inventory alerts preview chart
* Add threshold annotations component
* Clean imports and unused variables
* Add tests for threschold annotations component
* Remove unused translations
* Set correct id to inventory alerts preview chart
* Get accountId and region with useWaffleOptions for preview chart
* Save inventory alert thresholds in the same unit as ES
* minor fixes
* Revert "Save inventory alert thresholds in the same unit as ES"
This reverts commit 118d83efeb.
* Remove threshold formatter function and convert values inside expression chart component
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Changes to fix APM's Storybook setup were made in #93087 and #93294. This re-enables it and fixes a couple places where we weren't using a theme provider.
* rollback timeout for dnd and rewrite script for the failing case
* rollback timeout for dnd and rewrite script for the failing case
* rollback timeout for dnd and rewrite script for the failing case
* rollback unnecessary change
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fix accessibility of the filter bar tags (#82457)
* Fix focus state keeping after removing a filter tag (#82503)
* Fix invalid state in the query bar date picker (#82513)
* wip: create validationStep component
* wip: trainingPercent check, analysisFields check. Step details
* move validation check to server
* handle no training percent in validation
* move callout component to shared dir
* use shared Callout component in AD val and update message headings
* update types
* adds functional tests for validation
* adds api integration test for validate endpoint
* consolidate messages for depvar and fields
* fix accessibility test
* update license
* update validation messages
* update types in validation model
* add jobValidationReturnType
* fix validation on response of find status route when rule has a partial failure status
* replaces warning in rule status service with partial failure to maintain backwards compatibility from an API standpoint, also displays 'warning' on UI if a rule's status is partial failure
* display partial failure as 'warning' on all rules table and update e2e test to check for partial failure not warning
* add util function, show 'warning' on monitoring table, fix e2e tests
* Rename alerts plugin to alerting
* Deprecate old config values
* Few more renames
* Update plugin list
* Rename xpack.alerts -> xpack.alerting
* Fix some ESLint rules
* Fix typecheck
* Fix some test failures
* Some more renames
* Fix ESLint
* Fix some test failures
* Fix failing jest test
* Undo exclusive test
* Fix APM deps
* Fix docs
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* refactor
* Add explicit to/from
* cleanup
* A bit more cleanup
* Fix threshold signal history bug when rule is edited
* Added comments
* more cleanup, fix tests
* Add tests later
* Reverse the tuples array
* Fix getThresholdBucketFilters test
* Fix translations
* Add UI validation for string YAML values in policies.
* Do not quote YAML strings containing special characters.
* Add test case for wildcards in the middle of strings.
* Add multiline test case.
* Polish test case.
* Update API docs
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* moved legacy actions api to legacy folder
* introduced connector create api
* added new delete route
* added new execute and get_all
* introduced all connector APIs
* renamed action to connector in Apis
* comment on camel case type
* fixed va
* updated docs
* legacy title
* corrected APIs
* legacy links
* added linik to deprecatred APIs
* added linik to deprecatred APIs from index
* moved legacy apis down one level
* Apply suggestions from code review
Co-authored-by: ymao1 <ying.mao@elastic.co>
* renamed route file for connectorTypesRoute
* define legacy route
* Update docs/api/actions-and-connectors/legacy/index.asciidoc
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
* api docs
Co-authored-by: ymao1 <ying.mao@elastic.co>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/89998
The README.md for the event log was a bit old, and was more focused on
implementation details and information for plugin developers writing events.
There wasn't much information available that was useful for folks using
the event log for problem diagnosis.
So the docs have been updated a bit in general, and more information has
been added on the event document structure, and the actions and alerts
events specifically.
* Set all keyword and text fields for `index.query.default_field` setting
* Update tests and snapshots
* Fix test
* Add default field limit safeguard
* Add logging when beyond limit
* Update tests to mock app context (because I added logger usage)
* Update api integration test
* Rename consts
## Summary
Enables caching in our application by setting the default date time of our application to be `from: now/d` and `to: now/d`. When users go to the advanced settings they will see this now:
<img width="1243" alt="Screen Shot 2021-03-04 at 11 53 08 AM" src="https://user-images.githubusercontent.com/1151048/110014626-43fb6700-7ce0-11eb-94ee-0c4cc7a8a10f.png">
In their date time bars on page loads they will see today instead of 24 hours:
<img width="556" alt="Screen Shot 2021-03-04 at 11 50 18 AM" src="https://user-images.githubusercontent.com/1151048/110015216-dac82380-7ce0-11eb-935d-2d71078c1170.png">
When before they used to have `from: now-24` and `to: now`. This new date time frame plays well with Elastic caches and no longer "busts" them for users on each page request. Now users will send the same date time frame on each query which will cache the views as the default.
This also fixes a small bug with the URL's where the "to" was not being rounded up when it was a dynamic date time on first load. For example if you went to the URL, `/app/security/hosts/allHosts` with no additional state information but have a default of `from: now/d` and `to: now/d` it would not round up the date time. Now it rounds it up through the date math utilities which only rounds when it sees that it is a dynamic date math.
When requests are being sent, expect to see this where you have `from` rounded down and `to rounded up. This should be a consistent non-sliding date time math for caching to operate:
<img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015357-01865a00-7ce1-11eb-8580-efacf791b573.png">
If you change the `to` to be another date math such as `now+1d/d` expect to see it also rounded up. This behavior mirrors that of discover:
<img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015440-17941a80-7ce1-11eb-832d-e826962829ed.png">
You can manually verify this behavior by setting the same now dates in discover as well as security solutions and both should work as is even when you remove the URL state from the right side of a `?`
### Checklist
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* Use ReplaySubject and amend date comparisons
* Assess date range expressions separately
* Only add dataset filter to view in stream links if one exists
* Added data-test-subj for ILM policies row and added a functional UI test to create a new ILM policy.
* Removed .only from test to allow entire test suite to run again.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* wip
* Moving catchError so observable stream does not complete. Adding retry on failure
* Using retryWhen. Updating unit tests
* PR fixes
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Documentation for scaling Kibana alerting, what configurations can change, what impacts they have, etc.
Scaling Alerting relies heavily on scaling Task Manager, so these docs also document Task manager Health Monitoring and scaling.
Before we removed environment from the UI filters (#89647), the environment query parameter would be undefined if "All" was selected. Now we send ENVIRONMENT_ALL in as the query parameter.
Changes in https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/server/lib/service_map/get_service_map_from_trace_ids.ts made it so no connections would be returned if ENVIRONMENT_ALL was selected, rather than all connections. Since no connections were being returned, no elements except the selected service would be returned in the API response.
This changes it so if ENVIRONMENT_ALL is selected, the connection will always be returned, just like what used to be the case when environment was undefined.
Add an API test for this case.
Fixes#93385.
* Escape quotes in list ids and quote the id in KQL query
* Remove decodeURIComponent because too many KQL queries don't handle quotes
* Add quotes to user supplied IDs for other KQL queries
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* WIP analytics polish
* Working on tests.
* Finishing up tests.
* Updating the engine overview page.
* eslint fixes
* i18n fixes
* Icons feedback
- Remove unused svg file
- Add TODO comment
- Add test coverage
* linting - unnecessary ternaries
* EnginesOverview feedback
TotalCharts
- adjust chart height
- tests: simplify / convert back to shallow
RecentApiLogs
- switch to DataPanel
* DataPanel feedback
Component
- move CSS table bg override out from being an AnalyticsTable concern to a DataPanel concern
+ bem naming, todo comment
- add responsive={false} for better mobile UX
- add className and data-test-subj prop passing
- change title to pass full heading tags rather than a string
- move subtitle below title for better screen reader order
- add index.ts export
Tests
- capitalization for consistency, ordering/describe
- remove data-test-subjs on source code (simpler to grab & inspect tags directly so we can more easily call .text() on passed content)
- add new tests for props (fliled/className/data-test-subj)
Usage
- update other files using DataPanel to start passing heading tags + use index export
- fix RecentApiLogs tests
- change RecentQueries section to use a DataPanel (per Davey)
* Analytics tags - updates & responsive tweaks
Tags
- Rename to more general tags.tsx file
- Add CSS limiting width of variable length tags
- Break up into two separate components for easier readability & testing
- Split up tags column constants so that the wider tables can use the old tags list component
Tables
- add isSmall flag to AnalyticsTable to use new tag count component
- reduce actions column width
- revert unnecessary table test changes
Analytics
- add custom CSS that switches tables/panels into full-width earlier
* AnalyticsSection fixes
- fix responsive behavior with icon
- add missing AnalyticsSection branch coverage
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
## Problem
Blocks of 10-15 `import`s are common in the plugin and there a few places which have ~50 lines of `import`s. It makes it more difficult to understand the where/why of what's being imported.
We've had instances while files import from the same module in different lines. i.e.
```ts
import { a } from './file';
... 5-10 lines later
import { b } from './file';
```
## Proposed solution
Add a lint rule to enforce a convention on the module `import` order. This can help in the same way Prettier & ESLint help to format type signatures or other code. It makes it easier to understand or notice any changes in the code. It's also able to be fixed automatically (`node scripts/eslint.js --fix` or any existing "format on save" in an editor).
## This PR
replaces #92980 (based on https://github.com/elastic/kibana/pull/92980#pullrequestreview-601070556)
### Lint rule
f9be98d Add eslint rule to enforce/autofix import group order. Use the same rule as a few other plugins. Groups `import` statements by type as shown in the [lint rule docs](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order
). The order is:
1. node "builtin" modules
2. "external" modules
3. "internal" modules
4. modules from a "parent" directory
5. "sibling" modules from the same or a sibling's directory, "index" of the current directory, everything else
e.g.
```typescript
import fs from 'fs';
import path from 'path';
import _ from 'lodash';
import chalk from 'chalk';
import foo from 'src/foo';
import foo from '../foo';
import qux from '../../foo/qux';
import bar from './bar';
import baz from './bar/baz';
import main from './';
```
The [lint rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order) is relatively light handed. It only ensures the `imports` are groups together in the given order. It doesn't alphabetize or otherwise sort the order of the files.
e.g. imports aren't rewritten to be in alphabetical order. This is fine
```ts
import from './c';
import from './a';
import from './b';
```
The [docs show other options](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#options) and 2831f02bc7/.eslintrc.js (L1138-L1168) uses many of them
### Newlines option
The newlines settings means a change from something like
```typescript
import fs from 'fs';
import path from 'path';
import _ from 'lodash';
import chalk from 'chalk';
import foo from 'src/foo';
import foo from '../foo';
import qux from '../../foo/qux';
import bar from './bar';
import baz from './bar/baz';
import main from './';
```
to
```typescript
import fs from 'fs';
import path from 'path';
import _ from 'lodash';
import chalk from 'chalk';
import foo from 'src/foo';
import foo from '../foo';
import qux from '../../foo/qux';
import bar from './bar';
import baz from './bar/baz';
import main from './';
```
Added it as a separate commit 2831f02 in case we want to avoid it, but I believe it's an improvement overall. Especially on the files with 25+ lines of imports. Even the "worst case" of something like this isn't bad (IMO). Especially since it's an automatic reformat like anything else in prettier
```typescript
import fs from 'fs';
import _ from 'lodash';
import foo from '../foo';
import main from './';
```
* Writing failing test for duplicate ids
* Test is correctly failing prior to bug fix
* Working jest tests
* Adding more jest tests
* Fixing jest tests
* Adding await and gzip
* Fixing type errors
* Updating log message
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
The threat intel data that we are loading for these tests was previously
copy/pasted, resulting in all docs having the same @timestamp value.
This resulted in nondeterministic ordering which manifested as test
failures.
This fixes the issue by giving a unique timestamp to each indicator
document, and then unskips/updates tests according to this new ordering.
* add start and stop endpoint tests
* add start and stop within spaces endpoint tests
* move start and start_spaces tests to separate files
* wip: move stop and stop_spaces to separate files
* use slow running job config so job is still running when stop request happens
* check started job state is actually started
* check job is stopped after stopping
* add debug logs
* ensure jobs are created/started before stopping attempt
* remove unnecessary debug logs
* rename ml:fileDataVisualizerMaxFileSize to fileUppload:maxFileSize
* add saved object migration
* file preview
* importing status
* remove console statement
* import complete view
* fix geojson_importer test
* tslint
* i18n fixes
* cleanup
* update documenation for advanced setting rename
* advanced settings usage_collection
* remove ml:fileDataVisualizerMaxFileSize from schemas and types
* add copy buttons for import response and fix geojson upload functional tests
* tslint
* remove clipboard-read check
* return early if env does not support reading from clipboard
* fix reporting tests
* review feedback
* update GeoJsonFileSource to support showing results trimmed icon and tooltip
* add fileUpload to useMlKibana context and replace dependencyCache with useMlKibana
* tslint
* review feedback
* lower case file name
* default to selecting geo_shape when file contains both points and shapes
* fix wizard onError callback to not advance to next step
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>