Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FTR] split configs by target into multiple manifest files #187440

Merged
merged 25 commits into from
Jul 19, 2024

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Jul 3, 2024

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.

Copy link
Contributor

github-actions bot commented Jul 3, 2024

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@dmlemeshko dmlemeshko changed the title Ftr/split configs by target [FTR] split configs by target into multiple manifest files Jul 3, 2024
@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko
Copy link
Member Author

/ci

@@ -16,8 +16,11 @@ import { BuildkiteClient, BuildkiteStep } from '../buildkite';
import { CiStatsClient, TestGroupRunOrderResponse } from './client';

import DISABLED_JEST_CONFIGS from '../../disabled_jest_configs.json';
import { serverless, stateful } from './ftr_configs_manifests.json';
Copy link
Member Author

@dmlemeshko dmlemeshko Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using json to store manifests paths because importing constant from .buildkite/pipeline-utils into packages/kbn-test won't work and I don't like the idea of solving it with ts-ignore. Open for suggestions here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding living in two different tsconfig.json files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding living in two different tsconfig.json files?

This code is living on its own, but manifest files loading is also happening in packages/kbn-test. The issue is that pipeline-utils is not a package, otherwise we can easily import it as a dependency.
I think for the start json is ok, but maybe we should change depending on how we plan to access the manifest based on distro/project type

- ftr_oblt_stateful_configs.yml
- ftr_security_stateful_configs.yml
- ftr_search_stateful_configs.yml
If you’re writing a plugin outside the {kib} repo, you will have your own config file.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pheyos This is the only place where we mentioned original manifest file. Do you think we need to add more context here or put this info in other place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine and we don't need to add more context here.

