Skip to content

Commit 1514031

Browse files
authored
Merge branch 'main' into migrate-solution-toolbar-button
2 parents 82766a6 + 93a95fd commit 1514031

File tree

163 files changed

+28539
-1605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+28539
-1605
lines changed

.buildkite/pipelines/hourly.yml

+63-9
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,44 @@ steps:
5656
- command: .buildkite/scripts/steps/functional/oss_accessibility.sh
5757
label: 'OSS Accessibility Tests'
5858
agents:
59-
queue: ci-group-4d
59+
queue: n2-4-spot
6060
depends_on: build
6161
timeout_in_minutes: 120
6262
retry:
6363
automatic:
64-
- exit_status: '*'
64+
- exit_status: '1'
6565
limit: 1
66+
- exit_status: '-1'
67+
limit: 3
68+
- exit_status: '130'
69+
limit: 3
70+
- exit_status: '137'
71+
limit: 3
72+
- exit_status: '143'
73+
limit: 3
74+
- exit_status: '255'
75+
limit: 3
6676

6777
- command: .buildkite/scripts/steps/functional/xpack_accessibility.sh
6878
label: 'Default Accessibility Tests'
6979
agents:
70-
queue: n2-4
80+
queue: n2-4-spot
7181
depends_on: build
7282
timeout_in_minutes: 120
7383
retry:
7484
automatic:
75-
- exit_status: '*'
85+
- exit_status: '1'
7686
limit: 1
87+
- exit_status: '-1'
88+
limit: 3
89+
- exit_status: '130'
90+
limit: 3
91+
- exit_status: '137'
92+
limit: 3
93+
- exit_status: '143'
94+
limit: 3
95+
- exit_status: '255'
96+
limit: 3
7797

7898
- command: .buildkite/scripts/steps/functional/oss_firefox.sh
7999
label: 'OSS Firefox Tests'
@@ -89,13 +109,23 @@ steps:
89109
- command: .buildkite/scripts/steps/functional/xpack_firefox.sh
90110
label: 'Default Firefox Tests'
91111
agents:
92-
queue: n2-4
112+
queue: n2-4-spot
93113
depends_on: build
94114
timeout_in_minutes: 120
95115
retry:
96116
automatic:
97-
- exit_status: '*'
117+
- exit_status: '1'
98118
limit: 1
119+
- exit_status: '-1'
120+
limit: 3
121+
- exit_status: '130'
122+
limit: 3
123+
- exit_status: '137'
124+
limit: 3
125+
- exit_status: '143'
126+
limit: 3
127+
- exit_status: '255'
128+
limit: 3
99129

100130
- command: .buildkite/scripts/steps/functional/oss_misc.sh
101131
label: 'OSS Misc Functional Tests'
@@ -111,13 +141,23 @@ steps:
111141
- command: .buildkite/scripts/steps/functional/xpack_saved_object_field_metrics.sh
112142
label: 'Saved Object Field Metrics'
113143
agents:
114-
queue: n2-4
144+
queue: n2-4-spot
115145
depends_on: build
116146
timeout_in_minutes: 120
117147
retry:
118148
automatic:
119-
- exit_status: '*'
149+
- exit_status: '1'
120150
limit: 1
151+
- exit_status: '-1'
152+
limit: 3
153+
- exit_status: '130'
154+
limit: 3
155+
- exit_status: '137'
156+
limit: 3
157+
- exit_status: '143'
158+
limit: 3
159+
- exit_status: '255'
160+
limit: 3
121161

122162
- command: .buildkite/scripts/steps/test/jest.sh
123163
label: 'Jest Tests'
@@ -138,9 +178,23 @@ steps:
138178
- command: .buildkite/scripts/steps/test/api_integration.sh
139179
label: 'API Integration Tests'
140180
agents:
141-
queue: n2-2
181+
queue: n2-4-spot
142182
timeout_in_minutes: 120
143183
key: api-integration
184+
retry:
185+
automatic:
186+
- exit_status: '1'
187+
limit: 1
188+
- exit_status: '-1'
189+
limit: 3
190+
- exit_status: '130'
191+
limit: 3
192+
- exit_status: '137'
193+
limit: 3
194+
- exit_status: '143'
195+
limit: 3
196+
- exit_status: '255'
197+
limit: 3
144198

145199
- command: .buildkite/scripts/steps/lint.sh
146200
label: 'Linting'

WORKSPACE.bazel

+4
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ yarn_install(
6464
symlink_node_modules = True,
6565
quiet = False,
6666
frozen_lockfile = False,
67+
environment = {
68+
"SASS_BINARY_SITE": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass",
69+
"RE2_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2",
70+
}
6771
)

dev_docs/contributing/best_practices.mdx

+2-130
Original file line numberDiff line numberDiff line change
@@ -12,137 +12,9 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture']
1212
First things first, be sure to review our <DocLink id="kibDevPrinciples" text="development principles"/> and check out all the available
1313
platform <DocLink id="kibBuildingBlocks" text="building blocks"/> that can simplify plugin development.
1414

15-
## Developer documentation
15+
## Documentation
1616

17-
### High-level documentation
18-
19-
#### Structure
20-
21-
Refer to [divio documentation](https://documentation.divio.com/) for guidance on where and how to structure our high-level documentation.
22-
23-
<DocLink id="kibDevDocsWelcome" text="Getting started" /> and
24-
<DocLink id="kibPlatformIntro" text="Key concepts" /> sections are both _explanation_ oriented,
25-
<DocLink id="kibDevTutorialDebugging" text="Tutorials" /> covers both _tutorials_ and _How to_, and the <DocLink
26-
id="kibDevDocsApiWelcome"
27-
text="API documentation"
28-
/> section covers _reference_ material.
29-
30-
#### Location
31-
32-
If the information spans multiple plugins, consider adding it to the [dev_docs](https://github.com/elastic/kibana/tree/main/dev_docs) folder. If it is plugin specific, consider adding it inside the plugin folder. Write it in an mdx file if you would like it to show up in our new (beta) documentation system.
33-
34-
<DocCallOut title="internal only">
35-
36-
To add docs into the new docs system, create an `.mdx` file that
37-
contains <DocLink id="docsSyntax" section="frontmatter" text="frontmatter"/>. Read about the syntax <DocLink id="docsSyntax" text="here"/>. An extra step is needed to add a menu item. <DocLink id="docsSetup" text="These instructions" /> will walk you through how to set the docs system
38-
up locally and edit the nav menu.
39-
40-
</DocCallOut>
41-
42-
#### Keep content fresh
43-
44-
A fresh pair of eyes are invaluable. Recruit new hires to read, review and update documentation. Leads should also periodically review documentation to ensure it stays up to date. File issues any time you notice documentation is outdated.
45-
46-
#### Consider your target audience
47-
48-
Documentation in the Kibana Developer Guide is targeted towards developers building Kibana plugins. Keep implementation details about internal plugin code out of these docs.
49-
50-
#### High to low level
51-
52-
When a developer first lands in our docs, think about their journey. Introduce basic concepts before diving into details. The left navigation should be set up so documents on top are higher level than documents near the bottom.
53-
54-
#### Think outside-in
55-
56-
It's easy to forget what it felt like to first write code in Kibana, but do your best to frame these docs "outside-in". Don't use esoteric, internal language unless a definition is documented and linked. The fresh eyes of a new hire can be a great asset.
57-
58-
### API documentation
59-
60-
We automatically generate <DocLink id="kibDevDocsApiWelcome" text="API documentation"/>. The following guidelines will help ensure your <DocLink id="kibPlatformIntro" section="public-plugin-api" text="public APIs" /> are useful.
61-
62-
#### Code comments
63-
64-
Every publicly exposed function, class, interface, type, parameter and property should have a comment using JSDoc style comments.
65-
66-
- Use `@param` tags for every function parameter.
67-
- Use `@returns` tags for return types.
68-
- Use `@throws` when appropriate.
69-
- Use `@beta` or `@deprecated` when appropriate.
70-
- Use `@removeBy {version}` on `@deprecated` APIs. The version should be the last version the API will work in. For example, `@removeBy 7.15` means the API will be removed in 7.16. This lets us avoid mid-release cycle coordination. The API can be removed as soon as the 7.15 branch is cut.
71-
- Use `@internal` to indicate this API item is intended for internal use only, which will also remove it from the docs.
72-
73-
#### Interfaces vs inlined types
74-
75-
Prefer types and interfaces over complex inline objects. For example, prefer:
76-
77-
```ts
78-
/**
79-
* The SearchSpec interface contains settings for creating a new SearchService, like
80-
* username and password.
81-
*/
82-
export interface SearchSpec {
83-
/**
84-
* Stores the username. Duh,
85-
*/
86-
username: string;
87-
/**
88-
* Stores the password. I hope it's encrypted!
89-
*/
90-
password: string;
91-
}
92-
93-
/**
94-
* Retrieve search services
95-
* @param searchSpec Configuration information for initializing the search service.
96-
* @returns the id of the search service
97-
*/
98-
export getSearchService: (searchSpec: SearchSpec) => string;
99-
```
100-
101-
over:
102-
103-
```ts
104-
/**
105-
* Retrieve search services
106-
* @param searchSpec Configuration information for initializing the search service.
107-
* @returns the id of the search service
108-
*/
109-
export getSearchService: (searchSpec: { username: string; password: string }) => string;
110-
```
111-
112-
In the former, there will be a link to the `SearchSpec` interface with documentation for the `username` and `password` properties. In the latter the object will render inline, without comments:
113-
114-
![prefer interfaces documentation](../assets/dev_docs_nested_object.png)
115-
116-
#### Export every type used in a public API
117-
118-
When a publicly exported API items references a private type, this results in a broken link in our docs system. The private type is, by proxy, part of your public API, and as such, should be exported.
119-
120-
Do:
121-
122-
```ts
123-
export interface AnInterface { bar: string };
124-
export type foo: string | AnInterface;
125-
```
126-
127-
Don't:
128-
129-
```ts
130-
interface AnInterface { bar: string };
131-
export type foo: string | AnInterface;
132-
```
133-
134-
#### Avoid “Pick”
135-
136-
`Pick` not only ends up being unhelpful in our documentation system, but it's also of limited help in your IDE. For that reason, avoid `Pick` and other similarly complex types on your public API items. Using these semantics internally is fine.
137-
138-
![pick api documentation](../assets/api_doc_pick.png)
139-
140-
### Example plugins
141-
142-
Running Kibana with `yarn start --run-examples` will include all [example plugins](https://github.com/elastic/kibana/tree/main/examples). These are tested examples of platform services in use. We strongly encourage anyone providing a platform level service or <DocLink id="kibBuildingBlocks" text="building block"/> to include a tutorial that links to a tested example plugin. This is better than relying on copied code snippets, which can quickly get out of date.
143-
144-
You can also visit these [examples plugins hosted online](https://demo.kibana.dev/8.0/app/home). Note that because anonymous access is enabled, some
145-
of the demos are currently not working.
17+
Documentation best practices can be found <DocLink id="kibDocumentation" text="here"/>.
14618

14719
## Performance
14820

0 commit comments

Comments
 (0)