* Move fp-ts and immer to "." package.json
* Revert "Move fp-ts and immer to "." package.json"
This reverts commit b876df0d54.
* Second attempt, fp-ts and immer -> root
* fp-ts -> 2.3.1
* Revert x-pack/package.json
* Update fp-ts in x-pack/package.json
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Instrument Kibana with APM RUM agent
* make route-change transaction work with properl url
* extract page-load transaction url from app link
* check if app is hidden and set active:false
* make distributed tracing work and merge config
* remove config/apm.js and address review
* address review comments
* add apm.js to build tassks
* move apm from dev to src
* add @types/hoist-non-react-statics which is required by react rum
* apply changes correctly from master
Adds a `runNow` api to Task Manager, allowing us to force the refresh of a recurring task.
This PR includes a couple of sustainability changes as well as the feature itself.
1. **Declarative query composition.** At the moment the queries in the TaskStore are huge JSON objects that are hard to maintain and understand. This PR introduces a pattern where the different parts of the query are composed out of type-checked functions, making it easier to maintain and to construct dynamically as needs change. _This was included in this PR as the **markAvailableTasksAsClaimed** query needs different query clauses depending on whether there are specific Tasks we wish to claim first.
2. **Refactoring of the Task Poller** As the `runNow` api is introduced we find Task Manager's lifecycle in a weird state where it has both a _pull_ model, where timeouts & callbacks interact without having to responsd to any external requests, and a _push_ model where requests are made to the new `runNow` api. Balancing these two proved error prone, hard to maintain and had the potential of _lossy_ behaviour where requests are dropped accidentally. To address this TaskPoller has been refactored using Rxjs observables, remodelling the existing _pull_ mechanism as a _push_ mechanism so Task Manager can _respond_ to both _polling_ calls and _runNow_ in a similar fashion.
And ofcourse the main feature of this PR:
3. **runNow api** An api on TaskManager that takes a _task ID_ and attempts to run the task. The call returns a promise which resolves with a result which notifies the caller when the task has either completed successfully, or result in an error.
Ensure no deprecated Node.js core API's are used in Kibana. This is
achieved by throwing an error in either development mode or in CI if one
of the deprecated API's is called, and as such, new PR's should no
longer be able to be merged if they use deprecated API's.
Some of these API's (like the `Buffer` constructor`) is a security risk.
This adds an absolute session timeout (lifespan) to user sessions.
It also improves the existing session timeout toast and the overall
user experience in several ways.
* run mocha tests from x-pack with root mocha script
* Only run Karma tests in xpack intake job
* disable failing suites
* fix typo
* skip correct suite (there are multiple root suites)
* support disabling junit reporting with $DISABLE_JUNIT_REPORTER
* don't generate junit in ispec_plugin tests
* eui to 16.0.0
* type defs
* card click
* snapshot updates
* time format test updates
* ts return
* integration fix
* async
* more time format fixes
* more time format fixes
* test updates
* add uisettings dateformat timepicker test
* after method to clear setting
* Update dependency rxjs to ^6.5.3
* move argument type def up for better coverage
* adapt to possibly undefined helpExtension
* complete definition of deprecation$ type
* define types that bindNodeCallback can no longer infer
* define more types that bindNodeCallback can't infer
* be more explicit and accurate about the types for a subject/observable pair
* fix interface error, TS now identifies it
* ignore a return type flaw because types are not being managed properly
* avoid overspecifying types
* allow types to be inferred where possible
* remove unnecessary withLatestFrom()
* reduce number of rxjs versions installed
* update kbn/pm dist
* Update moment related packages
* unify moment version in yarn.lock
* adapt ro pluralization fixes
* update some bad pluralization in fixtures/snapshots
* [npm] Removes react-clipboard.js
Added in the original commit of APM, but does not appear to still be used.
* [npm] Remove redux-test-utils
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Added in https://github.com/elastic/kibana/pull/18885 as part of the
RxJS 6 upgrade and used in the screenshot stictcher, however it is not
longer used.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Originally added in https://github.com/elastic/kibana/pull/19236 as part
of the notification service, however it's no longer used.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* [npm] Remove babel-plugin-mock-imports
Originally added as part of
https://github.com/elastic/kibana/pull/22695, however, it doesn't appear
to have ever actually been used.
* [npm] Removes gulp-multi-process
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Added when X-Pack was closed-source and
import/no-extraneous-dependencies was implemented. Does not appear to
still be used.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* We have a NP plugin! :celebration:
* Redirecting to login on all 401s
* Adding commented out code for when credentials are omitted
* Fixing types
* Respond 403 when user changes password with incorrect current password
* Adding AnonymousPaths where we ignore all 401s
* Adding anonymous path tests
* Extracted a dedicated SessionExpires class and added tests
* Fixing plugin after refactoring to add SessionExpired
* Beginning to work on the session timeout interceptor
* Fixing UnauthorizedResponseInterceptor anonymous path test
* Removing test anonymous path
* Trying to improve readability
* Displaying session logout warning
* Mocking out the base path
* Revert "Mocking out the base path"
This reverts commit 824086c168.
* Changing coreMock to use a concrete instance of BasePath
* Adding session timeout interceptor tests
* Adding session timeout tests
* Adding more tests for short session timeouts
* Moving some files to a session folder
* More thrashing around: renaming and reorganizing
* Renaming Interceptor to HttpInterceptor
* Fixing some type errors
* Fixing legacy chrome API tests
* Fixing other tests to use the concrete instance of BasePath
* Adjusting some types
* Putting DeeplyMocked back, I don't get how DeeplyMockedKeys works
* Moving anonymousPaths to public core http
* Reading sessionTimeout from injected vars and supporting null timeout
* Doesn't extend session when there is no response
* Updating docs and snapshots
* Casting sessionTimeout injectedVar to "number | null"
* Fixing i18n issues
* Update x-pack/plugins/security/public/plugin.ts
Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>
* Adding milliseconds postfix to SessionTimeout private fields
* Even better anonymous paths, with some validation
* Adjusting public method docs for IAnonymousPaths
* Adjusting spelling of base-path to basePath
* Update x-pack/plugins/security/public/session/session_timeout.tsx
Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>
* Update src/core/public/http/anonymous_paths.ts
Co-Authored-By: Josh Dover <me@joshdover.com>
* Update src/core/public/http/anonymous_paths.ts
Co-Authored-By: Josh Dover <me@joshdover.com>
* AnonymousPaths implements IAnonymousPaths and uses IBasePath
* Removing DeeplyMocked
* Removing TODOs
* Fixing types...
* Now, ever more normal
* Update dependency del to v5
* unify del/rimraf usage with del v5
* update yarn.lock
* update kbn-pm distributable
* remove poorly transformed code
* force some deletes from tmp
* mock less of the fs module
* force tmp deletion in a few more suites
* please make this the last force
This removes the outdated and unused 0.x version of `constate` and instead depends on a recent version. It also removes the aliasing to `constate-latest`.
closes#48606
This package is only being referenced in OSS Kibana, though it was
defined in X-Pack causing issues for OSS builds.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* Add file parse chunking, update component on progress
* Clean up clean and validate and redo to process single features
* Add oboe dependency
* Prevent state updates on cancel
* Handle new files added mid-way through parsing another file
* Fix issue where subsequent index name is wiped out when previous file cancelled
* Remove unneeded oboe abort logic
* Dice parsing logic up further for testing
* Clean up
* Revert "Fix issue where subsequent index name is wiped out when previous file cancelled" (covered in separate PR)
This reverts commit 0688e73ffc.
* Update file parse test to focus on different stream states
* Update clean and validate tests to reflect function input/output changes
* Bump up file buffer. Simplify ui update logic, not neceesary to throttle with less frequent callbacks
* Show features parsed on UI rather than percentage
* Remove extra mock reset
* Review feedback. Add localized feature tracking callback
* Review feedback. Add comment explaining progress update throttling. Also, use debounce to throttle
* Remove console log
* Consolidate feature handling into one function passed to oboeStream node
* Abstract oboe logic to separate class and import for use in file parser
* Update file parser test to mock PatternReader import
* Prevent file parse active flag from resetting if another file is in progress
* Don't pass back result if no features found on complete, throw error with feedback. Add clean-up for prev PatternReader
* Use singleton version of jsts reader & writer. Pass back unmodified feature if clean returns nothing
* Make fileHandler function async
* Return null if no geometry
* Handle single features differently. Fixes functional test error
* Update jest test to use unique instances & counts of readers
* Review feedback
* Review feedback
* Review feedback. Add error-handling for null geom
* Fix i18n error
* Clean up handling of cancelled/replaced files to account for changed fileHandler return type
* [Code] use native git to iterate git files
* [Code] use native git to clone/update repository
* [Code] git history using native git
* [Code] use native git to read file tree and file content
* [Code] fix the 'bad file' warning from status api
* [Code] use native git to handle worktree
* [Code] use native git to resolve references
* [Code] use native git to handle blame / diff
* [Code] patch git binaries in kibana build script
* [Code] migrate unit tests to use native git
Add service map tabs on the main APM screen and for individual services.
This is not yet hooked up to work with back-end data, so it always shows the same hard-coded graph.
This is experimental, so you must have x-pack.apm.serviceMapEnabled: true in your Kibana config for it to show up.
Also add "PSF" to the list of allowed licenses since a new dependency added uses this license (it's on the [green list](https://github.com/elastic/open-source/blob/master/elastic-product-policy.md#green-list).)
Fixes#44890Fixes#44853
* adds linter rule to disallow undeclared variables
* adds cypress eslint plugin, remove redundant packages from siem/package.json
* removes comment from json and adds a line about cypress linting to the cypress README
* adds upgraded package back to siem/package.json
* updates cypress run scripts since cypress package is now located in the x-pack/node_modules
* needed to yarn kbn bootstrap after rebasing with master
* use new setScreenshotSize
* change tolerance from 1% to 2% (originally 5%)
* retake baseline without notification dialog
* close add and save notifications
* wait for render complete when going in to FullScreen mode
* add 5 second sleep to see if it ever goes to full screen mode
* add debugging screenshots and sleeps
* try reloading the Kibana index before this test
* 30 iterations with only the first test enabled
* revert multi-run changes
* ran node scripts/build_renovate_config
* fix tslint errors
* fix tslint error
* update xpack dependency to match oss
* update yarn.lock
* revert notifications:lifetime:info change by reducing some other timeouts
* remove commented-out code
* fixed and Unskipped 2nd test
* re-arrange order of dashboard tests to pass :-(
* removed commented-out sleep
Hopefully this won't be an issue
* Add comment about the order of tests
```
loadTestFile(require.resolve('./view_edit'));
// Order of test suites *shouldn't* be important but there's a bug for the view_edit test above
// https://github.com/elastic/kibana/issues/46752
// The dashboard_snapshot test below requires the timestamped URL which breaks the view_edit test.
// If we don't use the timestamp in the URL, the colors in the charts will be different.
loadTestFile(require.resolve('./dashboard_snapshots'));
```
* Update angular related packages
* upgrade jQuery too
* don't delete screenshots in pipeline jobs
* use ng-change so that listener is triggered after ng-model is updated
* match @types/angular versions
* update yarn.lock
* fix test
$routeChangeSuccess is no longer broadcast when resolving a redirect route, so this test has been adjusted to validate that
* Update jest related packages
* use correct type
* adapt spy and describe.each types
* update yarn.lock
* update snapshot
* define types before passing to describe.each
* Add core-only bundle
* Add ApplicationService mounting
* Add LegacyCore{Setup,Start}
* Fix PR comments
* Add functional tests
* Fix PR comments
* Fix PR comments
* Remove other usages of rootRoute
* Use state field notation
* Add support for open in new tab
* Fix PR comments
* Fix pesky await from the dead
* Update docs
* Bump @types/history
* [APM] Adds chart for page load averages by country in RUM page-load view
* [APM] Simplified and refined ChoroplethMap. Added legend labels.
* - Replaced Map legend slices with smooth gradient
- fixed issue with map rendering multiple times
- renamed initial props to start with 'initial'
- added some more code comments
* use correct i18n ids
* - base color progression calc directly on euiColorPrimary
- check that a layer exists before querying features
* Addressed code review feedback
* - fixes issue where min/max was not a finite value
- cleans up mouseover handler, which updates on state changes
- formats doc count for display
- style improvements
* addressed PR feedback & updated renovate.json5
* - Removed the Legend from the ChoroplethMap
- Only render tooltip when there's data
* - fix hover state not clearing properly
- add better typing around Geojson propertier for world countries
* added missing css import
* wip
* sources table working woohoo
* rename table back to n flow
* wired up both source and destination tables
* cleanups
* flows and ips sort
* flows and ips sort
* fix flow sorting
* differentiate tables
* bring back network
* fix tests
* integration tests updated
* add country names to flags, sort by desc on first click
* yarn doing its thing
* correct panel width during initial load
* remove default props
* fix inspect btn placement at small viewport sizes
* reformatting bytes
* used compressed table prop
* fix unit tests bytes
* update header subtext size
* override table cell display flex
* make titles plural
* less distracting empty string
* simplify markup and align numbers right
* improve more items experience
* undo compressed tables…looks bad
* stack tables
* restore compressed and side by side layout
* sentence case for titles
* table cleanup
* force more to separate line
* dnd poc changes
* jest test updates
* TypeScript, i18n, and bean-gen fixes
* fix for filter action color
* single quotes instead of backticks
* use getEmptyValue() instead of static emdash
* remove “ AS” prefix
* address PR concerns
* add space
* first attempt at prop change with matchMedia
* split table display by mediaMatch
* rm comments
* fix type issue
* correct react hook
* lint fix
* fix jest
* update snapshots
* WIP: Adding libs for webgl
* WIP Adding swiftshader libs to chromium
* WIP: Adding missing binaries for webgl in chromium
* Use pipes for communication with chrome to avoid networking snafus
* Bumps puppeteer in prep for new chromium build + types and better @types package
* Remove ignore
* Removing of final @ts-ignore now that we have types
* README updates
* Fixing binding issues
* Fixing maps integration wrt reporting + conditional pipes for puppeteer
* Adding new deps to the windows build
* New s3 builds
* Checksums for updated linux build
* Moving types out of puppeteer file and into core puppeteer module
* launch => puppeteerLaunch
* Maps comment about render loading in reporting
* Clarify how reporting uses hooks and events for viz
* First version of Editor component and integration with the expression editor
* Adding resize detector
* Remove blue border on editor select
* Adding types for the react resize detector
* Adding worker and a few more monaco plugins
* Suggestion completion rework
* Add resize detector types as well as an IE11 full width bug fix
* Adding correct types for function definitions and monaco
* change CSS class names, add border to input
* Adding boolean styling
* Slight refactor of canvas function/arg types and adding first pass of hover
* Fixing hover interaction for functions and arguments
* Namespacing Code monaco css overrides
* Styling cleanup and simple README
* Setting up tests including some storyshots for the ExpressionInput component and Editor component
* Prop documentation for both the ExpressionInput and Editor components
* Adding Editor snapshots
* tiny cleanup
* Moving language registration, adding autocomplete suggestion types, and cleaning up editor
* Some documentation and cleanup from PR feedback
* Fixing types, adding documentation
* clean up editor, remove autocomplete toggle
* More PR cleanup
* Test fix, type fix
* fix issues around errors. code cleanup
- Updates the dragSelect library to 1.13.1. 9221622 updates the library. c9a870b fixes a regression caused by the update.
- Fixes an issue where a timefilter refresh would clear a swimlane selection. 3d1c43d removes a duplicate timefilter subscription and changes the triggered event to REDRAW instead of RELOAD (which triggered a full reload and cleared the selection).
- Fixes an issue with timefilter/datepicker: EuiSuperDatePicker checks isPaused only with componentDidMount() so it might miss changing props. The fix in aa9555d works around that by adding a check on the onRefresh() callback.
* upgrade all babel related modules, and bump lodash minors
* update kbn-pm dist
* update fetch-mock, necessary to use core-js 3
* use regenerator transform in jest tests, as required by EUI
* disable useBuiltIns rather than using regenerator plugin
* remove extra regenerator-runtime import
# [SIEM] Run Cypress Tests Against Elastic Cloud & Cypress Command Line / Reporting (#42804)
This PR contains enhancements to the `Cypress` end-to-end (e2e) testing support in the SIEM app, as discussed with @spalger
Note: this PR depends on test refactorings in https://github.com/elastic/kibana/pull/42766
## New: Run `Cypress` Tests Against Elastic Cloud
Cypress tests may now be run against a remote Elastic Cloud instance
(override `baseUrl`), interactively or via the command line.
Credentials are specified via `kibna.dev.yml` or environment variables.
## New: Run `Cypress` Tests On the Command Line
Run tests on the command line (override `baseUrl` and pass credentials via
the `CYPRESS_ELASTICSEARCH_USERNAME` and `CYPRESS_ELASTICSEARCH_PASSWORD`
environment variables), via command line.
## New: Reporting
Reports are configured to include:
- An HTML report, suitable for e-mail notifications
- Screenshots
- Junit reports (for integration with Kibana CI)
- Videos (optional)
Reports generated when `Cypress` tests are run on the command line are output
to the `target` directory, which follows specific conventions used by the
Kibana CI process:
* Any directory under `target` that begins with `kibana-`, e.g. `kibana-siem` will be uploaded as an artifact to a bucket
* Junit reports are picked up from the `target/junit` directory
The artifacts generated by running `Cypress` tests on the command line conform to the above conventions.
### HTML Reports
An HTML report (e.g. for email notifications) is output to:
```
target/kibana-siem/cypress/results/output.html
```
### Screenshots
Screenshots of failed tests are output to:
```
target/kibana-siem/cypress/screenshots
```
### `junit` Reports
The Kibana CI process reports `junit` test results from the `target/junit` directory.
Cypress `junit` reports are generated in `target/kibana-siem/cypress/results`
and copied to the `target/junit` directory.
### Videos (optional)
Videos are disabled by default, but can optionally be enabled by setting the
`CYPRESS_video=true` environment variable:
```
CYPRESS_video=true yarn cypress:run
```
Videos are (optionally) output to:
```
target/kibana-siem/cypress/videos
```
# Updated `README`
The full details and instructions for running Cypress tests are in the
`siem/cypress/README.md`, which was updated to reflect the changes
in this in this PR, but in a nutshell, you may run tests interactively with
the following (new) environment variables:
```sh
cd x-pack/legacy/plugins/siem
CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD=<password> yarn cypress:open
```
Running the command line version of the tests, which will output
the reports described above, is a similar experence:
```sh
cd x-pack/legacy/plugins/siem
CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD=<password> yarn cypress:run
```
https://github.com/elastic/siem-team/issues/435https://github.com/elastic/siem-team/issues/437
* Upgraded EUI 13.0.0 -> 13.1.0
* Bump to 13.1.1
* Reset MutationObserver polyfill to original operation
* Reset x-pack's MutationObserver polyfill to original operation
* eui 12.4.0
* styled-components ts conflict
* update combobox test service to always open on open call
* Revert "update combobox test service to always open on open call"
This reverts commit 43074e6006.
* scroll combobox into view
* scroll before filter
* Temporary Core workarounds.
* Move files to NP Security Plugin.
* Fix references.
* Migrate to the New Platform.
* Review#1: remove unused `loginAttempt` from provider iterator, rely more on RecursiveReadonly, etc.
* Integrate latest core changes: isTlsEnabled and get rid of legacy ES config.
* Revert `deepFreeze` changes and rely on `src/core/utils`.
* Review#2: do not mutate injectedVars in onInit. Integrate latest upstream changes.
* Use mocks provided by the Core.
* Expect ElasticsearchError instead of Boom errors as 401 Cluster client errors.
* Simplify session handling for `login`.
* Review#3: properly handle session updates for `login`, remove redundant hapi-auth-cookie deps from x-pack package.json, migrate to new core sessionStorage API, integrate latest Kerberos provider changes from upstream
* Do not clear session on login if it does not exist.
* eui 12.3.1
* add data logos
* Fix TS uses, one SCSS use of euiOverflowShadow
* fix overflow shadow mixin in sass
* homepage logos
* refix typo on homepage
* hp snaps
* Addresses an issue where Chromium user-data-dirs aren't cleaned properly, and moves to TS
* Fixing renovate config issues
* Fixing issues with typedef's missing
* Using prior-set typedefs for logger
* Updating to @elastic/lodash to 3.10.1-npm-kibana2
* Updating lodash to 4.17.13
There's a stray dependency to lodash 4.17.11 via cypress which doesn't
use "^". This is a dev dependency, so we can ignore it for a bit while
they update their package.json
* Updating some forgotten references to @elastic/lodash@3.10.1-kibana1
* Updating lodash-es to 4.17.13
* Updating to @elastic/lodash to 3.10.1-npm-kibana3
* Using the root resolutions to update cypress's version of lodash.
Thanks @spalger!!!
* [ts] upgrade to 3.5.2
* [ts] run from cwd so that relative paths are correct
* move eslint-disable-line comment into jsx attribute
* autofix eslint violations
* avoid generic type, it's not necessary and problematic
* make elasticsearch.cluster optional, many instances don't have them
* remove invalid prop
* expand AllowUnknownProperties to cleanly handle arrays
* esfilter values can sometimes be an array of strings
* allow exception objects to have unknown properties
* define accumulator as a boolean
* fix return type
* return a 404 if beat isn't found after update
* use Object.values for better types
* define return type of get() call
* define value type for Set
* define return value of get()
* define State property type
* use less get(), so ts can infer types
* define Set item type
* map state type
* make default_operator optional, since it's not always defined
* remove seemingly unused prop
* define return type of get() fn
* define inner type for state
* don't define base types are objects with index signatues
* regenerate public api docs
* make indices privileges optional too
* remove unnecessary index-signature from Exception interface
* use variadic _arg instead
* [core/plugin] use Record<string, any> rather than {}
* replace a couple more instances of {}
* revert some unnecessary changes
* remove unused types
* [reporting] output, payload, and meta are required properties
* bump to latest patch version
* Add ctags langserver as a dependency and launch it
* Remove extra files in node-ctags when release
* [build] rework platform-specific clean for ctag package
* rename local excludedPath var
* use array.includes
* exclude ctags langserver vendor