* partial implementation for OLS Phase 1
* Allow Saved Objects Client to be wrapped
* Add placeholder "kibana.namespace" configuration property
* revert changes to saved objects client
* Remove circular dependency
* Removing namespace setting, we're using xpack.security.rbac.application
* Adding config.getDefault
* Expose SavedObjectsClientProvider on the server for easy plugin consumption
* migrate x-pack changes into kibana
* Beginning to use the ES APIs to insert/check privileges (#18645)
* Beginning to use the ES APIs to insert/check privileges
* Removing todo comment, I think we're good with the current check
* Adding ability to edit kibana application privileges
* Introducing DEFAULT_RESOURCE constant
* Removing unused arguments when performing saved objects auth check
* Performing bulkCreate auth more efficiently
* Throwing error in SavedObjectClient.find if type isn't provided
* Fixing Reporting and removing errant console.log
* Introducing a separate hasPrivileges "service"
* Adding tests and fleshing out the has privileges "service"
* Fixing error message
* You can now edit whatever roles you want
* We're gonna throw the find error in another PR
* Changing conflicting version detection to work when user has no
application privileges
* Throwing correct error when user is forbidden
* Removing unused interceptor
* Adding warning if they're editing a role with application privileges we
can't edit
* Fixing filter...
* Beginning to only update privileges when they need to be
* More tests
* One more test...
* Restricting the rbac application name that can be chosen
* Removing DEFAULT_RESOURCE check
* Supporting 1024 characters for the role name
* Renaming some variables, fixing issue with role w/ no kibana privileges
* Throwing decorated general error when appropriate
* Fixing test description
* Dedent does nothing...
* Renaming some functions
* Adding built-in types and alphabetizing (#19306)
* Filtering out non-default resource Kibana privileges (#19321)
* Removing unused file
* Adding kibana_rbac_dashboard_only_user to dashboard only mode roles (#19511)
* Adding create default roles test (#19505)
* RBAC - SecurityAuditLogger (#19571)
* Manually porting over the AuditLogger for use within the security audit
logger
* HasPrivileges now returns the user from the request
* Has privileges returns username from privilegeCheck
* Adding first eventType to the security audit logger
* Adding authorization success message
* Logging arguments when authorization success
* Fixing test description
* Logging args during audit failures
* RBAC Integration Tests (#19647)
* Porting over the saved objects tests, a bunch are failing, I believe
because security is preventing the requests
* Running saved objects tests with rbac and xsrf disabled
* Adding users
* BulkGet now tests under 3 users
* Adding create tests
* Adding delete tests
* Adding find tests
* Adding get tests
* Adding bulkGet forbidden tests
* Adding not a kibana user tests
* Update tests
* Renaming the actions/privileges to be closer to the functions on the
saved object client itself
* Cleaning up tests and removing without index tests
I'm considering the without index tests to be out of scope for the RBAC
API testing, and we already have unit coverage for these and integration
coverage via the OSS Saved Objects API tests.
* Fixing misspelling
* Fixing "conflicts" after merging master
* Removing some white-space differences
* Deleting files that got left behind in a merge
* Adding the RBAC API Integration Tests
* SavedObjectClient.find filtering (#19708)
* Adding ability to specify filters when calling the repository
* Implementing find filtering
* Revert "Adding ability to specify filters when calling the repository"
This reverts commit 9da30a15db.
* Adding integration tests for find filtering
* Adding forbidden auth logging
* Adding asserts to make sure some audit log isn't used
* Adding more audit log specific tests
* Necessarly is not a work, unfortunately
* Fixing test
* More descriptive name than "result"
* Better unauthorized find message?
* Adding getTypes tests
* Trying to isolate cause of rbac test failures
* Adding .toLowerCase() to work around capitalization issue
* No longer exposing the auditLogger, we don't need it like that right now
* Removing some unused code
* Removing defaultSettings from test that doesn't utilize them
* Fixing misspelling
* Don't need an explicit login privilege when we have them all
* Removing unused code, fixing misspelling, adding comment
* Putting a file back
* No longer creating the roles on start-up (#19799)
* Removing kibana_rbac_dashboard_only_user from dashboard only role
defaults
* Fixing small issue with editing Kibana privileges
* [RBAC Phase 1] - Update application privileges when XPack license changes (#19839)
* Adding start to supporting basic license and switching to plat/gold
* Initialize application privilages on XPack license change
* restore mirror_status_and_initialize
* additional tests and peer review updates
* Introducing watchStatusAndLicenseToInitialize
* Adding some tests
* One more test
* Even better tests
* Removing unused mirrorStatusAndInitialize
* Throwing an error if the wrong status function is called
* RBAC Legacy Fallback (#19818)
* Basic implementation, rather sloppy
* Cleaning stuff up a bit
* Beginning to write tests, going to refactor how we build the privileges
* Making the buildPrivilegesMap no longer return application name as the
main key
* Using real privileges since we need to use them for the legacy fallback
* Adding more tests
* Fixing spelling
* Fixing test description
* Fixing comment description
* Adding similar line breaks in the has privilege calls
* No more settings
* No more rbac enabled setting, we just do RBAC
* Using describe to cleanup the test cases
* Logging deprecations when using the legacy fallback
* Cleaning up a bit...
* Using the privilegeMap for the legacy fallback tests
* Now with even less duplication
* Removing stray `rbacEnabled` from angularjs
* Fixing checkLicenses tests since we added RBAC
* [Flaky Test] - wait for page load to complete (#19895)
@kobelb this seems unrelated to our RBAC Phase 1 work, but I was able to consistently reproduce this on my machine.
* [Flaky Test] Fixes flaky role test (#19899)
Here's a fix for the latest flaky test @kobelb
* Now with even easier repository access
* Sample was including login/version privileges, which was occasionally (#19915)
causing issues that were really hard to replicate
* Dynamic types (#19925)
No more hard-coded types! This will make it so that plugins that register their own mappings just transparently work.
* start to address feedback
* Fix RBAC Phase 1 merge from master (#20226)
This updates RBAC Phase 1 to work against the latest master. Specifically:
1. Removes `xpack_main`'s `registerLicenseChangeCallback`, which we introduced in `security-app-privs`, in favor of `onLicenseInfoChange`, which was recently added to master
2. Updated `x-pack/plugins/security/server/lib/watch_status_and_license_to_initialize.js` to be compliant with rxjs v6
* Retrying initialize 20 times with a scaling backoff (#20297)
* Retrying initialize 20 times with a scaling backoff
* Logging error when we are registering the privileges
* Alternate legacy fallback (#20322)
* Beginning to use alternate callWithRequest fallback
* Only use legacy fallback when user has "some" privileges on index
* Logging useLegacyFallback when there's an authorization failure
* Adding tests, logging failure during find no types fallback
* Switching to using an enum instead of success/useLegacyFallback
* Using _execute to share some of the structure
* Moving comment to where it belongs
* No longer audit logging when we use the legacy fallback
* Setting the status to red on the first error then continually (#20343)
initializing
* Renaming get*Privilege to get*Action
* Adding "instance" to alert about other application privileges
* Revising some of the naming for the edit roles screen
* One more edit role variable renamed
* hasPrivileges is now checkPrivileges
* Revising check_license tests
* Adding 2 more privileges tests
* Moving the other _find method to be near his friend
* Spelling "returning" correctly, whoops
* Adding Privileges tests
* tests for Elasticsearch's privileges APIs
* Switching the hard-coded resource from 'default' to *
* Throw error before we execute a POST privilege call that won't work
* Resolving issue when initially registering privileges
* Logging legacy fallback deprecation warning on login (#20493)
* Logging legacy fallback deprecation on login
* Consolidation the privileges/authorization folder
* Exposing rudimentary authorization service and fixing authenticate tests
* Moving authorization services configuration to initAuthorization
* Adding "actions" service exposed by the authorization
* Fixing misspelling
* Removing invalid and unused exports
* Adding note about only adding privileges
* Calling it initAuthorizationService
* Throwing explicit validation error in actions.getSavedObjectAction
* Deep freezing authorization service
* Adding deepFreeze tests
* Checking privileges in one call and cleaning up tests
* Deriving application from Kibana index (#20614)
* Specifying the application on the "authorization service"
* Moving watchStatusAndLicenseToInitialize to be below initAuthorizationService
* Using short-hand propery assignment
* Validate ES has_privileges response before trusting it (#20682)
* validate elasticsearch has_privileges response before trusting it
* address feedback
* Removing unused setting
* Public Role APIs (#20732)
* Beginning to work on external role management APIs
* Refactoring GET tests and adding more permutations
* Adding test for excluding other resources
* Adding get role tests
* Splitting out the endpoints, or else it's gonna get overwhelming
* Splitting out the post and delete actions
* Beginning to work on POST and the tests
* Posting the updated role
* Adding update tests
* Modifying the UI to use the new public APIs
* Removing internal roles API
* Moving the rbac api integration setup tests to use the public role apis
* Testing field_security and query
* Adding create role tests
* We can't update the transient_metadata...
* Removing debugger
* Update and delete tests
* Returning a 204 when POSTing a Role.
* Switching POST to PUT and roles to role
* We don't need the rbacApplication client-side anymore
* Adding delete route tests
* Using not found instead of not acceptable, as that's more likely
* Only allowing us to PUT known Kibana privileges
* Removing transient_metadata
* Removing one letter variable names
* Using PUT instead of POST when saving roles
* Fixing broken tests
* Adding setting to allow the user to turn off the legacy fallback (#20766)
* Pulling the version from the kibana server
* Deleting unused file
* Add API integration tests for roles with index and app privileges (#21033)
* Rbac phase1 functional UI tests (#20949)
* rbac functional tests
* changes to the test file
* RBAC_functional test
* incorporating review feedback
* slight modification to the addPriv() to cover all tests
* removed the @ in secure roles and perm file in the describe block and made it look more relevant
* Fixing role management API from users
* Set a timeout when we try/catch a find, so it doesn't pause a long time
* Changing the way we detect if a user is reserved for the ftr
* Skipping flaky test
This provides more helpful texts for job validation success messages. Previously only a list of checks was shown to the user without any further explanation. This PR addresses this issue in the following way:
- At the bottom of the modal an introductory brief text about job validation including a link to documentation is inserted.
- The success messages in the list now provide a more helpful text including (where applicable) a deep link to documentation
- The messages now support a richer Callout layout including a header and additional text.
* [APM] Change index pattern
* WIP: change how indicies are queried in APM
* Create apm_core plugin
* Update config keys from `xpack.apm` to `apm_core`
* Revert tutorial formatting changes
* Rename to apm_oss
While the output in the UI was fine, certain job configurations containing non-aggregatable fields could trigger errors on the Elasticsearch side.
This PR fixes it by adding an additional query for fieldCaps to check first which fields are actually aggregatable.
For categorization jobs, job validation would report that mlcategory isn't an aggregatable field. This fix checks the job configuration and only reports the error if the job config isn't using categorization_field_name and the detector field isn't set to mlcategory.
- Migrates the ml-form-label directive to use EUI/React.
- Exposes both FormLabel and JsonTooltip as React components from individual files so they can be used in a React context when the wrapping element also has been already ported to React.
- Adds jests based tests for the FormLabel and JsonTooltip components. They try where possible to make the same assertions like the mocha based tests. The mocha based tests are kept in the code for now so the code gets still tested in a angular based context and as a reference to have the same mocha/jest based tests side by side as a reference for migration.
- The FormLabel component is done in a way so it supports transclusion in both cases when used with React alone (using the children prop) and angularjs (using a ref callback and angular's transclude()).
* Replace notify.warning with toastNotifications in region map, vega, index_pattern, redirect_when_missing, graph, monitoring, and ML
* Link to index patterns from Graph toast.
* Delete RouteBasedNotifier.
* Remove courierNotifier and SearchTimeout and ShardFailure errors.
* Remove warning and custom notifier types.
/api/_xpack/usage was added as a target for 6.4.0 but it will not be
used. Instead, the /api/stats response will include usage info on
everything that gets registered with the usage service in
/src/server/usage
/api/_kibana/v1/stats is a GET API that was added in 6.2, during a point
where we thought providing usage stats through a public API would be OK
for capturing internally, with the benefit of having it be visible.
However, we've pivoted away from that idea because it doesn't line up
too well with the existing flow of data, where usage stats are combined
with the "Kibana stats" such as process uptime and number of requests.
We want to shift how we collect stats from Kibana, but it will be
gradual. It might be a while before we have an architecture that makes
sense for a standalone public API for the usage stats
This endpoint was never documented, and isn't used anywhere in the code.
It does incur a maintenance cost though.
Therefore, instead of waiting for a next major version to remove this
API, I'm removing it for 6.4. It will be marked in the release notes as
a breaking change. Since it was never documented, it should not provide
a problem.
* partial progress on reactifying users
* progress on EUIfication of users screen
* removing Angular stuff
* adding data-test-subj="passwordConfirmationInput"
* removing data-test-subj="userFormEmailInput" refs from tests
* fixing selector for role assignment
* some functional test fixes
* fixing some functional tests
* fixing last functional test
* removing stray console log
* fixing warnings
* attempting to fix flaky test
* trying again to fix flaky test
* PR feedback
* PR feedback
* fixing issue where form tried to submit
* adding sleep to allow user to load
* Design edits
Mainly adding wrapper EUI page elements, but also shifted around form elements.
* Fixed console error and added responsive prop to table
* addressing PR feedback
* A few more PR feedback
- Fixed alignment of table
- Removed the tooltip from the lock icon and placed the description inline.
- Changed delete button to an empty button
* addressing more PR feedback
* adding email field back in
* adding back username validation
* restoring original error message
* fixing dumb null error
* [Stats API] Set API field names per spec
* fix jest tests
* fix api integration test
* trash the original metrics collector
- constantly accumulating stats over time does not align with the existing behavior, which is to reset the stats to 0 whenever they are pulled
* move some logic out of the collector types combiner into inline
- change the signature of sourceKibana
* Make a new stats collector for the API
- to not clear the data when pulling via the api
- fetching is a read-only thing
* isolate data transforms for api data and upload data
* no static methods
* remove external in bytes
* remove the _stats prefix for kibana and reporting
* update jest test snapshot
* fix collector_types_combiner test
* fix usage api
* add test suite todo comment
* reduce some loc change
* roll back mysterious change
* reduce some more loc change
* comment correction
* reduce more loc change
* whitespace
* comment question
* fix cluster_uuid
* fix stats integration test
* fix bulk uploader test, combineTypes is no longer external
* very important comments about the current nature of stats represented and long-term goals
* add stats api tests with/without authentication
* fix more fields to match data model
* fix more tests
* fix jest test
* remove TODO
* remove sockets
* use snake_case for api field names
* restore accidental removal + copy/paste error
* sourceKibana -> getKibanaInfoForStats
* skip usage test on legacy endpoint
* fix api tests
* more comment
* stop putting a field in that used to be omitted
* fix the internal type to ID the usage data for bulk uploader
* correct the kibana usage type value, which is shown as-is in the API
* more fixes for the constants identifying collector types + test against duplicates
* add a comment on a hack, and a whitespace fix
* [ML] Adding close jobs menu item
* changing icon
* updates based on review
* adding extra check for close failure
* adding extra guard against missing response
* Add SearchStrategyRegistry and defaultSearchStrategy to support existing search behavior, and integrate it with CallClient.
* Move fetch param logic from CallClient into defaultSearchStrategy.
* Move defaultSearchStrategy configuration into kibana plugin via search uiExport to avoid race conditions with other plugins.
* Add call-out react directive.
* Show error in Discover if user tries to access a rollup index pattern without the right search strategy. Sentence-case copy in field chooser.
* Add tests with multiple searchStrategies and fix errors in logic.
* bump eui
* Fixed breaking `EuiPage` changes
Mainly adding `EuiPageBody`’s where there were none
* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots
* bump eui
* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots
* Update jest snapshots in xpack
* fix metrics field name (stats)
* add state info
* add module name count
* use a set for the unique hosts instead of a map
* fix getting beats_state info
* fix unit test
* processBeatsStatsResults and processBeatsStateResults
* Capitalize the license type in monitoring
* Revert "Capitalize the license type in monitoring"
This reverts commit 38ad3a516d.
* Pass in the type capitalized
* Revert "Pass in the type capitalized"
This reverts commit 6a05bb12f3.
* Capitalize type in license status directly so consumers do not need to worry about it
* Adding fontSize from variables
* SectionHeader style added
* Adding section headers
Needed titling for DB statement and Stacktrace on the page
* Pluralization
* Adding fontSize variable
* Creating new header title style
* Moving title into Stacktrace container
* Updated snapshots
The pseudo-element agg-type-select-wrapper::after which represents the dropdown's arrow didn't react to the click element of the dropdown itself. pointer-events: none is now added to the pseudo-elements to let the click pass through to the element intented to react on the click.
Fixes a regression introduced by #19794. This PR added a 5px top margin to the affected charts. The hard coded bottom margin of the progress bars wasn't adjusted accordingly so the progress bars ended up being hidden behind the actual chart. This PR fixes the problem by taking the chart's top margin into account for progressBarMarginBottom.
- Migrates the ml-info-icon directive to use React/EUI. This fixes a related error in IE11.
- For now a hard-coded override is used to size the icon because EuiIconTip doesn't pass on the size attribute to the wrapped EuiIcon directive.
- The (simple) React component is kept within the directive's, because previously the directive template also wasn't in a separate file.
- Removes the unused mlJsonTooltipService angular service.
* add _bulk_create rest endpoint
* document bulk_create api
* provide 409 status code when conflicts exist
* add overwrite and version to documenation
* clean up assert statements and 2 places where bulkCreate is getting used with new output
* properly stub bulkCreate return
* remove version of documenation example
* [Monitoring/Telemetry] Move Usage service from Monitoring to Kibana core
* fix tests
* fix reporting integration
* roll back more diffs
* roll logger into bulk uploader to remove file duplication
* fix xpack usage api
* subclass constructor is not needed
* collectorSet has factory methods for collector object creation
* fix reporting usage jest test
* Rename config view to PipelineViewer.
* Decouple CollapsibleStatement from if/else using props.children.
* Add tests for PipelineViewer component.
* Test Metric component.
* Test CollapsibleStatement component.
* Test PluginStatement component.
* Test Queue component.
* Test StatementListHeading component.
* Test StatementSection component. Move StatementList component to dedicated file.
* Test StatementList component.
* Test Statement component.
* Run prettier on edited files.
* [ML] Adding jobs stats bar to top of jobs list
* unsetting update function
* changing node variable name
* small refactor
* using props copy of `updateJobStats`
* adding proptypes
* adding fixed height
* Add MarkdownSimple component.
* Replace Context use of notifier with toastNotifications.
* Replace field.js use of notifier with toastNotifications.
* Replace State use of notifier with toastNotifications.
* Replace reporting use of notifier with toastNotifications.
* Convert Logstash to use toastNotifications.
* Convert Security to use toastNotifications.
* [ML] [WIP] Allow job cloning via wizards
* updating clone link
* removing-created-by-data-when-editing-job
* removing commented out code
* changes based on review
* [ML] Adding filter bar to jobs list
* fixing page index when filtering
* refreshing job selection after actions have happened
* adding job counts to groups
* catching multi-select start datafeed errors
* style tweaks
* more style tweaks
* changes based on review
* refactoring search logic
* Removed the dynamically assigned type, query, filter, sort, highlight, highlightAll, aggs, from, searchAfter, size, source, version, and fields methods.
* The accessor interface now consists of getField and setField methods which throw errors if an unrecognized property name is provided, in addition to getFields, setFields, getOwnField, and getId methods.
* Linked-list interface now consists of setParent and getParent.
* Factory interface now consists of create, createCopy, and createChild.
* Removed the unused unused enable, disable, and addFilterPredicate, and the redundant toString (method only used internally) and extend method (superseded by createChild).
* Internally, renamed the _state property to _data and grouped methods by concern.
* Rename config view to PipelineViewer.
* Decouple CollapsibleStatement from if/else using props.children.
* Modify function to take params instead of single object.
* Upgrade styled-components to 3.3.3
* Update test style snapshots
The upgrade seems to have affected the order in which the css classes
are serialized in the snapshot. The css rules within these classes look
identical.
* Update Kibana's yarn.lock
* Update kbn-i18n lockfile in anticipation of #20301
**Interface changes**
There are two goals behind the interface changes:
* Make it clearer which courier modules are meant for public consumption by exporting them from the top level.
* Simplify the courier object by removing responsibilities and focusing its responsibility solely on scheduling search requests via the fetch method and timefilter.refreshInterval Angular event.
I did this by taking the following steps:
* Removing redirectWhenMissing, indexPatterns, SearchSource, and SavedObject from the courier object. I also removed some unused methods from its interface.
* redirectWhenMissing is now a service registered on the kibana/url Angular module.
* indexPatterns is now a service registered on the kibana/index_patterns Angular module.
* SearchSourceProvider and SavedObjectProvider are now top-level exports of ui/courier.
* migrateFilter, decorateQuery, buildQueryFromFilters, and luceneStringToDsl are now top-level exports of ui/courier.
**Internal changes**
I also made some internal changes in an effort to organize the code clearly and reduce unnecessary complexity.
* I refactored the async code in CallClient to appear sync with async/await and encapsulated chunks of logic in helper functions. I also used an isAborted flag instead of overwriting the esPromise var with an enum.
* I combined Looper and SearchLooper into a single class and deleted unused functions.
* I reorganized the courier/fetch/request code into SearchRequest, SegmentedSearchRequest, and serializeFetchParams modules.
* Renamed various other methods and variables to improve clarity.
* use uiSettingsClient instead of angular config service
* replace timefilter service with singleton
* remove all other uses of timefilter service, get timefilter singleton working
* remove Private from brush event
* globalState
* fix timefilter jest test
* clean up rebase artifacts
* lint errors
* another lint error
* fix broken functional test _shared_links
* fix broken mocha test doc.js
* fix service load order breaking status page
* remove Provider from change_time_filter
* another round of mocha test updates
* convert create_brush_handler test to jest
* fix kbnGlobalTimepicker toogle mocha test
* remove _root_search_source - removed in another PR and somehow I added it back during rebase
* better comments around Object.assign and proper js-docs format
* use so listerners get cleaned up when scope is destroyed
* listen to correct timefilter update event
* update APM to use timefilter singleton
* update angular scope when timefilter changes
* fix APM jest test
* add listenAndDigestAsync to listen.js
* fix apm breadcrumbs jest test
* move diffTime and diffInterval into timefilter
* pass mode to updateFilter to resolve functional test failure
* call registerTimefilterWithGlobalState from APM application
* remove rootScope from kbn_global_timepicker
* use to subscribe to timefilter in cases where results need to happen in digest async
* spalger review changes
* ensure monitoring timefilter callbacks are executed inside evalAsync
* remove unneeded evalAsync calls around setTime
* adding generated spec files for xpack endpoints and adjusting code to handle the same override logic
* accounting for non URL documentation values
* fixing issue with incorrect override file
* adding support for unknown parameters in path (assuming they are ids)
* fixing autocomplete for get_categories ml API
* fixing issue with autocomplete for get_overall_buckets
* fixing issue with get_overall_buckets autocomplete
* fixing get_overall_buckets autocomplete issue for reals
* fixing __flag__ in body autocomplete specs
* fixing issue with ml put_datafeed autocomplete
* removing unnecessary overrides for rollup put_job
* fix issue with UrlPatternMatcher
* fixing tests
* fixing typos
* overriding rollup get due to bug in ES specs
* Move <kbn-dev-tools-app> Angular wrapper directive usage into route template
* Move sole directive into new directives folder
* WIP checkin: basic conversion to React components
* Fix sample custom patterns indentation
* Remove custom CSS
* Wrap button in EuiFormRow + define isSimulateDisabled
* Wire up simulate
* Cleanup
* Ace formatting options
* Better styling
* Adding spacing between custom patterns and simulate button
* Fixing form row widths
* Removing form row around button
* Add indentation/newlines in structured output
* Error handling
* Use constants
* Removing no-longer-used code
* Implement syntax highlighting via custom mode
* Making functional tests pass
* Adding trailing comma back
* Removing fixed heights
* Removing unnecessary styles
* Make Event Output form row full width as well
* Wrapping EuiCodeEditors in EuiPanels
* Adding spacer before callout; making spacing around callout consistent
* Clear out custom patterns from request if field is cleared out
* Clear out simulation results before attempting simulation
* Set state with untrimmed value
* typescript screenshot stitcher
* Throw an error if the data captured is not of the expected width and height.
* Import babel-core types
* Add babel-core types to x-pack package.json
* Dimensions => Rectangle
* Separate bulk upload behavior from CollectorSet
- takes out a lot of behavior from CollectorSet and moves it to a class called BulkUploader
- simplifies kibana monitoring init by taking out the indirection that startCollectorSet / createCollectorSet had
- removes start() method from CollectorSet and calls the collector objects' init() functions from CollectorSet.register()
- removes cleanup method from collectorSet since that was doing work for bulk uploading
* remove cleanup and fetchAfterInit methods
* test for bulk_uploader class
* improve test for collector_set
* fix reporting
* expose collectorSet if there actually is a collectorSet
* comment for enclosed function
* make collectorSet creation/expose unconditional, bulkUploader more conditional
* fix collector_set tests
* lifecycle events
* stab at collectorSet error logging from the API call
* clean up comments
* clean up comments
* fix BulkUploader mocha test
* check kibanaCollectionEnabled config before registering bulk upload and the plugin status listeners
* no singleton timer object
* just log a warning if bulk uploader start called twice
* normal quotes
* check if bulk is enabled inside of the _fetchAndUpload method
* log for stopping bulk stats
* call bulkUploader.start with the collectorSet object
* call bulkUploader.start with the collectorSet object
* roll back change for module scoped variable
* oops I broke init
* init and logging: if / elseif / elseif
* remove unnecessary check/log
* help log
* remove redundant, use data.filter.map
* use xpackInfo.onLicenseInfoChange not xpackMainPlugin.status.on('green')
* help logging
* fix unit test
* remove handler that stops upload when connection is lost
Fixes#20017
Currently the xpack_main plugin only sets its status when the elasticsearch plugin changes status, which is a fine signal that the plugin should recheck for the license info, but not the only time it can be updated. At some point recently a race condition became more likely to be triggered, which is detailed in https://github.com/elastic/kibana/issues/20017#issuecomment-398209354 and causes the xpack_main plugin to set its status to red and never return it to green, even after the license info is successfully fetched from Elasticsearch.
To fix this the `XpackInfo` class now exposes the `onLicenseInfoChange(handler)` method which will call the handler whenever the xpack info changes. This way the xpack_main plugin can reflect the current state of the license info in its status and doesn't have to wait for the elasticsearch plugin to change status again.
To test this I recommend running kibana with `--elasticsearch.healthCheck.delay=500` or even `250`, and then starting Elasticsearch after Kibana has started. Without this change Kibana is very likely to attempt a healthcheck between the time that Elasticsearch is "started" and the x-pack license info is completely loaded, triggering the race condition. With this change you should see the xpack info plugin (and all other xpack plugins) go red with a more informative message, and then after the first request or 30 second polling timer, the plugins should go green again.
![screen shot 2018-06-18 at 3 25 47 pm](https://user-images.githubusercontent.com/1329312/41565769-ff032dc0-730c-11e8-978e-3e28ced18448.png)
* Add Inspector feature
* So long, and thanks for all the fish, spy panel
* Fix several functional tests
* Fix unit tests
* Fix spy panel button tests
* Replace old spy panel documentation
* Disable test temporarily until we have dashboard triggers
* Enter edit mode for dark theme test
* Fix some more functional tests
* Fix more functional tests
* More test fixing
* Fix more functional tests
* Allow opening the inspector via loader handler
* Refactor InspectorViewChooser, remove unused CSS
* Remove dead code
* Fix data download button style
* Remove redundant code
* Load inspectorViews for dashboard_viewer
* Extract inspector views to custom core_plugin
* Switch API to TypeScript 🎉
* Design changes
* Remove icons from views
* Design changes
* Improve typings of API
* Add typing to all adapters
* Show loading spinner in request selector
* Rewrite InspectorView to TypeScript
* Fix help text for data view
* Remove deprecated React lifecycle methods
* Embed inspector into dashboard panel actions
* Remove temporary inspector trigger
* Remove old CSS
* Fix dashboard trigger for new panel action
* Add tests for InspectorPanel and DataAdapter
* Produce a hierarchical table if the vis is hierarchical
* Remove allowJs option again
* Add missing Apache license headers
* Close inspector on dashboard when navigating away
* Use proper title for dashboard panels
* Fix functional tests
* Skip broken test for now
* Flush view chooser button
* Add request adapter tests
* Skip more tests, broken due to typescript
* Add Request Time description
* Add description for courier request
* Fix tests
* Replace icon by new (not yet released) icon
* Finalize design of inspector
* Remove discover test, that relied on spy panels
* Change API to be properly mockable in tests
* Add aria-live region for request status
* Replace old method in functional tests
* Replace abitrary magic number
* Use object destructuring in vis
* Fix issue with crashing requests view
* Add request time tooltip
* Get request body of correct search source
* Make filter buttons properly keyboard accessible
* Follow Dave's design suggestions
* Remove redundant request from name
* Remove unneeded comments
* WIP raw-formatted values
* Fix filtering issue
* Fix tests and more license headers
* Add data view tests
* Remove search from table
* Fix typos
* Implement review suggestion
* Remove artificial delays for testing
* Fix new panel action structure
* Minor design adjustments
* Fix failing functional test
* Update failing snapshot test
* Implement final wording
* Apply new EUI styling
* Fix closing inspector in tests
* Fix sorting of table
* Align punctuation between tooltips
* Patch ConfigView changes from x-pack-kibana to OSS Kibana.
* Remove old css.
* Update style for queue statement.
* WIP modifying based on designer feedback.
* Add flatten function and list class.
* Rename functions to be more descriptive.
* WIP checkin. Modify components to handle flattened object list.
* Finish moving flatten logic into classes, add tests.
* Simplify flattening, remove non-native dependency. Add more tests.
* Add defaults to simplify function call.
* Refactor two blocks into a function.
* Begin adapting components for list.
* Add collapse functionality.
* Add expand functionality.
* Nested collapsed elements remain collapsed on parent expansion.
* Style section headers.
* Update Plugin statement styles.
* Add DetailDrawer support.
* Update statement formatting.
* Add stats to plugin element rows.
* Resolve conflicts.
* Remove obsolete code.
* Reorganize code.
* Remove warnings.
* Add PropTypes. Add keys to arrays and iterables.
* Update color for borders/buttons.
* Add stat class. Clean up code.
* Convert plugin statement component from class to function.
* Update queue metrics message.
* Update style to make view more responsive.
* Change section heading size.
* Remove gutter from metrics group.
* Change name "stat" to "metric".
* Remove obsolete export line, simplify declaration, based on PR feedback.
* Add new functional component in place of model class.
* Add PropTypes to several components. Rename a function. Add keys to metrics.
* Convert stateless classes to functional components.
* Prefer ES6 syntax over bindings for Component methods.
* Do not render statement section if there are no statements.
* design cleanup for pipeline viewer
* Update CSS to add min-height to page.
* Rename "elements" to "statements". Delete unused LESS variables.
* Revert naming of "statements" to "elements" for StatementList component.
* Update jest snapshots for DetailDrawer.
This PR upgrades RxJS to version 6 and switches to a fork of `stream-to-observable` which includes an updated version of `any-observable` that supports RxJS 6 until https://github.com/jamestalmage/stream-to-observable/pull/10 is merged. The primary change in this version of RxJS is the movement of stream operators from `Obersable.prototype` to the `rxjs/operators` module. Some of the operators, like `catch` and `do`, have been renamed (`catchError`, and `tap`). The Obsevable factories have also been moved from static methods on the `Observable` class to named exports of the root `rxjs` module. Some of those factories have also changed slightly, like `fromEvent` which now emits arrays if the event handler is called with multiple arguments.
```js
// import the Rx namespace to get the Observable factories
import * as Rx from 'rxjs';
// import the operators as named imports
import { map, tap, switchMap } from 'rxjs/operators';
```
* [Monitoring/No Data] Show a "still waiting" link after 19s
* minor bug fix: spinner if _interval_ updating
* update "we tried"
* some wording changes on activating / trying to activate monitoring
* cancel the setTimeout when component gets unmounted
* more wording tweaks
* update snapshot
To get rid of angular's tooltip="..." code in the header of data cards of the data visualizer, this introduces a ml-field-title-bar directive/component.
- The directive replaces the raw template code in field_data_card.html.
- The directive itself wraps a React component which uses EUI's tooltip instead of angular's tooltip attribute.
- The previous angular template logic (about which classes and fieldnames to display) is also move to the React component
- Fixes an issue with cut off text within aggregation type dropdowns in the multi-metric and population wizard.
- Fixes the style of the dropdown to be consistent across browsers.
- Fixes 1px vertical offset between dropdown and trash-icon.
- Deprecates the use of jQuery to render the swimlanes axis labels and uses d3's axis component instead. We already used d3 features like d3.scale and others to calculate the label positions but the DOM rendering was still done using jQuery.
- Additionally, adds some logic to remove/fix overlapping labels.
1. Increases the top margin to 5 and the right margin to 1 to avoid cutting off the chart because overflow is hidden for the directives mlEventRateChart and mlMultiMetricJobChart. The top margin gives enough room to avoid cutting off y-axis labels. The right margin is a tweak to not cut off the gray border by 1 pixel to the right.
2. Fixes how the domain for mlEventRateChart is calculated. The domain gets now extended by 1 barsInterval, otherwise the last bar will start at the end of vizWidth and overflow the chart (the overflow is hidden so the visible chart missed one bar).
* adding documentation links when the endpoint is known
* making doc link reflect version user is using
* adding documentation links for xpack APIs
* fixing missing argument issue
* removing console log
* fixing issue with lingering documentation after text is deleted
* fixing issue with documentation and multiple commands in the editor
* adding $scope.$apply so documentation changes show up in UI
* removing dead code
* adding missing boost param for match_all
* fixing issue with parameterized endpoint completion
* adding keyboard shortcut for opening documentation for current request
* fixing issue with keyboard docs shortcut when you just move the cursor around
* refactoring to class style and moving components to own files
* making top level components fetch sensitive to HTTP verb
* fixing issue with _ endpoints getting mistaken as index names for autocomplete possibilities:wq:
* removing stray console log
* removing console log
* PR feedback
* accounting for _all in isNotAnIndexName
* Move all reporting tests into their own folder to allow for multiple kibana.yml configuration tests, including chromium
* Add debugging and try to skip other tests an jenkins to speed things up
* More debug output
* more logging (remove other line which failed on jenkins)
* Remove no sandbox flag, it doesn't help
* Add fix for socket hangup and clean up tests
* fix path to logstash_functional
* Extend timeout for chromium, add verbose logging, add better comment, conditionally output curl command
* fix path... again
* Ah, other functional tests still need access to reporting page object, put it back
* fix sp err
* Add debug logs for screenshot stitching for png.bitblt error
* Fix tests that don't pass logger to screenshotStitcher
* Fix logger being undefined
* Add more debug output
* png has data, too much info to spit out
* Add comment with link to issue for extra debug messages so they can be left in since so many passes
* Dont use spawnSync with curl, use http.request instead, more support for it
* Comment out chromium tests for now to avoid flakiness
* Wait... lets at least make sure the other fix worked (the http.request instead of spawnsync and curl)
* New http.request code doesn't seem to work on jenkins, timing out after 10 secs maybe
* go back to spawnsync to see if it's an issue with the rxjs code or the http.request code
* I think I figured it out...
* Comment out tests to avoid flaky png error in the screenshot stitcher
* Use a const for OSS archive path
* use path.resolve correctly.
* [X-Pack Usage API] use authentication from request headers
* add test for usage api no-auth
* whitespace / syntax nits
* reduce loc changed
* remove a weird looking comment
* Renaming client to service
* Implementing the SavedObjects service and client provider
* Making saved objects service lazy instantiated so the test server works
* Fixing import
* Fixing another import
* Fixing reporting's usage of the savedObjectsClientFactory
* No longer passing the callCluster function to the kbnTestServer
* Passing empty request...
* Fixing reporting
* Exposing server.savedObjects without a getter
This required me to remove the kbnTestServer.createServer() method and
change all usages to createServerWithCorePlugins since we're reading the
kibana.index, which is part of the core plugins, when configuring the
saved objects service which is attached to the server.
* Don't need to set kibana.index
* Changing more usages of kbnTestServer.createServer
* Revert "Changing more usages of kbnTestServer.createServer"
This reverts commit 464f73abb2.
* Partially reverting 17d36b3e9a
* Fixing headers
* Improving tests
* Addressing some peer review feedback
* Addressing more peer review feedback
* Adding server.log warning when the saved objects can't initialize
* Getting rid of the savedObjectsClientFactory
* Branches are for trees
* Fixing comment to be proper english
* Fixing fat-fingering method call
* Fixing other usages of getScopedSavedObjectsClient
Basic licenses never expire, so they do not have an expiration date at
all according to the Elasticsearch API. When this happens, we should not
attempt to parse the date nor show the expiry date in the log.
This adds a notification service to Kibana that can be used to send
asynchronous notifications, such as sending email and Slack messages,
which are intended to be configured via a combination of the
`kibana.yml` and Kibana keystore.
Once configured, the actions are automatically added to the notification
service and can be invoked via the server using the `notificationService`
singleton or HTTP to send it directly. See the included README for more
details.
* Add flatten function and list class.
* Rename functions to be more descriptive.
* WIP moving flatten logic to classes.
* Finish moving flatten logic into classes, add tests.
* Simplify flattening, remove non-native dependency. Add more tests.
* Add defaults to simplify function call.
* Refactor two blocks into a function.
* Fixed broken test.
* Update classes based on PR feedback.
* Update module exports, remove obsolete file.
This PR is a pretty small change to the Reporting job complete notification service. It converts the actual code to a simple object, instead of a class that needs to be instantiated. This makes the notification service a singleton, and also exports it so it can be used in non-Angular applications.
- Converts `reportingJobCompletionNotifications` factory to a singleton
- Exports the underlying jobCompletionNotifications
- Allow use in non-angular plugins
Example use:
```js
import { jobCompletionNotifications } from 'plugins/reporting/services/job_completion_notifications';
createReportingJob() // pseudo code function that returns a reporting job id
.then(jobId => jobCompletionNotifications.add(jobId));
```
* [XpackMain] Add _xpack/usage API
* add xpack usage http api integration test
* comment
* misc test describe fixes
* fix integration test
* fix reply called twice
* enable api test
* enable kibana collection for integration test to work
* throw error comment
* Add some collector classes for objects that get registered in a CollectorSet
* comment cleanup
* don't pass an inline-defined logger to collectorSet
* add a helper logger function so collector has access to logger at construction
* Ensure all true/false statements are nested in IfStatements.
* Simplify nested vertex diffing.
* Rename get vertices function and test it.
* Update tests, add more tests.
* Update prompted by review feedback.
* Update tests - add required props to provided objects.
* Remove unneeded function/tests.
* PR Cleanup.
* [ML] Adding jsconfig file for better code navigation in vscode
* removing allowSyntheticDefaultImports as it is defaulted to true
* cleaning up paths
This fixes the component structure of the file type icon: The container component no longer needs to be wrapped inside a span element for the tooltip to work by using the recommendation to pass on the props to the first inner element (see elastic/eui#839). Also adapted a jest test which tests the hovering behavior and fails when the props are not passed on.
Fixes jest tests for the bucket span estimator button. The tests were not correctly considering the way jest runs tests asynchronously. Now each test is self-contained within the test callback.
Migrates the field-type-icon directive to use EUI/React. Instead of the angular/bootstrap tooltip attribute on the directive's tag, there's now an option tooltip-enabled which when true wraps the component inside EuiToolTip.
This migrates the bucket span estimator button to use React/EUI. The existing mlBucketSpanEstimator is refactored to use React without ngReact to have more detailed control in regards to the $scope being transformed to a trimmed down props object with only the information necessary for the React component. This also allows more control in regards to the $scope attributes being watched. Instead of custom styles and classes this now uses the options available for EuiButton. However, there were some minimal overrides necessary to the EUI styles to replicate the narrower height and padding to fit within the input element.
This replaces the angular based tooltip used in the ml-info-icon directive with one based on React/EuiTooltip. It supports transclusion and rendering of angular template snippets inside the tooltip. Because the DOM structure of the EuiTooltips and the angular/bootstrap tooltips is quite different there is a bit more code involved to achieve this, but the result is that for this we don't have to change the markup in the original angular templates where ml-info-icon is used.
* [Monitoring] Add a yellow status phase in the startup lifecycle
* comments
* more comments
* more comment
* undo register => registerType function name change
* capturing refactoring work in progress
* cleanup
* removing 5.0 API
* updating autocomplete aggregations to supported ones
* adding documentation links to generated specs
* progress on ace upgrade
* further progress
* cleaning up
* adding new minified source for worker
* fixing bug with merging API definitions
* addressing PR feedback
* using raw loader to load worker file
* addressing PR feedback
* fixing bad characters in comments
* removing inadvertent change
* fixing scope links
* fixing a couple of scope links
* adding in exists to query dsl
* adding slop param for match_phrase query
* adding autocomplete support for search params
* Revert "using raw loader to load worker file"
This reverts commit 16d33c189c.
* adding rescore API support for autocomplete
* adding index boost API support for autocomplete
* adding collapse to autocomplete
* adding highlight property support to autocomplete
* fixing issue with highlight
* adding support for common terms query
* adding inner hits support for autocomplete
* adding support for newer match options to match and multi_match
* better solution for worker
* [kuery] Remove `byName` dependency
* Remove $http from kuery
* Fix test
* Add request headers
* Replace byName with getFieldByName; add isFilterable
* Replace Angular mock with static mock
* Update index pattern for query bar
* manually attach format.convert method to field
* Use KBN_FIELD_TYPES to determine isFilterable
* Bump yarn.lock file
* Add kfetch (Kibana fetch)
* Moved `getFromLegacyIndexPattern` to static index pattern functions
* Fix tests
* Mock out kfetch
* Move value formatting from getRangeScript to buildRangeFilter
* Remove getFieldByName (over abstraction)
* Split kfetch options into two
* [Monitoring/React] Render ES Indices Listing with Base Controller
Refactors the ES Indices Listing to use Base Controller and a React component instead of an Angular directive
* fix functional tests
* fix another test
* better default for summary status component
* nicer code for whitespace after label
* apiFn => apiUrlFn
* Deleted / Closed
This re-enables the feature flag to support selecting a range of cells in the anomaly explorer. Follow-ups to this PR will tackle limiting the allowed cells to select to avoid problems with too wide selections.
* [Monitoring/Beats] Telemetry Data from Beats
* filter apm-server
* ignore results payload if hitsLength === 0
* process each payload as stats are saved to clusters object
Fixes the data binding of focusForecastData to renderFocusChart(). An update to focusForecastData in MlTimeSeriesExplorerController wasn't correctly picked up by the directive mlTimeseriesChart because the relevant data wasn't being watched.
The mlChartTooltipService's hide() method was inside the show() method scope. If hide() was called before show() was called for the first time this would result in an error. This could have happened in angular directive's which called hide() on some cleanup action without a previous call to show(). This fix moves the hide() method outside the show() method's scope and adds a unit test to check for the correct structure of mlChartTooltipService.
* Change pipeline editor markup so bottom border doesn't hide text on last line.
* Add constants for scroll margin size.
* Add comments to editor constants.
* Add PX units to constant names.
* Update to grok debugger editors: let them grow taller and stop hiding half of bottom line input.
* Update custom pattern size to 10 LOC.
* Remove unnecessary options, add constants for scroll margin.
* Encapsulate editor options in mutate function.
* Move editor helper file and prefer "function" declaration over ES6 const.
* Add test for new helper function.
* [ML] Convert Explorer Influencers List to EUI/React
* [ML] Remove unused abbreviate_whole_number Angular filter
* [ML] Convert React Influencers List to stateless function
* [uiExports] migrate uiApp "uses" to explicit imports in apps
* [uiApp] update tests for getModules() method
* [optimize/uiExports] improve naming and comments
* [uiExports] sort imports so they load in the same order as before
* [testHarness] load hacks when testing in the browser
* [x-pack/uiExports] use new uiExports modules
* [testHarness] describe why we import uiExports/hacks
* [optimize] remove needless [].concat()
* [optimize/createUiExportsModule] string.includes > string.indexOf
* [uiExports/createUiExportsModule] remove needless capture of module exports
Fixes an issue with the anomaly table not correctly updating in the anomaly explorer and the anomaly markers not showing up in the time series viewer.
- moves the initialization of scope.anomalyRecords = []; to the controllers of anomaly explorer and time series viewer. having it in the anomaly table directive caused a race condition to overwrite already fetched records.
- use $watchCollection instead of $watch to track anomalyRecords and focusChartData changes.
replaces $timeouts with scope.$evalAsync
- fixes how focusChartData gets updated correctly to fix missing anomaly markers in the time series viewer.
* [ML] Removing angular from services
* removing commented out code
* fix include path for tests
* adding flag to initPromise
* moving job service for jest tests to pass
* moving initPromise to its own file
Fixes an issue where the anomaly table wouldn't load because a broadcast to renderTable was triggered before the anomaly table directive initialized the corresponding listener. This change replaces the use of broadcast and instead uses $watch to listen on scope changes on the specific attributes relevant to the updates. The updating of code in parent scopes was moved inside the $timeouts instead of the broadcast event.
This adds an additional check and corresponding error message to the validation of the model memory limit. If the parsing of the memory model limit results in 0 bytes the message will be triggered. This behaviour catches both correctly formatted but invalid strings (like 0mb) and invalid strings (like asdf).
Updates the behaviour of the job validation's model memory limit checks: The success messages success_mml gets only returned if the checks were actually run. This omits the success message for example in the single metric and population wizard.
Inconcistencies between AppState and derived custom states for UI components like mlSelectLimit and mlSelectInterval could trigger errors because the parent of a nested object attribute could become undefined. This PR adds additional checks to state_factory.js's get/set/reset methods to reinitialize itself with AppState and fall back to its default state should it not be present within AppState anymore. The original issues were hard to reproduce consistently using the UI only. However the error could be triggered when creating a malformed URL, like replacing the mlSelectInterval:(interval:(display:Auto,val:auto)) part of the URL to something like mlSelectInterval:(undefined). This PR includes additional unit tests which simulate this behaviour and fail without the additional checks provided by this PR.
* [console_extensions] disable when console is disabled
* [console extensions] has console and enabled
* [console_extensions] fix console_extensions.enabled
* Adding basic syntax highlighting for grok expressions
* Use EUI color palette
* Handle regex tokens, escaped and unescaped
* Return token for escaped content
* Add functional test
* Using higher-contrast colors
* Removing comment I used for developing the highlight rules
* Using object destructuring
* Removing unnecessary method
* Extracting constant for reuse
* Keep track of recently-deleted pipelines until Monitoring stops reporting them
* Adding explanatory comment for constant
This reduces the output from the clusters API in the data processing stage.
Mainly, it throws away a lot of unused fields in `elasticsearch.cluster_stats` and `elasticsearch.cluster_state`
cc @rasroh
* update to eui 0.0.44
* keep eui dependency in x-pack
* wrap EuiBasic table column in span to avoid className prop from getting overridden
* remove brittle functional tests that are no longer needed with EUI components
* filter field list instead of chaning table size
* update x-pack snapshots
* [Monitoring/React] Render ES Nodes Listing with Base Controller
Refactors the ES Nodes Listing to use Base Controller and a React component instead of an Angular directive
* remove another obsolete file
This changes the Advanced Node page for Elasticsearch to recognize the
"write" threadpool, while also incorporating the deprecated "index"
threadpool and renamed "bulk" usage (renamed to "write").
This sums the three writing threadpools together and displays it as a
unified view.