@@ -67,7 +67,7 @@ async function getConfigModule({
) {
const rel = Path.relative(REPO_ROOT, resolvedPath);
throw createFlagError(
`Refusing to load FTR Config at [${rel}] which is not listed in [${FTR_CONFIGS_MANIFEST_REL}]. All FTR Config files must be listed there, use the "enabled" key if the FTR Config should be run on automatically on PR CI, or the "disabled" key if it is run manually or by a special job.`
`Refusing to load FTR Config at [${rel}] which is not listed in [${ALL_FTR_MANIFEST_REL_PATHS}]. All FTR Config files must be listed in one of manifest files, use the "enabled" key if the FTR Config should be run on automatically on PR CI, or the "disabled" key if it is run manually or by a special job.`
);
Copy link
Member Author

@dmlemeshko dmlemeshko Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will print out all the manifests here, but probably we can only print the ones related to the distro (e.g. only serverless manifests) assuming the FTR config has a clear definition where it should be run

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 70 is a little bit like a wall of text, can we break it up a tiny bit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I will split it

@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko
Copy link
Member Author

/ci

Comment on lines +80 to +83
`The following files look like FTR configs which are not listed in one of manifest files:\nstateful: ${manifestPaths.stateful}\nserverless: ${manifestPaths.serverless}\n - ${invalidList}`
);
throw createFailError(
`Please add the listed paths to .buildkite/ftr_configs.yml. If it's not an FTR config, you can add it to the IGNORED_PATHS in ${THIS_REL} or contact #kibana-operations`
`Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in ${THIS_REL} or contact #kibana-operations`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After update the message is:

ERROR The following files look like FTR configs which are not listed in one of manifest files:
      stateful: .buildkite/ftr_platform_stateful_configs.yml,.buildkite/ftr_oblt_stateful_configs.yml,.buildkite/ftr_security_stateful_configs.yml,.buildkite/ftr_search_stateful_configs.yml
      serverless: .buildkite/ftr_base_serverless_configs.yml,.buildkite/ftr_oblt_serverless_configs.yml,.buildkite/ftr_security_serverless_configs.yml,.buildkite/ftr_search_serverless_configs.yml
        - x-pack/test/api_integration/apis/cloud_security_posture/config.ts
        - x-pack/test/cloud_security_posture_api/config.ts
        - x-pack/test/cloud_security_posture_functional/config.ts
        - x-pack/test/fleet_cypress/cli_config.ts
        - x-pack/test/fleet_cypress/visual_config.ts
        - x-pack/test/functional/apps/apm/config.ts
        - x-pack/test/functional/apps/search_playground/config.ts
ERROR Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts or contact #kibana-operations

@dmlemeshko
Copy link
Member Author

/ci

var path = require('path');

var manifestsJsonPath = path.resolve(__dirname, '../.buildkite/ftr_configs_manifests.json');
console.log(manifestsJsonPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use an actual logger, instead of console?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, it's probably not loaded yet right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is a vanilla js script that you added a while ago, my change broke it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added? I can't recall, but I believe ya

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now.

uniqueQueues.add(manifest.defaultQueue);
}
} catch (_) {
const error = _ instanceof Error ? _ : new Error(`${_} thrown`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal happy (opposite of nit) is the _.
Years of fp makes me happy to see this Dima.

No wasted time or thought in naming an uninteresting symbol. Good stuff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to make as little changes as possible and kept the original error handling by Brian in place, not sure about the code style that was followed here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a notation style very common in fp langs, such as Haskell, F#.Net, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and in javascript

@dmlemeshko dmlemeshko marked this pull request as ready for review July 3, 2024 15:31
@dmlemeshko dmlemeshko requested a review from a team as a code owner July 3, 2024 15:31
Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me. The current changes are a good first step forward on setting the stones to achieve future ability on running only a current type of tests. Also it doesn't seems like the current changes are going to affect for now the ci stats.

@dmlemeshko
Copy link
Member Author

dmlemeshko commented Jul 17, 2024

Also it doesn't seems like the current changes are going to affect for now the ci stats

It will affect flaky test runner as manifest file is replaced with multiple ones, but if we merge elastic/kibana-ci-stats/pull/831 first backward compatibility will be in place

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@dmlemeshko dmlemeshko changed the title [DO NOT MERGE][FTR] split configs by target into multiple manifest files [FTR] split configs by target into multiple manifest files Jul 19, 2024
@dmlemeshko dmlemeshko merged commit 88464e5 into elastic:main Jul 19, 2024
20 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 187440

Questions ?

Please refer to the Backport tool documentation

dmlemeshko added a commit that referenced this pull request Jul 22, 2024
## Summary

During #187440 we lost some FTR configs, this PR adds it back.
dmlemeshko added a commit that referenced this pull request Jul 22, 2024
## Summary

Follow-up to #188825

@crespocarlos reported that some Oblt configs after missing after
#187440

I was using `node scripts/check_ftr_configs.js` to validate I did not
miss anything and decided to debug the script.

We had a pretty strict config file content validation like
`testRunner|testFiles`, that was skipping some FTR configs like
`x-pack/test/apm_api_integration/basic/config.ts`

I extended file content check to look for default export function and
also skip test/suite or Cypress-own config files.

In the end 7 FTR configs were discovered, but only 2 are with tests. I
will ask owners to confirm if it should be enabled/disabled. Script run
output:

```
node scripts/check_ftr_configs.js
ERROR The following files look like FTR configs which are not listed in one of manifest files:
        - x-pack/plugins/observability_solution/uptime/e2e/config.ts
        - x-pack/test/functional_basic/apps/ml/config.base.ts
        - x-pack/test/functional_basic/apps/transform/config.base.ts
        - x-pack/test/security_solution_api_integration/config/ess/config.base.trial.ts
        - x-pack/test_serverless/functional/test_suites/observability/cypress/oblt_config.base.ts

      Make sure to add your new FTR config to the correct manifest file.

      Stateful tests:
      .buildkite/ftr_platform_stateful_configs.yml
      .buildkite/ftr_oblt_stateful_configs.yml
      .buildkite/ftr_security_stateful_configs.yml
      .buildkite/ftr_search_stateful_configs.yml

      Serverless tests:
      .buildkite/ftr_base_serverless_configs.yml
      .buildkite/ftr_oblt_serverless_configs.yml
      .buildkite/ftr_security_serverless_configs.yml
      .buildkite/ftr_search_serverless_configs.yml

ERROR Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts or contact #kibana-operations
```
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 22, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

3 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 187440 locally

@Ikuni17 Ikuni17 added backport:skip This commit does not require backporting and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting FTR release_note:skip Skip the PR/issue when compiling release notes v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants