* [APM] Fix some warnings logged in APM tests
(Seemingly) since the React upgrade in 439708a6f9, our tests have started logging various warnings/errors to the console. The test suite is still passing but it creates a lot of noise.
Changes:
- use `act` or `wait` when appropriate
- mock useFetcher calls
- cleanup in useDelayedVisbility
* Replace tick() with wait()
* Prototyping adding Visualization to Dashboard
* i18n fixes
* Remvoing dashboard empty screen directive
* Updating test for empty dashboard screen
* Removing unused state variable
* Adding a test for DashboardViewPort
* i18n & minor fixes
* Fixing fullscreen mode view
* Fixing failing functional test (hopefully)
* Minor style fix
* Fixing EUI text, rendering empty screen OR the panels
* Fixing empty screen in fullscreen mode
* Update snapshot
* Trying to render empty screen from Angular controller
* refactor: 💡 don't pass renderEmpty through inputs
And make sure isEmptyState is not stale.
* Fixing tests after Vadim's commit
* Removing unnecessary isEmptyStateProps
* Skipping failing test
* Removing unnecessary en.json file
* Re-adding emptyState, reintroducing functional test
* Fixing ja-JP file
* Undoing my thing to the functional test
* WiP, lotta broken things, working through new editor.ts
* RowParser -> TS
* Utils to TS and regular module
* Finished first version of core & sense editor wrappers. Tokenizer provider test working. Still need to delete some files
* WiP - moved A LOT of code around and busy fixing sense-editor tests
* Fix sense editor test
* Clean up mocks
* Moved A LOT of code out of quarantined.
Still working on sense editor's integration test
Not running yet.
* WiP still finishing up manual testing
* Fix use of Ace Range and fix open documentation
* Move out of quarantined!
* Remove load remote editor state for now
* - fix use of token iterator
- remove ace ranges from sense editor spec and fix spec 🤦
* Address getSelectionRange document TODO
Clean up use of jquery
Remove use of `done` inside async tests (input_tokenization.test.js)
Capitalize elasticsearch
Introduce helper for converting to AceRange inside legacy core editor
Update typings
Clean up imports
Cleaner variable assignment
* Update src/legacy/core_plugins/console/public/np_ready/application/models/sense_editor/curl.ts
Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>
* Remove commented-out code
lib/utils.js -> lib/utils.ts
Rename engulfling range (sense_editor)
* Rename format request function
* utils.ts default export usage cleanup
* Update replace regex and add another utils test
* Remove legacy replace behaviour
* Fix typo in comment
* chore(NA): add log options to config yml
* chore(NA): remove unwanted option from config declaration
* chore(NA): add the bootstrap for the logging rotate feature
* feat(NA): base interface setup for log rotation feature
* docs(NA): add documentation for the new logging rotate options. chore(NA): added new schema validations
* chore(NA): base lifecycle methods and logic
* feat(NA): monitor logic for log rotate feature
* fix(NA): basic log rotation lifecycle
* chore(NA): fix typo on config file
* feat(NA): add rotate files feature to log rotator
* chore(NA): fix log rotate config
* chore(NA): some tests to try logging rotate lifecycle
* feat(NA): correct log rotation logic
* fix(NA): lifecycle for the log rotator
* test(NA): add a test case
* chore(NA): correctly add the new defaults to the config schema
* test(NA): change dir generation for test
* chore(NA): mock log rotate for logging service test
* test(NA): fix temp dir permission issue
* test(NA): try to fix test
* chore(NA): remove usage of mkdtemp
* refact(NA): feature logging rotation reimplementation in order to make it work across platforms
* fix(NA): bug on file size monitor handle
* fix(NA): remove wrong commented out code
* chore(NA): correctly identify if we should use polling
* chore(NA): fix some code comment
* refact(NA): minor implementation details
* chore(NA): change the order of logging mix
* test(NA): add some more test cases
* test(NA): add the majority of the test cases
* test(NA): add last test case
* test(NA): fallback conditions
* chore(NA): add logging rotate config keys to the docker image
* chore(NA): move logging.rotate.enable setting to enabled
* chore(NA): clarify documentation for logging rotate
* chore(NA): use regular instead of logWithMetadata
* chore(NA): move chokidar to a prod dep
* chore(NA): add log explaining why we had fallback to use polling
* test(NA): fix unit tests
* test(NA): fix unit tests
* chore(NA): correctly place this.running condition
* chore(NA): remove redundant call
* fix(NA): log filename containing numbers would produce invalid sorting
* chore(NA): remove existsSync function call from readRotatedFilesMetadata function
* chore(NA): Update docs/setup/settings.asciidoc
Co-Authored-By: Tyler Smalley <tylersmalley@me.com>
* chore(NA): Update docs/setup/settings.asciidoc
Co-Authored-By: Tyler Smalley <tylersmalley@me.com>
* chore(NA): Update docs/setup/settings.asciidoc
Co-Authored-By: Tyler Smalley <tylersmalley@me.com>
* chore(NA): Update docs/setup/settings.asciidoc
Co-Authored-By: Tyler Smalley <tylersmalley@me.com>
* chore(na): update src/legacy/server/logging/rotate/index.js
Co-Authored-By: Tyler Smalley <tylersmalley@me.com>
* chore(NA): remove unused config line from docker vars
* chore(NA): update documentation to include info about non exact limits
* chore(NA): remove redudant if clause
* fix(NA): correctly work with new keepFiles limit after start
* fix(NA): warning log for logging rotate
* chore(NA): replace logwithmetadate with log
* docs(NA): correct log to right terms
* docs(NA): add comment about usage of slice(-1)
* refact(NA): changing polling interval from seconds to milliseconds
* docs(NA): fix comments for shouldRotate method
* chore(NA): update src/legacy/server/logging/rotate/log_rotator.js
Co-Authored-By: Mikhail Shustov <restrry@gmail.com>
* chore(NA): update src/legacy/server/logging/rotate/log_rotator.js
Co-Authored-By: Mikhail Shustov <restrry@gmail.com>
* refact(NA): small change
* refact(NA): bound stop
* refact(NA): shouldUsePolling test function
* refact(NA): move named truncate function to delete
* refact(NA): typescript conversion
* chore(NA): type update for log rotation index file
* docs(NA): add experimental tag on docs
* chore(NA): add call protection of clearTimeout
* refact(NA): cleanup comments and wrong added logs plus inline config
* chore(NA): replace ts-ignore by non null assertion operator
* docs(NA): extend documentation for _renameRotatedFilesByOne call
* chore(NA): fix type problems for process.emit on nodejs
* Denormalize actionTypeId for easier filtering of alerts
* Add tests
* No longer pass actionTypeId for each alert action in APIs
* Add tests to ensure denormalizeActions works on multiple actions
* Fix ESLint errors
* Use char by char typing in all text fields
* Add dely before first typed charakter when typing char by char
* Remove delay before typing again
* Use clearCharByChar option for input fields
* Revert "Use clearCharByChar option for input fields"
This reverts commit e412d7bc64.
* Revert "Use char by char typing in all text fields"
This reverts commit 2fbccc57c6.
* Disable jobCreatorUpdate for tests
* Revert "Disable jobCreatorUpdate for tests"
This reverts commit e178fd82ab.
* Check typing char by char for job wizard inputs
* Remove .only from anomaly detection suite
* Move setValueWithChecks from testSubjects to a ML service
* Mark incoming plugin members as readonly
These cannot and should not be modifiable.
* Use env var instead of EnvironmentMode
* There doesn't appear to be an EnvMode in the new platform
* We're only using envMode to check whether we're in production
* We're already using process.env.NODE_ENV elsewhere
We can revisit this, but for now I'm simplifying things under this
assumption.
* Pass our setup context to the compose function
We're going to retrieve our router instance from this, for now.
* Remove unused static files route
I spent a few minutes trying to do this in the new platform, only to
realize that this was cargo culted from another plugin's structure and
never used.
* WIP: convert main GraphQL endpoints to New Platform
Splits the existing dual-method route into separate GET/POST
routes, while converting it to the NP routing syntax
TODO:
* Full route schema declarations
* Address context being moved off of the response object and into its
own object; callWithRequest is currently broken for this reason.
* Remove unnecesary Request type
While the defaultIndex patterns can be retrieved on the request itself,
that requires this special case of our FrameworkRequest.
In my smoke testing, the incoming `indices` argument was never different from
the one present on the request payload. Xavier had mentioned that these
might be redundant and a relic of some quick prototyping, so I'm going
to simplify this logic and delete that type under this assumption.
* Retrieve Elasticsearch client from RequestHandlerContext
In order to minimize the amount of noise on this refactor, I'm adding
the RequestHandlerContext to the existing FrameworkRequest object that
we already pass around.
This also removes some adapter methods that were cribbed from infra but
have since become unused. There are likely more.
* Use uiSettings client from RequestHandlerContext
Pulls from the new platform instead of from request.server.
* Remove unused properties from RequestFacade
One of these was obviated by the refactor to NP routing; the other may
never have been necessary.
* Remove unused interface
This is a relic that is no longer used in the codebase.
* Make error response code dynamic
* Handle GraphQL errors
Refactors to use new platform's responses instead of Boom.
Unless we intentionally do not want isGraphQLError error headers, I saw no
reason for the latter two branches of this method (and merged them).
* Fix graphiQL route
We needed to loosen the restriction on our main POST graphQL route, as
the requests coming from graphiQL do not match our normal format.
* Clean up logging
* Remove unused var injection functionality
I could not find a case where we were using these vars within the siem
app.
* Fix typo on config fetching
* Migrate to NP IndexPatterns service
* Removes unused extra parameter on callWithRequest
* I think this was a relic from the infra code
* Clean up typings of callWithRequest
* GenericParams is, ironically, not generic enough to handle all ES
client calls. Instead we type it as Record<string, any> but ensure
that our function adheres to the APICaller interface.
* Use savedObjects client in request context
These resolvers already receive a request containing the NP context, so
we can retrieve our client directly from that, now.
* Rename dependencies -> plugins to match kibana.json
* Remove unnecessary type annotation
The type of callCluster is already checked due to being passed to the
IndexPatternsFetcher constructor.
* Add siem plugin to new platform
For now this just generates a config observable with some defaults;
everything still lives in the legacy plugin.
* WIP: flattening out plugin initialization
Rather than pass our legacy API around everywhere, let's be explicit
about who needs what, and start flattening things out so that we can
move the legacy-independent stuff over.
* Pass our plugin context to initServerWithKibana
We can get the NP equivalent of `pkg.version` from
context.env.packageInfo.version, so let's do that and remove a usage of
config().
* Simplify siem configuration
As far as I can tell, the only siem config that we're using is
`xpack.siem.enabled`. The `query` was a holdover from infra, and if
we're using the `sources` queries at all, it's only with the default
values. Since our config is not typed, trying to add `sources` config
only results in runtime errors.
This removes the KibanaConfigurationAdapter entirely, and instead passes
what is effectively { sources: {} } to the SourcesConfigurationAdapter.
* Run all legacy-free setup through our plugin
Once this is vetted, we should be able to move the entire tree under the
plugin into the new platform plugin. We can inline the compose and
init_server calls into the plugin once things are vetted and stable; for
now leaving them there cuts down on the diff.
* Temporarily ignore our unused config declaration
* Fix detection engine route tests
While we're passing a properly bound route function in the app, the
tests' interfaces needed to be updated. Adds a helper method for
retrieving a bound route function from a Server object.
* Add some rudimentary schema validation to our graphQL endpoints
* Remove defunct server.config fn
The last remaining usage of this config was removed in #51985.
* Group our dev endpoints together
The graphiQL endpoint is the only thing that currently uses the GET
endpoint; everything else that talks to graphQL uses POST. For that
reason, I'm putting them in the same scope (along with annotating here)
to make that a bit clearer.
* Determine environment from plugin context
The kibana platform did and does provide this interface to check with
environment we're running in.
* Migrate xpack_main to NP features service
* Fix some issues missed in the previous merge
DE added some dependencies on both the server and request objects. Most
have NP equivalents and can be converted, but for now let's just add
them back to the Facades and convert in another PR.
Also changes one function to pull plugins from the server object, rather
than the server object living on the request (as this is how similar
functions are structured right now).
* Fix type resulting from bad merge resolution
* Fix type error due to incorrect usage of Hapi.Request
Pull elasticsearch service off our legacy server object, rather than
indirectly off the request object. Still legacy, but it's one less step
for later.
* Fix filter matches index for filters with partial meta
* Abort discarded KQL value suggestion requests
* Abort server-side connection to ES
* Fix failing test
* Add automatic support for nested fields in existing filter types
* Index pattern could be undefined
* add test for handleNestedFilter function
* remove console.log
* add tests for all "getFilterField" functions
* update migrateFilters to work on full filter objects so that it doesn't
have to worry about queries that have been wrapped with `nested`
* add test to ensure fromFilters auto wraps filters on nested fields
* Add smoke test for nested filter and move filter editor tests into
their own suite for easier running and debugging
* fix bad type change
* dedupe filterToQuery logic
* fix helper that wasn't doing what it said it did
* Convert test from pre-merge to jest
* Use new time range style
* Add simple visual test for fullscreen workpads in Canvas
* Adding canvas to the config
* Adding sample data visual tests
* Refactor to use new helper method
* Reverting sample data visual test for now
* Forgot to add the awaits
Created management plugin under core_plugins.
Filled the plugin with 2 services: IndexPatternManagementService and SavedObjectsManagementService.
Removed related codes in ui/management and changed the paths.
* License Management public -> NP
* - Server to NP
- Slight update to filepicker style (center it)
* Fix snapshots and types
* Server-side: separate new and legacy dependencies [skip ci]
* Fix license upload route after refactor
* Client side: separate new from legacy dependencies
* xpackInfo -> xPackInfo
* Fix types [skip ci]
* Remove kbnUrl, autoLogout. Add history and update paths.
* Update upload license test
* Remove use of legacy chrome, remove use of k7breadcrumbs, replace some common strings with variable and use NP i18n