Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
Browse files Browse the repository at this point in the history
…ocs'
  • Loading branch information
kibanamachine authored and CoenWarmer committed Nov 10, 2023
1 parent fadd13d commit fd3fe67
Show file tree
Hide file tree
Showing 133 changed files with 459 additions and 363 deletions.
33 changes: 14 additions & 19 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ disabled:
- x-pack/test/defend_workflows_cypress/cli_config.ts
- x-pack/test/defend_workflows_cypress/config.ts
- x-pack/test/defend_workflows_cypress/serverless_config.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config_open.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config_runner.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config.ts
- x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config_open.ts
- x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config_runner.ts
- x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts
- x-pack/test/osquery_cypress/cli_config.ts
- x-pack/test/osquery_cypress/serverless_cli_config.ts
- x-pack/test/osquery_cypress/config.ts
Expand All @@ -45,22 +45,22 @@ disabled:
- x-pack/test/functional_enterprise_search/visual_config.ts
- x-pack/test/functional_enterprise_search/cli_config.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config_open.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_open.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_run.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config.ts
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_headless.ts
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_runner.ts
- x-pack/test/security_solution_cypress/serverless_config.ts
- x-pack/plugins/profiling/e2e/ftr_config_open.ts
- x-pack/plugins/profiling/e2e/ftr_config_runner.ts
- x-pack/plugins/profiling/e2e/ftr_config.ts
- x-pack/plugins/observability_solution/profiling/e2e/ftr_config_open.ts
- x-pack/plugins/observability_solution/profiling/e2e/ftr_config_runner.ts
- x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts

# Elastic Synthetics configs
- x-pack/plugins/synthetics/e2e/config.ts
- x-pack/plugins/uptime/e2e/uptime/synthetics_run.ts
- x-pack/plugins/synthetics/e2e/synthetics/synthetics_run.ts
- x-pack/plugins/ux/e2e/synthetics_run.ts
- x-pack/plugins/exploratory_view/e2e/synthetics_run.ts
- x-pack/plugins/observability_solution/synthetics/e2e/config.ts
- x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.ts
- x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts
- x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts
- x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts

# Configs that exist but weren't running in CI when this file was introduced
- x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/config.ts
Expand Down Expand Up @@ -462,8 +462,3 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts





2 changes: 1 addition & 1 deletion .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ steps:
depends_on: build
timeout_in_minutes: 120
artifact_paths:
- 'x-pack/plugins/synthetics/e2e/.journeys/**/*'
- 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
depends_on: build
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/exploratory_view/e2e/.journeys/**/*'
- 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/synthetics_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
depends_on: build
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/synthetics/e2e/.journeys/**/*'
- 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/uptime_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
depends_on: build
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/synthetics/e2e/.journeys/**/*'
- 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/ux_plugin_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
depends_on: build
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/ux/e2e/.journeys/**/*'
- 'x-pack/plugins/observability_solution/ux/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/apm_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ echo "--- APM Cypress Tests"

cd "$XPACK_DIR"

node plugins/apm/scripts/test/e2e.js \
node plugins/observability_solution/apm/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
$CYPRESS_ARGS
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Exploratory View plugin @elastic/synthetics Tests"

cd "$XPACK_DIR"

node plugins/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
node plugins/observability_solution/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ echo "--- Observability onboarding Cypress Tests"

cd "$XPACK_DIR"

node plugins/observability_onboarding/scripts/test/e2e.js \
node plugins/observability_solution/observability_onboarding/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/profiling_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ echo "--- Profiling Cypress Tests"

cd "$XPACK_DIR"

NODE_OPTIONS=--openssl-legacy-provider node plugins/profiling/scripts/test/e2e.js \
NODE_OPTIONS=--openssl-legacy-provider node plugins/observability_solution/profiling/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/synthetics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- synthetics @elastic/synthetics Tests"

cd "$XPACK_DIR"

node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*"
node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*"
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/synthetics_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Synthetics plugin @elastic/synthetics Tests"

cd "$XPACK_DIR"

node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/uptime_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Uptime plugin @elastic/synthetics Tests"

cd "$XPACK_DIR"

node plugins/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
node plugins/observability_solution/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/ux_synthetics_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- User Experience @elastic/synthetics Tests"

cd "$XPACK_DIR"

node plugins/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
node plugins/observability_solution/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
18 changes: 9 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,8 @@ packages/kbn-monaco/src/esql @elastic/kibana-visualizations
# Actionable observability
x-pack/packages/observability/alert_details @elastic/actionable-observability
x-pack/test/observability_functional @elastic/actionable-observability
x-pack/plugins/infra/public/alerting @elastic/actionable-observability
x-pack/plugins/infra/server/lib/alerting @elastic/actionable-observability
x-pack/plugins/observability_solution/infra/public/alerting @elastic/actionable-observability
x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/actionable-observability

# Observability robots
/.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots
Expand Down Expand Up @@ -975,16 +975,16 @@ x-pack/plugins/infra/server/lib/alerting @elastic/actionable-observability
/x-pack/test/alerting_api_integration/observability/index.ts @elastic/uptime

# Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/components/app/rum_dashboard @elastic/uptime
/x-pack/plugins/observability_solution/apm/public/application/uxApp.tsx @elastic/uptime
/x-pack/plugins/observability_solution/apm/public/components/app/rum_dashboard @elastic/uptime
/x-pack/test/apm_api_integration/tests/csm/ @elastic/uptime

# Observability onboarding tour
/x-pack/plugins/observability_shared/public/components/tour @elastic/platform-onboarding
/x-pack/plugins/observability_solution/observability_shared/public/components/tour @elastic/platform-onboarding
/x-pack/test/functional/apps/infra/tour.ts @elastic/platform-onboarding

# Observability settings
/x-pack/plugins/observability/server/ui_settings.ts @elastic/obs-docs
/x-pack/plugins/observability_solution/observability/server/ui_settings.ts @elastic/obs-docs

### END Observability Plugins

Expand Down Expand Up @@ -1413,8 +1413,8 @@ x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_en
**/*.scss @elastic/kibana-design

# Observability design
/x-pack/plugins/apm/**/*.scss @elastic/observability-design
/x-pack/plugins/infra/**/*.scss @elastic/observability-design
/x-pack/plugins/observability_solution/apm/**/*.scss @elastic/observability-design
/x-pack/plugins/observability_solution/infra/**/*.scss @elastic/observability-design
/x-pack/plugins/fleet/**/*.scss @elastic/observability-design
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design

Expand Down Expand Up @@ -1443,7 +1443,7 @@ x-pack/plugins/translations/translations
x-pack/test/profiling_api_integration @elastic/profiling-ui

# Observability shared profiling
x-pack/plugins/observability_shared/public/components/profiling @elastic/profiling-ui
x-pack/plugins/observability_solution/observability_shared/public/components/profiling @elastic/profiling-ui

# Shared UX
packages/react @elastic/appex-sharedux
Expand Down
44 changes: 22 additions & 22 deletions .github/paths-labeller.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
- "Feature:Embedding":
- "src/plugins/embeddable/**/*.*"
- "src/plugins/dashboard_embeddable_container/**/*.*"
- "Feature:Drilldowns":
- "x-pack/plugins/drilldowns/**/*.*"
- "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/**/*.*"
- "Feature:ExpressionLanguage":
- "src/plugins/expressions/**/*.*"
- "src/plugins/bfetch/**/*.*"
- "Team:apm":
- "x-pack/plugins/apm/**/*.*"
- "x-pack/test/apm_api_integration/**/*.*"
- "packages/kbn-apm-synthtrace/**/*.*"
- "packages/kbn-apm-synthtrace-client/**/*.*"
- "packages/kbn-apm-utils/**/*.*"
- "Team:Fleet":
- "x-pack/plugins/fleet/**/*.*"
- "x-pack/test/fleet_api_integration/**/*.*"
- "Team:uptime":
- "x-pack/plugins/synthetics/**/*.*"
- "x-pack/plugins/ux/**/*.*"
- "x-pack/plugins/observability/public/components/shared/exploratory_view/**/*.*"
- 'Feature:Embedding':
- 'src/plugins/embeddable/**/*.*'
- 'src/plugins/dashboard_embeddable_container/**/*.*'
- 'Feature:Drilldowns':
- 'x-pack/plugins/drilldowns/**/*.*'
- 'x-pack/plugins/dashboard_enhanced/public/services/drilldowns/**/*.*'
- 'Feature:ExpressionLanguage':
- 'src/plugins/expressions/**/*.*'
- 'src/plugins/bfetch/**/*.*'
- 'Team:apm':
- 'x-pack/plugins/observability_solution/apm/**/*.*'
- 'x-pack/test/apm_api_integration/**/*.*'
- 'packages/kbn-apm-synthtrace/**/*.*'
- 'packages/kbn-apm-synthtrace-client/**/*.*'
- 'packages/kbn-apm-utils/**/*.*'
- 'Team:Fleet':
- 'x-pack/plugins/fleet/**/*.*'
- 'x-pack/test/fleet_api_integration/**/*.*'
- 'Team:uptime':
- 'x-pack/plugins/observability_solution/synthetics/**/*.*'
- 'x-pack/plugins/observability_solution/ux/**/*.*'
- 'x-pack/plugins/observability_solution/observability/public/components/shared/exploratory_view/**/*.*'
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ npm-debug.log*
## @cypress/snapshot from apm plugin
/snapshots.js
/apm-diagnostics*.json
/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png
/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png
/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png
/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png

