Commit graph

57 commits

Author SHA1 Message Date
Alex Szabo
9f8503e0b3
[CI] Allow using elastic-images-qa through PR label or env var (#216878)
## Summary
Currently, if you'd like to test something on Kibana's VM image, you'd
have to build a VM image to -qa, then rewrite all references to
`elastic-images-qa` for the PR jobs; once done with testing, we'd undo
the changes to `elastic-images-prod`.

This is a helpful tool for us to test with WIP VM images, we'd be able
to add a label to the PR, and it would automatically grab the QA images,
without any temporary commits.

Jobs in https://buildkite.com/elastic/kibana-pull-request/builds/289599
have ran with an elastic-qa image. 
2025-04-04 10:05:30 +02:00
Alex Szabo
115ec32eec
Upgrade axios 1.8.3 in buildkite (#215656)
## Summary
According to:

https://buildkite.com/elastic/kibana-on-merge/builds/65027#0195ca29-b10a-4e20-b00f-c4fbe43689fa

```

Annotate test failures error Request failed with status code 404 AxiosError: Request failed with status code 404
--
  | at settle (/opt/buildkite-agent/builds/bk-agent-prod-gcp-1742853500882456889/elastic/kibana-on-merge/kibana/.buildkite/node_modules/axios/lib/core/settle.js:19:12)
...
  | at async /opt/buildkite-agent/builds/bk-agent-prod-gcp-1742853500882456889/elastic/kibana-on-merge/kibana/.buildkite/scripts/lifecycle/annotate_test_failures.ts:14:5
  | HTTP Error 404/Not Found (https://api.buildkite.com/v2/organizations/elastic/pipelines/kibana-on-merge/builds/65027/artifacts?page=2&per_page=100) { message: 'Not Found' }

```
This points to the client collecting all artifacts through traversing
the `next` links from Buildkite's API responses. It appears, Axios is
not happy about these absolute paths, even if the origin is the same.

This PR adjusts the next link parsing to relativize compared to a base
url.
2025-03-25 15:05:37 +01:00
Alex Szabo
415d672d31
[ci] Flaky test runner respect labels (#215167)
## Summary
Extracts `collectEnvFromLabels` to a separate module, so it can be used
in the flaky test runner. With this, the label `ci:use-chrome-beta` will
be passed along to the flaky test runner, allowing for flaky testing on
chrome beta.

Other labels we treat as modifiers for PR behavior through setting env
variables should also be added to this set of mapping.
2025-03-24 12:01:06 +01:00
Alex Szabo
621aa5e782
Revert "Upgrade axios 1.8.3 in buildkite (#215203)" (#215530)
This reverts commit d8f6bd694b.

## Summary

Since this upgrade, we're getting 404 on failed test annotation.
Reverting this while we figure out what's causing it.
2025-03-21 17:09:02 +01:00
Alex Szabo
d8f6bd694b
Upgrade axios 1.8.3 in buildkite (#215203)
## Summary
Upgrade `axios` to 1.8.3 in Kibana's `.buildkite` subproject; disallow
absolute URLs in axios clients.
2025-03-20 10:58:41 +01:00
Dzmitry Lemechko
697d604870
[scout] add dynamic ci pipeline to run tests (#211797)
## Summary

closes https://github.com/elastic/kibana/issues/211592

This PR improves the way we run scout tests by discovering all the
plugins that have the scout tests and run tests in multiple workers:

<img width="1586" alt="image"
src="https://github.com/user-attachments/assets/4936ab50-fefb-470c-af3a-21263b58143f"
/>

How it works:

1. Run search script to find _all existing_ scout playwright config
files across kibana repo
2. Save results into `.scout/scout_playwright_configs.json` file, that
will be used as source to run configs in individual jobs per plugin.
Upload it as BK artifact.
3. Spin up job for each plugin mentioned in
`scout_playwright_configs.json`
4. In each individual job use `scout_playwright_configs.json` and get
configs for specific plugin, use worker with 8 vcpus where tests are run
in parallel (`usesParallelWorkers` prop)
While running configs 1 by 1 collect command exit code with the
following rules:
- configs run passed => exit code `0` , final status remains `0`
- config has no tests => exit code `2`, put config name into
`configsWithoutTests` group to push BK annotation later, change exit
status to `0` - we accept configs without tests at current stage
- config run fails => exit code `1`, final status changed to `1` and job
will fail in the end; put config name into `failedConfigs` group to push
BK annotation later

<img width="1564" alt="Screenshot 2025-02-21 at 14 34 16"
src="https://github.com/user-attachments/assets/06e9298d-466c-46bb-8e85-3d691a40850a"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-11 18:15:08 +01:00
Alex Szabo
e36833b3a6
[ci] Click to deploy cloud (#205623)
## Summary
Similar to https://github.com/elastic/kibana/pull/195581

Adds a pipeline that builds Kibana and starts cloud deployment without
going through the CI test suites (as in normal pull-request pipeline
runs). It can be useful if a developer would like to save time/compute
on re-building/re-testing the whole project before deploying to the
cloud.

Added labels (`ci:cloud-deploy / ci:cloud-redeploy`) are required
similarly to the usual CI flow.

Related to: https://github.com/elastic/kibana-operations/issues/121
2025-01-23 10:26:03 +01:00
Alex Szabo
ae6d046319
[CI] Prevent console.log in pipeline.ts (#204724)
## Summary
~Logging to stdout from this file would result uploading the logged
string to buildkite as a pipeline definition, causing errors
(https://buildkite.com/elastic/kibana-pull-request/builds/261721#0193d94b-f05c-41d6-9865-3d3c331a6cc4)~

Adds an inline eslint rule to warn about `console.log/stdout` usage, as
this has happened before by oversight.

Overlaps with: https://github.com/elastic/kibana/pull/204672

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-07 12:42:45 +01:00
Jon
b1da11e0f9
[ci] Reduce disk size for steps (#202015)
First pass on reducing disk size. This sets disk size for frequently run
steps not running builds or integration tests.
2024-12-26 17:19:11 -06:00
Jon
1a100a4f52
[ci] Remove local SSDs (#198618)
There doesn't appear to be much performance benefit from attaching SSDs
to these steps

https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4953
2024-11-04 14:36:09 -06:00
Alex Szabo
ae86b54a36
[CI] Fix project build & deploy job (#196562)
## Summary
In #195581 we've added the option to deploy through the clickable
triggers. But in it's current state, it's broken in several aspects.

(1) It's not starting on click. Triggers was resulting in a 422 on
Buildkite's side, and after digging more into it, this was the error:
<img width="1019" alt="Screenshot 2024-10-16 at 16 53 13"
src="https://github.com/user-attachments/assets/f602dde9-2cc4-474f-b432-a3d4f9d5ae91">
Apparently, building PRs needs to be enabled on jobs that want to be
triggered through the PR bot.

(2) It is set up to run regardless of the labels

(3) There's no feedback on runs

## Changes
This PR:
 - enables buildability in the pipeline's config
 - exits early if deploy labels are missing
 - adds a comment on the PR if a deploy job is started or finished 
- removes the kibana build step, it's not needed, as we have a step to
build the docker image

TODO: 
- [x] Add feedback about a started job (either through a non-required
check, or a github comment)
 - [x] Early exit if a label is missing

There are several other builds started right now, because the logic that
would trigger a build on changing a draft to ready. To be fixed in
https://github.com/elastic/buildkite-pr-bot/issues/78

Tested after manually by enabling the option on the UI, and triggering
through the checkbox:
https://buildkite.com/elastic/kibana-deploy-project-from-pr/builds/23
2024-10-29 16:57:01 +01:00
Jon
149c514e83
Re-enable org wide PR bot (#195131)
https://github.com/elastic/kibana/pull/194768 without the merge
conflicts.

Switches over to the org wide PR bot, with backwards compatibility for
both versions.

Updating the pipeline definition here is a global set for environment
variables on all branches, so I intend on merging the backports first to
support both versions and then proceeding with this.
2024-10-07 13:00:12 -05:00
Elena Shostak
28aa274f66
Updated js-yaml to v4 (#190678)
## Summary
Updated `js-yaml` to `4.1.0`.

This PR also introduces a type override for the `js-yaml` load function
to maintain compatibility across the codebase. Specifically, updated
type definition of the load function looks as follows:

```typescript
function load<T = any>(str: string, opts?: jsyaml.LoadOptions): T;
```

The original type definition of the load function in `js-yaml` changed
from `any` to `unknown`. This change would require extensive type
updates throughout the entire repository to accommodate the `unknown`
type. To avoid widespread type changes and potential issues in the
codebase, the type is overriden back to `any` for now.
This is a temporary measure, we plan to address the necessary type
changes in subsequent PRs, where teams will gradually update the
codebase to work with the `unknown` type.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

## Release note
Updated `js-yaml` to `4.1.0`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
2024-09-19 12:25:03 +02:00
Alex Szabo
e66450ea4c
[CI] Run PR against chrome-beta (#192257)
## Summary
This PR's goal is to enable developers (or automation) to test against
chrome-beta with a PR label - to adjust sensitive tests, or to foresee
test breakages.

⚠️ Risk: a PR verified/built with the chrome beta setting, would pass
the PR tests, but might not pass the on-merge suite in the end.

Addresses: https://github.com/elastic/kibana-operations/issues/199
Depends on: https://github.com/elastic/ci-agent-images/pull/907

It highlights the errors visible only on the next versions:
https://buildkite.com/elastic/kibana-pull-request/builds/233373
And it doesn't break with non-beta run:
https://buildkite.com/elastic/kibana-pull-request/builds/233716
2024-09-17 12:41:33 +02:00
Jon
41aed83d2b
Update version to 9.0.0 (#192040)
Updates our base version to 9.0.0

For reviewers: there are test skips in this pull request. Please assess
whether these failures should block merging as part of your review. If
not, we will track them in
https://github.com/elastic/kibana/issues/192624.

---------

Co-authored-by: Sebastián Zaffarano <sebastian.zaffarano@elastic.co>
2024-09-12 16:10:49 -05:00
Luke Elmers
b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
Jon
03ba36a028
[ci] Fix check for pre-emption failure (#191325) 2024-08-27 16:08:45 -05:00
Kurt
bcc46b60e9
Changing load/dump in source files (#190641)
## Summary

Updates usage of `js-yaml` `load` and `dump` to `safeLoad` and
`safeDump`, in preparation for a major version update of dependency,
where the default behavior will be that of the safe function variants.


## Note to reviewers
`safeDump` will throw if it encounters invalid types (e.g. `undefined`),
whereas the `dump` function will still write the file including the
invalid types. This may have an affect within your use cases - if
throwing is not acceptable or is unhandled. To avoid this the
`skipInvalid` option can be used (see
https://github.com/nodeca/js-yaml#dump-object---options-) - this will
write the file, stripping out any invalid types from the input.

Please consider this when reviewing the changes to your code. If the
`skipInvalid` option is needed, please add it, or let us know to make
the change.

---------

Co-authored-by: Sid <siddharthmantri1@gmail.com>
Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
Co-authored-by: Elena Shostak <elena.shostak@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
2024-08-21 07:29:36 -04:00
Jon
2c8b2ff4a5
Revert org wide PR bot (#188771)
We're seeing frequent check timeouts on the org wide version. This rolls
back to the Kibana version
2024-07-19 13:20:12 -05:00
Dzmitry Lemechko
88464e5b6d
[FTR] split configs by target into multiple manifest files (#187440)
## Summary

Part of #186515

Split FTR configs manifest into multiple files based on distro
(serverless/stateful) and area of testing (platform/solutions)
Update the CI scripts to support the change, but without logic
modification

More context:

With this change we will have a clear split of FTR test configs owned by
Platform and Solutions. It is a starting point to make configs
discoverable, our test pipelines be flexible and run tests based on
distro/solution.
2024-07-19 15:00:53 +02:00
Alex Szabo
ba3f83cd3d
[CI] Remove kme leftovers (take 2) (#187947)
## Summary
Retries #187762 again. There was a partially removed step in the
previous attempt, that's now fully removed.
2024-07-10 16:01:06 +02:00
Alex Szabo
ea2509914f
[BK] Migrate es-forward (+add versions.json dependent triggering) (#184018)
## Goal
We'd like to introduce a way to run pipelines that have a dependency on
the currently active branch set (managed in
[versions.json](./versions.json)).

With this, we'd like to migrate over the `es-forward` pipelines
(currently:
[this](https://buildkite.com/elastic/kibana-7-dot-17-es-8-dot-15-forward-compatibility),
and
[this](https://buildkite.com/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility))
to the new buildkite infra.

## Summary
This PR introduces a new pipeline:
https://buildkite.com/elastic/kibana-trigger-version-dependent-jobs
(through
[trigger-version-dependent-jobs.yml](.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml)).

The purpose of this new pipeline is to take the name of a "pipelineSet"
that refers to a pipeline, and based on the `versions.json` file, work
out what are the branches on which the referred pipeline should be
triggered.

### Example: `Trigger ES forward compatibility tests`
- a scheduled run on
[kibana-trigger-version-dependent-jobs](https://buildkite.com/elastic/kibana-trigger-version-dependent-jobs)
with the env var `TRIGGER_PIPELINE_SET=es-forward` runs
- the pipeline implementation for
`kibana-trigger-version-dependent-jobs` works out (looking at
`versions.json`), that the `es-forward` set should trigger
https://buildkite.com/elastic/kibana-es-forward (doesn't exist prior to
the PR) for (7.17+8.14) and (7.17+8.15)
- the pipeline implementation uploads two trigger steps, running
https://buildkite.com/elastic/kibana-es-forward in two instances with
the relevant parameterization.

Since the trigger parameters are derived from the `versions.json` file,
if we move on and close `8.14`, and open up `8.16`, this will follow,
without having to update the pipeline resources or schedules.

## Changes
- 2 pipelines created:
[trigger-version-dependent-jobs.yml](.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml),
[kibana-es-forward.yml](.buildkite/pipeline-resource-definitions/kibana-es-forward.yml)
   - [x] add kibana-es-forward.yml
 - implementation for `trigger-version-dependent-jobs` added
- branch configuration removed from pipelines (kibana-artifacts-staging,
kibana-artifacts-snapshot, kibana-artifacts-trigger)
 - added a script for checking RREs validity (moved a few files)

## Verification
I've used the migration staging pipeline (*) to run this:
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/130
   - Env: `TRIGGER_PIPELINE_SET="artifacts-trigger"`
- Result:
[(success):](https://buildkite.com/elastic/kibana-artifacts-trigger/builds/10806)
it triggered for 8.14 only (as expected)
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/131
   - Env: `TRIGGER_PIPELINE_SET="es-forward"`
- Result: (success): it generated 2 trigger steps, but since the
es-forward pipeline doesn't exist, the upload step failed
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/132
   - Env: `TRIGGER_PIPELINE_SET="artifacts-snapshot"`
- Result: (success): it triggered jobs for all 3 open branches
(main/8.14/7.17)
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/134
   - Env: `TRIGGER_PIPELINE_SET="artifacts-staging"`
   - Result: (success): it triggered 8.14 / 7.14, but not for main


(*note: this migration staging pipeline will come in handy even after
the migration, to stage newly created pipelines without creating the
resource up-front)
2024-07-10 12:08:16 +02:00
Jonathan Budzenski
369277fcbc Revert "[CI] Remove kme leftovers (#187762)"
This reverts commit 41ee64709f.
2024-07-09 13:05:08 -05:00
Alex Szabo
41ee64709f
[CI] Remove kme leftovers (#187762)
## Summary
These were used for testing the migration from the kibana-buildkite
infra to the elastic-wide buildkite infra. Now we're done with most of
the migration, we can clean these up.
2024-07-10 03:36:34 +10:00
Jon
5b0dc5faeb
[ci] Use org wide PR comment bot (#187354) 2024-07-02 10:03:58 -05:00
Brad White
d4011ae655
[CI] Switch to prod FIPS image (#186939)
## Summary

The FIPS image has been promoted to `prod` project so use it instead of
`qa`.
2024-06-26 09:08:04 -07:00
Brad White
324673c8d6
[ci / FIPS] Dynamic agent selection. Add FIPS agents (#183777)
## Summary

- Closes https://github.com/elastic/kibana-operations/issues/100
- Utilizes FIPS agent from elastic/ci-agent-images#686
- Adds dynamic agent selection during PR pipeline upload
- FIPS agents can be used with `FTR_ENABLE_FIPS_AGENT` env variable or
`ci:enable-fips-agent` label
- Removes agent image config from individual steps in favor of image
config for the whole pipeline.
- Steps can still override this config by adding `image`, `imageProject`
etc
- Adds a conditional assertion to `Check` CI step which validates that
FIPS is working properly


### Testing
- [Pipeline run using FIPS
agents](https://buildkite.com/elastic/kibana-pull-request/builds/215332)
  - Failures are expected and this possibly ran with flaky tests
2024-06-20 13:09:45 -07:00
Alex Szabo
c2986d9a6f
[CI] Fix missing test failure annotations (#186446)
## Summary
rename `SLACK_NOTIFICATIONS_ENABLED` =>
`ELASTIC_SLACK_NOTIFICATIONS_ENABLED` to follow up on elastic-wide
buildkite changes.
This should re-enable test failure listing on the slack errors we post.
2024-06-19 15:55:18 +01:00
Jon
b98fc1418b
[ci] Prevent alerts for spot preemptions (#186329)
After migrating to gobld, the string identifying spot instances has
changed. This updates the check to determine if there are retries
available by filtering on the metadata for both gobld and
buildkite-agent-manager.
2024-06-18 08:13:09 -05:00
Alex Szabo
09a165f3e6
[BK] Migrate batch 2 - kibana-pull-request job (#183158)
## Summary

Part of: https://github.com/elastic/kibana-operations/issues/79

Migrates: 
- kibana / pull-request
[base.yml](https://buildkite.com/elastic/kibana-pull-request)

## Validations
- [x] Validated RRE locally

Tested on the kme test pipeline: 
- [x] Main: https://buildkite.com/elastic/kibana-kme-test/builds/343
- [x] [8.14](https://github.com/elastic/kibana/pull/183537):
https://buildkite.com/elastic/kibana-kme-test/builds/340
- [x] [7.17](https://github.com/elastic/kibana/pull/183707):
https://buildkite.com/elastic/kibana-kme-test/builds/339
2024-05-24 10:37:36 +02:00
Alex Szabo
38d4230e61
[CI] Comment flaky test results on tested PR (#183043)
## Summary
Extends the flaky-test-runner with the capability to comment on the
flaky test runs on the PR that's being tested.

Closes: https://github.com/elastic/kibana/issues/173129

- chore(flaky-test-runner): Add a step to collect results and comment on
the tested PR
2024-05-13 03:47:30 -07:00
Alex Szabo
78cc5fdb82
[Ops/BK] Make pick_test_group_run_order targeting work on both buildkite infras (#180078)
## Summary
While the daily coverage job is migrated
(https://buildkite.com/elastic/kibana-code-coverage-main/) to the new
infra, it will want to make use of the `pick_test_group_run_order` to
schedule jest tests. However, the generated pipline steps would need
some adjustment on the new infra.

This PR adds a branching function that generates agent targeting rules
that work according to the serving infra.

Fixes the issue:
https://buildkite.com/elastic/kibana-pull-request/builds/201218
2024-04-05 16:20:00 +02:00
Alex Szabo
171b758bb0
[Ops] Decouple serverless release from tags (#176505)
## Summary
Removes resource def and pipeline for:
https://buildkite.com/elastic/kibana-serverless-release
Adds a step after deploy tag creation to trigger a GPCTL release flow
for the commit hash - this step needs to be emitted because some of its
parameters are not available at the time of uploading the original
pipeline file.

- [x] Test without firing off a release
<img width="1250" alt="Screenshot 2024-02-23 at 11 43 08"
src="f8b2fd04-8b44-4beb-949e-5f45a3573bc5">

Closes https://github.com/elastic/kibana-operations/issues/59 - see this
for the full context.

---------

Co-authored-by: Thomas Watson <w@tson.dk>
2024-02-23 17:58:13 +01:00
Jon
c3983b85a5
[ci] Add jest retry (#174389)
If a jest test is flaky, we want to retry a single step instead of
re-running the entire pipeline.
2024-01-05 15:25:31 -06:00
Jon
5951512197
[ci] Avoid unintended notifications on failing test comment (#174124) 2024-01-03 11:52:52 -06:00
Alex Szabo
6b0f47c5c4
[Ops] Auto promote serverless rc (#172037)
## Summary
Uses the mechanisms from above to decide what recent commit passed all
three checks successfully (on-merge job, artifact build, FTR tests
containing that commit).

If `AUTO_SELECT_COMMIT` is set to `1/true`, the release candidate will
automatically be selected and tagged. This proceeds to QA automatically
afterward.

Builds on #170655

Example run:
https://buildkite.com/elastic/kibana-serverless-release-1/builds/83
Closes: https://github.com/elastic/kibana-operations/issues/30

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Thomas Watson <watson@elastic.co>
2023-12-04 09:21:56 +01:00
Alex Szabo
1208a8e6b5
[Ops] Buildkite job for serverless deployment (#170655)
## Summary
Connected to: https://github.com/elastic/kibana-operations/issues/18
Pre-requisite for:
https://github.com/elastic/kibana-operations/issues/30

You can test the current assistant from the branch:
https://buildkite.com/elastic/kibana-serverless-release-1/builds?branch=buildkite-job-for-deployment
- use `DRY_RUN=1` in the runtime params to not trigger an actual release
:)

This PR creates the contents of a Buildkite job to assist the Kibana
Serverless Release initiation process at the very beginning and lay some
groundwork for further additions to the release management.

At the end of the day, we would like to create a tag deploy@<timestamp>
which will be picked up by another job that listens to these tags:
https://buildkite.com/elastic/kibana-serverless-release. However,
several parts of the preparation for release require manual research,
collecting information about target releases, running scripts, etc.

Any further addition to what would be useful for someone wanting to
start a release could be contained here.

Furthermore, we could also trigger downstream jobs from here. e.g.:
https://buildkite.com/elastic/kibana-serverless-release is currently set
up to listen for a git tag, but we may as well just trigger the job
after we've created a tag.

Check out an example run at:
https://buildkite.com/elastic/kibana-serverless-release-1/builds/72
(visible only if you're a
member of @ elastic/kibana-release-operators) 

Missing features compared to the git action:

- [x] Slack notification about the started deploy
- [x] full "useful links" section

Missing features:
- [x] there's a bit of useful context that should be integrated to the
display of the FTR results (*)
- [x] skip listing and analysis if a commit sha is passed in env


(*) - Currently, we display the next FTR test suite that ran after the
merge of the PR. However, the next FTR that will contain the changes,
and show useful info related to the changeset is ONLY in the FTR that's
ran after the first successful onMerge after the merge commit. Meaning:
if main is failing when the change is merged, an FTR suite won't pick up
the change right after.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Thomas Watson <watson@elastic.co>
2023-12-01 07:10:52 -07:00
Alex Szabo
750989beb9
[Ops] Trim long stat blocks (#171997)
## Summary
Some post-build steps are failing because sometimes we're outgrowing the
buildkite metadata limits.

This PR will prevent upload of a text block too big, instead it will try
to gesture towards the build for more info.
2023-11-27 11:43:03 -07:00
Brad White
17ed0748e8
fix/redact axios headers (#171803)
Fix token things

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-22 22:12:33 +00:00
Jon
f423ad3fc3
[ci] Fix test group ordering for external jobs (#170574)
Pipelines running triggered builds against older commits can create ci
stats with out of date metrics. When used as a reference point against
the branch HEAD, the number of selected groups may not accurately
reflect the current state.
2023-11-06 09:29:45 +01:00
Alex Szabo
3a48bc9289
[Ops] ES Serverless verification: tag based filtering (#168374)
## Summary
Allows for env-var controlled filtering of executed test suites in the
ES Serverless verification job, and adjusts existing flags and behaviour
to better-fit future usage.

We're changing the job to not publish the `latest-verified` tag by
default. This is to prevent external calls to the job from accidentally
promoting random tags to `latest-verified`, see changes below.

Flag changes: 
- `PUBLISH_DOCKER_TAG`: if set to 1/true, passing runs will promote the
tested ES Serverless tag to `latest-verified`.
   - (used to be default, now it requires this flag)
- `PUBLISH_MANIFEST`: if set to 1/true, passing runs will upload the
manifest attesting what (kibana + es) combination was used in the test
   - (used to be called `UPLOAD_MANIFEST`)
- `SKIP_CYPRESS`: if set to 1/true, it will skip running the cypress
tests
   - new flag
- `FTR_EXTRA_ARGS`: a string argument, if passed, it will be forwarded
verbatim to the FTR run script
- new flag, can be used to control the filtering required for #167611
(eg.: `FTR_EXTRA_ARGS="--include-tag=ml"`)

Example run:

https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote/builds/64#018b1a30-3360-4995-874a-864f18e104d5

Closes: #168376
2023-10-11 09:49:46 +02:00
Tre
245f385007
[Build Kite][Code Coverage] Drop ftr_run_order.json (#151114)
## Summary 

As of last year we stopped supporting FTR configs
in the code coverage buildkite job.

While investigating a flaky test,
I noticed the file's presence in
the buildkite artifacts ui.

This pr drops that.

**Note to Reviewers:**
`.buildkite/scripts/steps/test/pick_test_group_run_order.sh` is
currently used in 4 places:

1. `.buildkite/pipelines/code_coverage/daily.yml` **this is where this
pr is concerned**
1. `.buildkite/pipelines/pull_request/base.yml`
1. `.buildkite/pipelines/on_merge.yml`
1. `.buildkite/pipelines/es_snapshots/verify.yml`

This change is small but this file is shared, so we've to keep this in
mind.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-22 11:39:06 +00:00
Jon
902f86a066
[ci] Increase FTR timeout (#148677)
FTR groups on CI target a 40 minute runtime. In situations where tests
are updated or moved, and there's no prior data, we're seeing occasional
timeouts with a 60 minute timeout. This increases the timeout to 90
minutes.
2023-01-10 15:02:04 -07:00
Spencer
98613be316
Revert change of default minutes for unknown Jest configs 2022-12-22 21:47: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
Jonathan Budzenski
ab2f1fe84a
[ci] Shorten timeout for jest and ftr steps (#146636)
We're seeing sporadic image outages today causing test steps to reach
their max timeout. Currently we displays warnings on configurations
taking >40? minutes. This decreases the error timeout for jest and ftr
configurations to 60 minutes.


https://buildkite.com/elastic/kibana-on-merge/builds/24321#0184c4b6-ae6c-4777-a637-20d34feba777
https://buildkite.com/elastic/kibana-on-merge/builds/24279#0184c3d0-5b12-4c8b-9e8c-6c7b67638661

I'll follow up with a separate issue for better error handling during
test setup.
2022-11-29 17:26:07 -06:00
Jonathan Budzenski
64bae2ea09
skip src/core/server/integration_tests/ui_settings/jest.integration.config.js (#145646)
This suite has become flaky:

https://buildkite.com/elastic/kibana-on-merge/builds/23746#01848784-7e14-4800-b63a-bfc5905864d7/3656-4619
https://buildkite.com/elastic/kibana-on-merge/builds/23745#01848782-d6ff-42f5-a111-6f2608db2c47/2443-3188
2022-11-17 18:04:11 -06:00
Spencer
fcea2e7d4d
[ci/longFtrGroup] reduce annotation to warning, tell people not to worry (#143678) 2022-10-19 13:22:54 -07:00
Spencer
65d3ade20d
[watcher] disable jest config in CI, it's regularly failing (#141677) 2022-09-23 10:50:47 -07:00
Spencer
ab576bb6c1
add a timeout to buildkite artifact downloads (#139046) 2022-08-18 09:50:34 -07:00