Commit graph

328 commits

Author SHA1 Message Date
Pablo Machado
482d1ced82
Delete CellActions from UI actions plugin (#149522)
## Summary
This PR only deletes the component from the UI action plugin.
@semd has already added the component to a new package here
https://github.com/elastic/kibana/pull/149057

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-27 10:37:04 +01:00
Jon
3727091344
[artifacts/container-image] Add annotation containing image metadata (#149627)
Adds a buildkite annotation with the built image tags.


https://buildkite.com/elastic/kibana-artifacts-container-image/builds/157
2023-01-26 16:34:43 -07:00
Spencer
4e7560f19d
[ci-stats] move shipper to a package, validate limits in on-merge job (#149474)
We just had an issue where two PRs were merged and it caused the limit
of the `triggerActionsUi` bundle to be exceeded, breaking PR builds. The
issue is that we didn't see any indication of this in the on-merge jobs
because we don't produce the PR report for on-merge jobs or ask ci-stats
if we should fail the job. Instead, we just ship the metrics for
baseline purposes. This fixes that problem by adding a `--validate` flag
to `node scripts/ship_ci_stats`, which takes care of sending at least
some ci-stats and will verify that the bundle limits are not exceeded.

Since we didn't catch this issue in the on-merge job the limits were
incorrect for over an hour and merged into many PRs, wasting engineering
and CI time.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 08:20:40 -07:00
Jon
4fa3cdcac6
[artifacts/container-image] Fix image tag when triggering update (#149449)
Instead of passing the entire qualified tag when triggering an update,
this sets the image tag to the abbreviated commit.
2023-01-24 16:25:46 -06:00
Jon
cfd9cd8ff9
[artifacts/container-image] Trigger image tag update (#149437)
Reopens #149143 with updates to the target file and service

After a commit is merged, tested, and images are built and pushed to the
container registry we need to send a notification that a new tag is
available.

This triggers a promotion pipeline with the latest container tag when:
1) the branch is tracked (i.e. main, and not a personal branch) 1)
~triggered from our on-merge test pipeline.~
https://github.com/elastic/kibana/pull/149350 had to remove support for
this - we're triggering via REST now which removes the from trigger
environment variable.
2023-01-24 11:49:32 -06:00
Jonathan Budzenski
ef6d48933a Revert "[artifacts/container-image] Trigger image tag update (#149143)"
This reverts commit 598843f7ca.
2023-01-23 20:07:27 -06:00
Jon
598843f7ca
[artifacts/container-image] Trigger image tag update (#149143)
After a commit is merged, tested, and images are built and pushed to the
container registry we need to send a notification that a new tag is
available.

This triggers a promotion pipeline with the latest container tag when:
1) the branch is tracked (i.e. main, and not a personal branch)
1) ~triggered from our on-merge test pipeline.~
https://github.com/elastic/kibana/pull/149350 had to remove support for
this - we're triggering via REST now which removes the from trigger
environment variable.

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-01-23 17:36:26 -06:00
Jon
e8ceb4ed49
[ci/on-merge] Trigger container image build (#149350)
Reopens #148864 to trigger via REST instead of yaml. The previous
implementation did not support commit triggered builds.

This conditionally adds a pipeline trigger to
`kibana-artifacts-container-image` at the end of the on-merge pipeline
when tests are passing. The triggered pipeline will build (and
eventually push) our default docker images.
2023-01-23 13:16:56 -07:00
Jon
2f86985c44
[artifacts/container-image] Push image (#148929)
This pushes multi-arch image artifacts to our container registry.

https://buildkite.com/elastic/kibana-artifacts-container-image/builds/10
2023-01-19 11:08:13 -06:00
Janki Salvi
ed32d89848
[Cases] add tooltip component to kbn-cases-components package (#148561)
## Summary

This PR adds a tooltip component (High OrderComponent) to
@kbn/cases-components package. #146864

**Details of tooltip**


![image](https://user-images.githubusercontent.com/117571355/211531519-55c68e15-00ce-410d-9cd5-d23d4eb45287.png)

**status: Open, tooltip position : Top**


![image](https://user-images.githubusercontent.com/117571355/211530420-d0c96461-1ce5-4344-8fcf-17907a7efe61.png)

**status: In-progress, tooltip position: bottom, long title and
description**


![image](https://user-images.githubusercontent.com/117571355/211530905-2df9b768-3181-481b-8234-43875301cbb4.png)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### How to Test:

- run `yarn storybook cases` and test on  http://localhost:9001/

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-17 14:24:50 +01:00
Jon
ecadc4a20a
[ci] Add build scripts for latest docker image (#148606)
This adds a new pipeline to build our default container image, using the
`kibana-ci` docker namespace and the docker version based on the first 7
digits of the commit hash.

https://buildkite.com/elastic/kibana-artifacts-container-image/builds/3

Will have followups for: 
1) on-merge trigger
2) docker push / controller pipeline trigger

need to make sure branches other than main, and manual triggers
(untested) skip publishing.
2023-01-13 13:46:40 -06:00
Dzmitry Lemechko
bc2cb5dc61
[code coverage] removing instrumentation & plugin for functional tests (#148748)
## Summary

Quite awhile ago we decided to stop collecting code coverage for our
functional (e2e, api integration) FTR tests.
This is a cleanup PR to remove the code we no longer use.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-01-12 16:44:48 +01:00
Spencer
d6be4a4b06
Implement package linter (#148496)
This PR implements a linter like the TS Project linter, except for
packages in the repo. It does this by extracting the reusable bits from
the TS Project linter and reusing them for the project linter. The only
rule that exists for packages right now is that the "name" in the
package.json file matches the "id" in Kibana.jsonc. The goal is to use a
rule to migrate kibana.json files on the future.

Additionally, a new rule for validating the indentation of tsconfig.json
files was added.

Validating and fixing violations is what has triggered review by so many
teams, but we plan to treat those review requests as notifications of
the changes and not as blockers for merging.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-09 16:49:29 -07:00
Dzmitry Lemechko
5f31ebf1ce
Benchmark single apis (#146297)
## Summary

This PR adds capability to run capacity testing for single apis #143066

Currently in main we have to 2 types of performance tests:
- single user performance journey that simulates single end-user
experience in browser
- scalability journey that uses APM traces from single user performance
journey to simulate multiple end-users experience

This new type of performance tests allow to better understand how each
single server api scale under the similar load.

How to run locally:
make sure to clone the latest main branch of
[elastic/kibana-load-testing](https://github.com/elastic/kibana-load-testing)
in Kibana repo run:
`node scripts/run_scalability.js --journey-path
x-pack/test/scalability/apis/api.core.capabilities.json`

How it works:
FTR is used to start Kibana/ES and run Gatling simulation with json file
as input. After run the latest report matching journey name is parsed to
get perf metrics and report using EBT to the Telemetry cluster.

How will it run after merge:
I plan to run pipeline every 3 hours on bare metal machine and report
metrics to Telemetry staging cluster.
<img width="2023" alt="image"
src="https://user-images.githubusercontent.com/10977896/208771628-f4f5dbcb-cb73-40c6-9aa1-4ec3fbf5285b.png">


APM traces are collected and reported to Kibana stats cluster:
<img width="1520" alt="image"
src="https://user-images.githubusercontent.com/10977896/208771323-4cca531a-eeea-4941-8b01-50b890f932b1.png">


What metrics are collected:

1. warmupAvgResponseTime - average response time during warmup phase
2. rpsAtWarmup - average requests per second during warmup phase
3. warmupDuration
4. responseTimeMetric (default: 85%) Gatling has response time
25/50/75/80/85/90/95/99 percentiles, as well as min/max values
5. threshold1ResponseTime (default 3000 ms)
6. rpsAtThreshold1 requests per second when `responseTimeMetric` first
reach threshold1ResponseTime
7. threshold2ResponseTime
8. rpsAtThreshold2 (default 9000 ms)
9.  threshold3ResponseTime
10. rpsAtThreshold3 (default 15000 ms)

As long as we agree on metrics I will update indexer for telemetry.

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-09 16:38:30 +01:00
Spencer
8e6f155e0c
support disabling kibana build download in functional/common.sh (#148461)
We need to disable downloading the Kibana build for steps which don't
need it, especially in builds which skip building Kibana completely
2023-01-05 10:41:28 -07:00
Spencer
2adf37b203
[fleet/pkgsDaily] disable CI log capture so we can see logging on success (#148459) 2023-01-05 08:21:54 -07:00
Patryk Kopyciński
c0d2a032f9
[Defend Workflows] Init Cypress (#147822)
## Summary

Add initial Cypress pipeline for Defend Workflows Team

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ashokaditya <1849116+ashokaditya@users.noreply.github.com>
2023-01-04 17:05:13 +01:00
Spencer
1b8ddc6267
Fix autocommiting from CI (#148066)
The new images have an updated gh binary which now requires setting the
`GITHUB_REPO` env var, or calling `gh repo set-default`. I opted for the
env var so that we didn't need to find a good time to execute the CLI
(after the keys are in the env, but before all other user code) or worry
about the logging. This also allows other users of our scripts to
customize as makes sense without having to dive into a bunch of
imperative shell code.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-23 09:31:54 -07:00
Spencer
afb09ccf8a
Transpile packages on demand, validate all TS projects (#146212)
## Dearest Reviewers 👋 

I've been working on this branch with @mistic and @tylersmalley and
we're really confident in these changes. Additionally, this changes code
in nearly every package in the repo so we don't plan to wait for reviews
to get in before merging this. If you'd like to have a concern
addressed, please feel free to leave a review, but assuming that nobody
raises a blocker in the next 24 hours we plan to merge this EOD pacific
tomorrow, 12/22.

We'll be paying close attention to any issues this causes after merging
and work on getting those fixed ASAP. 🚀

---

The operations team is not confident that we'll have the time to achieve
what we originally set out to accomplish by moving to Bazel with the
time and resources we have available. We have also bought ourselves some
headroom with improvements to babel-register, optimizer caching, and
typescript project structure.

In order to make sure we deliver packages as quickly as possible (many
teams really want them), with a usable and familiar developer
experience, this PR removes Bazel for building packages in favor of
using the same JIT transpilation we use for plugins.

Additionally, packages now use `kbn_references` (again, just copying the
dx from plugins to packages).

Because of the complex relationships between packages/plugins and in
order to prepare ourselves for automatic dependency detection tools we
plan to use in the future, this PR also introduces a "TS Project Linter"
which will validate that every tsconfig.json file meets a few
requirements:

1. the chain of base config files extended by each config includes
`tsconfig.base.json` and not `tsconfig.json`
1. the `include` config is used, and not `files`
2. the `exclude` config includes `target/**/*`
3. the `outDir` compiler option is specified as `target/types`
1. none of these compiler options are specified: `declaration`,
`declarationMap`, `emitDeclarationOnly`, `skipLibCheck`, `target`,
`paths`

4. all references to other packages/plugins use their pkg id, ie:
	
	```js
    // valid
    {
      "kbn_references": ["@kbn/core"]
    }
    // not valid
    {
      "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }]
    }
    ```

5. only packages/plugins which are imported somewhere in the ts code are
listed in `kbn_references`

This linter is not only validating all of the tsconfig.json files, but
it also will fix these config files to deal with just about any
violation that can be produced. Just run `node scripts/ts_project_linter
--fix` locally to apply these fixes, or let CI take care of
automatically fixing things and pushing the changes to your PR.

> **Example:** [`64e93e5`
(#146212)](64e93e5806)
When I merged main into my PR it included a change which removed the
`@kbn/core-injected-metadata-browser` package. After resolving the
conflicts I missed a few tsconfig files which included references to the
now removed package. The TS Project Linter identified that these
references were removed from the code and pushed a change to the PR to
remove them from the tsconfig.json files.

## No bazel? Does that mean no packages??
Nope! We're still doing packages but we're pretty sure now that we won't
be using Bazel to accomplish the 'distributed caching' and 'change-based
tasks' portions of the packages project.

This PR actually makes packages much easier to work with and will be
followed up with the bundling benefits described by the original
packages RFC. Then we'll work on documentation and advocacy for using
packages for any and all new code.

We're pretty confident that implementing distributed caching and
change-based tasks will be necessary in the future, but because of
recent improvements in the repo we think we can live without them for
**at least** a year.

## Wait, there are still BUILD.bazel files in the repo
Yes, there are still three webpack bundles which are built by Bazel: the
`@kbn/ui-shared-deps-npm` DLL, `@kbn/ui-shared-deps-src` externals, and
the `@kbn/monaco` workers. These three webpack bundles are still created
during bootstrap and remotely cached using bazel. The next phase of this
project is to figure out how to get the package bundling features
described in the RFC with the current optimizer, and we expect these
bundles to go away then. Until then any package that is used in those
three bundles still needs to have a BUILD.bazel file so that they can be
referenced by the remaining webpack builds.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-22 19:00:29 -06:00
Shahzad
b3ed8261e1
[Synthetics] Fixes errors overview sparklines (#147669) 2022-12-21 17:22:05 +01:00
Giorgos Bamparopoulos
042403e606
[APM] Add parallel builds for cypress tests (#142598)
- Tests runs initiated by the flaky test runner are not recorded or
parallelized
2022-12-21 15:36:08 +00:00
Pablo Machado
ed1f9650d1
[Security Solution] Add CellActions (alpha version) component to ui_actions plugin (#147434)
## Summary

Create a `CellActions` component. It hooks into a UI-Actions trigger and
displays all available actions.
It has two modes, Hover_Actions and Always_Visible. 

You can run the storybook and take a look at the component: `yarn
storybook ui_actions` or access
https://ci-artifacts.kibana.dev/storybooks/pr-147434/226993c612bbe1719de6374219009bc69b0378d8/ui_actions/index.html

*** This component is still not in use.

<img width="117" alt="Screenshot 2022-12-13 at 13 13 46"
src="https://user-images.githubusercontent.com/1490444/207316029-26c7bad8-ae39-48ba-8059-cbacf01a98aa.png">


<img width="224" alt="Screenshot 2022-12-13 at 13 13 30"
src="https://user-images.githubusercontent.com/1490444/207316024-0d7706c8-bd59-42e8-bf6d-b5648fc818fd.png">


#### Why?
The security Solution team is creating a generic UI component to allow
teams to share actions between different plugins.
Initially, only the Security solution plugin will use this component and
deprecate the Security solution custom implementation. Some actions that
will be shared are: "copy to clipboard", "filter in", "filter out" and
"add to timeline".



#### How to use it:
This package provides a uniform interface for displaying UI actions for
a cell.
For the `CellActions` component to work, it must be wrapped by
`CellActionsContextProvider`. Ideally, the wrapper should stay on the
top of the rendering tree.

Example:
```JSX
<CellActionsContextProvider
    // call uiActions.getTriggerCompatibleActions(triggerId, data)
    getCompatibleActions={getCompatibleActions}>
    ...
    <CellActions mode={CellActionsMode.HOVER_POPOVER} triggerId={MY_TRIGGER_ID} config={{ field: 'fieldName', value: 'fieldValue', fieldType: 'text' }}>
        Hover me
    </CellActions>
</CellActionsContextProvider>

```

`CellActions` component will display all compatible actions registered
for the trigger id.



### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2022-12-20 10:00:30 +01:00
Spencer
2763af3a4e
[ftr] remove @types/mocha, define custom ambient-ftr-types (#147284)
After moving away from composite projects in the IDE we now have an
issue where projects like security solutions are getting `@types/jest`
and `@types/mocha` loaded up, even though the "types" compiler option in
security solutions focuses on jest. To fix this I've removed the
`@types/mocha` package, implemented/copied a portion of the mocha types
into a new `@kbn/ambient-ftr-types` package which can be used in ftr
packages to define the describe/it/etc. globals.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-19 10:42:12 -07:00
Dzmitry Lemechko
8be9ae629c
[performance] unify scripts (#147202)
## Summary

This PR is the follow-up to #147002 and #146129 and makes few changes to
make both performance scripts expose very similar cli and allow run
`run_performance` locally for debug purpose.

- to run a single test locally against source:
  - single user journey: 
`node scripts/run_performance.js --journey-path
x-pack/performance/journeys/login.ts`
  -  scalability journey (auto-generated):
`node scripts/run_scalability.js --journey-path
target/scalability_traces/kibana/login-0184f19e-0903-450d-884d-436d737a3abe.json`

`skip-warmup` flag to avoid journey warmup runs for performance data set
extraction (we don't need to run journey twice while interested in APM
traces only)

PR also updates pipeline scripts with new changes
2022-12-12 16:54:25 +01:00
Thomas Watson
39d27bb868
Add custom Buildkite pipeline for @kbn/handlebars (#146964)
Closes #146963
2022-12-08 18:28:33 +01:00
Dzmitry Lemechko
9f7db8f615
[scalability testing] typescript runner (#147002)
## Summary

Closes #146546

This PR replaces bash script with node-based runner script.

Script can take relative path to directory with scalability journey
files or relative path to individual journey json file.

`node scripts/run_scalability.js --journey-config-path
scalability_traces/server`

`node scripts/run_scalability.js --journey-config-path
scalability_traces/server/api.core.capabilities.json`

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2022-12-06 22:21:52 +01:00
Dmitrii Shevchenko
3e499922ff
[Security Solution] Remove detection rules distributed via the file system (#143839) 2022-12-06 16:12:52 +01:00
Spencer
c107f8a73a
[jest/ci] disable console methods (#146910)
Removes all the noise from poorly written React tests and includes a
warning to explain the situation to folks

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-02 15:28:55 -07:00
Gloria Hornero
2cb675d814
[Security Solution] Adding security solution packages as a dependency (#146561) 2022-11-30 15:17:32 +01:00
Liza Katz
783ea146a7
Performance runner in js (#146129)
## Summary

Rewrite the performance journey runner using TypeScript, to avoid
dangling ES\node processes during test execution.

Results are stable with this runner, as verified on CI 


![image](https://user-images.githubusercontent.com/3016806/204506155-61c5807b-fad5-40bf-8284-a82693cd4c2a.png)

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-29 19:43:35 +02:00
Jean-Louis Leysens
5a86b583df
[Files] Move <FileUpload /> and <FilePicker /> 👉🏻 packages/shared-ux/file (#146284)
## Summary

This is a refactor:

* Move `FilesContext`, `FilePicker` and `UploadFile` components to
`packages/shared-ux/file` as packages
* Renamed `UploadFile` to `FileUpload` for more consistency
* Also created `packages/shared-ux/file/types` and added
`useBehaviourSubject` to `packages/shared-ux/file/util` (we can consider
moving this elsewhere since that function is not necessarily tied to the
files domain).
* Removed the storybook config from `files` public plugin since there
are no more components there

## How to test

👉🏻 `yarn storybook shared_ux` to see the components in a lab environment

OR

👉🏻 `yarn start --run-examples` then "Developer examples" > "Files
example" to see the components being used in Kibana

Look out for any regressions: for example, in the `FileImage` component
importing `import bh from 'blurhash'` caused a regression because
blurhash does not expose a default export. This was fixed by doing:
`import * as bh from 'blurhash`.

## Notes

* With this change, we needed to move `FilesClient` interface to
packages since it is used by the components. However, we also wanted to
keep `FilesClient` interface as it is currently exported from `files`
plugin because it exposes methods that only the server of `files` plugin
should know about (e.g., the metrics endpoint). I created the
`BaseFilesClient` in the packages directory that is extended in the
`files` plugin as needed. This is a snapshot of the types as they are
provided from the server implementation and will need to be
updated/maintained by hand from here on out.
* With `BaseFilesClient` in `packages`, we lost the type check between
`files` server endpoints and the client methods. To re-establish this
link the `CreateRouteDefinition` type helper got a parameter where the
client method can be passed in to do checks that the server inputs
(query, param and body) as well as outputs (the responses) match what
the client expects using the `X extends Y ? X : unknown` capability of
TS. See this in action in, for example
`src/plugins/files/server/routes/find.ts`. DX will be: if these ever get
out of sync, the server values for `query`, `param` or `body` will map
to `unknown` causing a type issue when trying to use these values. This
can only be fixed by bringing the `FilesClient` types in sync with the
server types.
* Server endpoints that should match expected `FilesClient`
inputs/outputs should use the `CreateRouteDefinition` type helper, but
if the endpoint does not need to map to a client method we can always
skip using `CreateRouteDefinition`.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-29 08:48:23 +01:00
Jonathan Budzenski
5f342636d2
[cft] Support persisting deployments (#144370)
Adds support for a label `ci:cloud-persist-deployment`, that will
prevent deployments from shutting down until the label is removed.

This also fixes a bug in the conditional checking for whether the cloud
deployment label was removed. If `ci:cloud-deploy` is removed from a PR,
the deployment should now shutdown in the next hour instead of after
48h.

It's easiest to test this after merging. I can alternatively modify the
pipeline to run on a branch, but either way I'll end up pushing commits
and this is fairly straight forward and it breaking is low risk. Either
way works for me.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tyler Smalley <tylersmalley@gmail.com>
2022-11-28 11:39:10 -07:00
Spencer
61af35c271
[docs] add "docs" label to daily docs build PRs (#145421)
As requested by the QA team, these PRs should be labeled with "docs" to
help filter them out when reviewing PRs that are going into a specific
version.
2022-11-16 11:38:29 -07:00
Luke Gmys
f1be6057c8
[TIP] Run e2e pipeline on CI (#144776)
## Summary

Last week, our team has dicovered that e2e tests are not executed on CI,
this PR is an attempt to fix that.

Threat intel pipeline should be run whenever the `threat_intelligence`
plugin source or related tests config has changed.
2022-11-09 12:51:09 +01:00
Tiago Costa
3dd5c5388e
chore(NA): update ci step name to Check Public API Docs (#144573)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-04 02:27:23 +00:00
Dzmitry Lemechko
1505c0688d
attach-screenshots-from-journey-steps (#144447) 2022-11-03 16:17:55 +01:00
Jonathan Budzenski
cf7d6cc6de
Remove buildbuddy cache (#144356)
* Remove buildbuddy cache

* Update .buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh

* Update .buildkite/scripts/common/setup_bazel.sh
2022-11-01 15:23:24 -07:00
Spencer
af1230b7c4
[ci] remove github-checks-reporter (#144193) 2022-10-28 16:21:02 -05:00
spalger
fe2480d96d
[ts] ts refs cache was removed, remove capture task 2022-10-28 14:27:18 -05:00
spalger
e5d186a6f0
[ts] stop building @types packages in bootstrap 2022-10-28 14:03:55 -05:00
Stratoula Kalafateli
9656163820
Language documentation popover package (#143429)
* Language documentation popover package

* Add readme

* [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest'

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* Move the entire popover into the package, add stories

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-19 08:53:50 +03:00
Jonathan Budzenski
30e482bc8e
Re-enable Bazel cache on CI (#142975)
* Re-enable Bazel cache on CI

* remove exit test
2022-10-10 08:19:36 -05:00
Jonathan Budzenski
4997fdf5d5
Disable bazel cache on CI (#142873) 2022-10-06 10:18:22 -05:00
Tyler Smalley
47354fa7d3
[CI] Use 4 parallel ESLint jobs (#142787) 2022-10-05 14:59:46 -05:00
Jonathan Budzenski
63aee48127
[artifacts] Pass dependency manifest to release-manager CLI (#142408)
This passes the beats manifest used to download metricbeat and filebeat
for our cloud image to the release-manager CLI. This will be used to
validate that the bundled versions we use match the released versions.
2022-10-05 13:08:30 -05:00
Jonathan Budzenski
77eb8029c8
[artifacts] Reuse Cloud image for tests (#141828)
* [artifacts] Reuse Cloud image for tests

In https://github.com/elastic/kibana/pull/141657 we turned on Cloud
image builds in Kibana CI.  This updates the Cloud deployment test suite
to reuse the same image build.

* update comment
2022-10-04 12:48:45 -07:00
Giorgos Bamparopoulos
4a74dd383c
[APM] Record e2e tests to Cypress dashboard and enable screenshots, videos and test retries (#142398)
* Record e2e tests to Cypress dashboard and enable screenshots and videos

* Delete videos that have no failures or retries

* Set browser witdh and height for tests

* Fix flaky test for storage explorer

* Remove cypress plugin file

* Fix typo in spec name

* Enable test retries

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-04 20:01:39 +01:00
Alejandro Fernández Haro
74f30dcf8e
Move Cloud Integrations out of the cloud plugin (#141103)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-04 12:25:25 +02:00
Jonathan Budzenski
7274c27218
[ci/build] Add label for building example plugins (#139720)
* [ci/build] Add label for building example plugins

* update snapshots

* remove plugins before tests

* fix

* fix again

* fix formatting
2022-09-29 14:18:19 -07:00
Ying Mao
16ca2d2895
[Event Log] Adding event log schema check to CI checks (#142104)
* Adding event log check to CI check.

* Adding event log check to CI check.

* Can I check out ECS

* Checking out specific ECS branch

* Checking out specific ECS branch

* Custom error message

* Reverting event log mapping test changes

* Pinning to 1.8

* Update .buildkite/scripts/steps/checks/event_log.sh

Co-authored-by: Jonathan Budzenski <jon@budzenski.me>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jonathan Budzenski <jon@budzenski.me>
2022-09-29 07:53:50 -04:00