# transpiled cypress config
x-pack/plugins/fleet/cypress.config.d.ts
Expand Down
34 changes: 22 additions & 12 deletions TYPESCRIPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Converting existing code

To convert existing code over to TypeScript:

1. rename the file from `.js` to either `.ts` (if there is no html or jsx in the file) or `.tsx` (if there is).
2. Ensure eslint is running and installed in the IDE of your choice. There will usually be some linter errors after the file rename.
3. Auto-fix what you can. This will save you a lot of time! VSCode can be set to auto fix eslint errors when files are saved.
Expand Down Expand Up @@ -36,8 +37,8 @@ Some background on the differences between module declaration and augmentation:

In TypeScript module declarations can not be merged, which means each module can only be declared once. But it is possible to augment previously declared modules. The documentation about the distinction between module declaration and augmentation is sparse. The observed rules for `declare module '...' {}` in a `.d.ts` file seem to be:

* it is treated as a module declaration when the file itself is not a module
* it is treated as a module augmentation when the file itself is module
- it is treated as a module declaration when the file itself is not a module
- it is treated as a module augmentation when the file itself is module

A `.d.ts` file is treated as a module if it contains any top-level `import` or `export` statements. That means that in order to write a module declaration the `import`s must be contained within the `declare` block and none must be located on the topmost level. Conversely, to write a module augmentation there must be at least one top-level `import` or `export` and the `declare` block must not contain any `import` statements.

Expand Down Expand Up @@ -67,6 +68,7 @@ declare module '@elastic/eui' {
For example:

metadata.js:

```js
export let metadata = null;

Expand All @@ -76,6 +78,7 @@ export function __newPlatformInit__(legacyMetadata) {
```

documentation_links.js:

```js
import { metadata } from './metadata';

Expand All @@ -85,6 +88,7 @@ export const DOC_LINK_VERSION = metadata.branch;
To TypeScript `documentation_links.js` you'll need to add a type definition for `metadata.js`

metadata.d.ts

```
declare interface Metadata {
public branch: string;
Expand All @@ -110,14 +114,15 @@ If that happens, just pick the closest one.
If yarn doesn't find the module it may not have types. For example, our `rison_node` package doesn't have types. In this case you have a few options:

1. Contribute types into the DefinitelyTyped repo itself, or
2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/legacy/plugins/infra/types/rison_node.d.ts`. Other code uses it too, so we will need to pull it up. Or,
2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/legacy/plugins/observability_solution/infra/types/rison_node.d.ts`. Other code uses it too, so we will need to pull it up. Or,
3. Add a `// @ts-ignore` line above the import. This should be used minimally, the above options are better. However, sometimes you have to resort to this method.

### TypeScripting react files

React has its own concept of runtime types via `proptypes`. TypeScript gives you compile time types so I prefer those.

Before:

```jsx

import PropTypes from 'prop-types';
Expand All @@ -138,8 +143,8 @@ import PropTypes from 'prop-types';
```

After:
```tsx

```tsx
interface Props {
text: string;
}
Expand All @@ -148,15 +153,15 @@ interface State {
buttonWasClicked: boolean;
}

export class Button extends Component<Props, State> {
state = {
buttonWasClicked = false
};
export class Button extends Component<Props, State> {
state = {
buttonWasClicked = false,
};

render() {
return <button onClick={() => setState({ buttonWasClicked: true })}>{this.props.text}</button>
}
}
render() {
return <button onClick={() => setState({ buttonWasClicked: true })}>{this.props.text}</button>;
}
}
```

Note that the name of `Props` and `State` doesn't matter, the order does. If you are exporting those interfaces to be used elsewhere, you probably should give them more fleshed out names, such as `ButtonProps` and `ButtonState`.
Expand All @@ -174,13 +179,15 @@ In react proptypes, we often will use `PropTypes.func`. In TypeScript, a functio
Especially since we often use the spread operator, this syntax is a little different and probably worth calling out.

Before:

```js
function ({ title, description }) {
...
}
```

After:

```ts
function ({ title, description }: {title: string, description: string}) {
...
Expand All @@ -205,6 +212,7 @@ Using any is sometimes valid, but should rarely be used, even if to make quicker
If you use a variable that isn't initially defined, you should give it a type, or it will be `any` by default (and strangely this isn't a warning, even though I think it should be)

Before - `color` will be type `any`:

```js
let color;

Expand All @@ -216,6 +224,7 @@ if (danger) {
```

After - `color` will be type `string`:

```ts
let color: string;

Expand All @@ -240,6 +249,7 @@ anySet.add('2');
```

So we should explicitly define types for default constructors whenever possible:

```ts
const typedMap = new Map<string, number>();
typedMap.set('1', 2);
Expand Down
Loading

0 comments on commit fd3fe67

Please sign in to comment.