Skip to content

Commit

Permalink
Merge branch 'main' into implement/prebuilt-mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 3, 2022
2 parents e5ba7b1 + e1195de commit 969313e
Show file tree
Hide file tree
Showing 351 changed files with 29,746 additions and 1,551 deletions.
72 changes: 63 additions & 9 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,44 @@ steps:
- command: .buildkite/scripts/steps/functional/oss_accessibility.sh
label: 'OSS Accessibility Tests'
agents:
queue: ci-group-4d
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/xpack_accessibility.sh
label: 'Default Accessibility Tests'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/oss_firefox.sh
label: 'OSS Firefox Tests'
Expand All @@ -89,13 +109,23 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_firefox.sh
label: 'Default Firefox Tests'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/functional/oss_misc.sh
label: 'OSS Misc Functional Tests'
Expand All @@ -111,13 +141,23 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_saved_object_field_metrics.sh
label: 'Saved Object Field Metrics'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
Expand All @@ -138,9 +178,23 @@ steps:
- command: .buildkite/scripts/steps/test/api_integration.sh
label: 'API Integration Tests'
agents:
queue: n2-2
queue: n2-4-spot
timeout_in_minutes: 120
key: api-integration
retry:
automatic:
- exit_status: '1'
limit: 1
- exit_status: '-1'
limit: 3
- exit_status: '130'
limit: 3
- exit_status: '137'
limit: 3
- exit_status: '143'
limit: 3
- exit_status: '255'
limit: 3

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/backport-next.yml

This file was deleted.

24 changes: 5 additions & 19 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,19 @@ on:
jobs:
backport:
name: Backport PR
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'auto-backport')
&& (
(github.event.action == 'labeled' && github.event.label.name == 'auto-backport')
|| (github.event.action == 'closed')
)
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v2
with:
repository: 'elastic/kibana-github-actions'
ref: main
path: ./actions

- name: Install Actions
run: npm install --production --prefix ./actions

- name: Fix Version Label Gaps
uses: ./actions/fix-version-gaps
- name: Backport Action
uses: sqren/[email protected]
with:
github_token: ${{secrets.KIBANAMACHINE_TOKEN}}

- name: Run Backport
uses: ./actions/backport
with:
github_token: ${{secrets.KIBANAMACHINE_TOKEN}}
commit_user: kibanamachine
commit_email: [email protected]
- name: Backport log
run: cat ~/.backport/backport.log
132 changes: 2 additions & 130 deletions dev_docs/contributing/best_practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,137 +12,9 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture']
First things first, be sure to review our <DocLink id="kibDevPrinciples" text="development principles"/> and check out all the available
platform <DocLink id="kibBuildingBlocks" text="building blocks"/> that can simplify plugin development.

## Developer documentation
## Documentation

### High-level documentation

#### Structure

Refer to [divio documentation](https://documentation.divio.com/) for guidance on where and how to structure our high-level documentation.

<DocLink id="kibDevDocsWelcome" text="Getting started" /> and
<DocLink id="kibPlatformIntro" text="Key concepts" /> sections are both _explanation_ oriented,
<DocLink id="kibDevTutorialDebugging" text="Tutorials" /> covers both _tutorials_ and _How to_, and the <DocLink
id="kibDevDocsApiWelcome"
text="API documentation"
/> section covers _reference_ material.

#### Location

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.

<DocCallOut title="internal only">

To add docs into the new docs system, create an `.mdx` file that
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
up locally and edit the nav menu.

</DocCallOut>

#### Keep content fresh

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.

#### Consider your target audience

Documentation in the Kibana Developer Guide is targeted towards developers building Kibana plugins. Keep implementation details about internal plugin code out of these docs.

#### High to low level

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.

#### Think outside-in

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.

### API documentation

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.

#### Code comments

Every publicly exposed function, class, interface, type, parameter and property should have a comment using JSDoc style comments.

- Use `@param` tags for every function parameter.
- Use `@returns` tags for return types.
- Use `@throws` when appropriate.
- Use `@beta` or `@deprecated` when appropriate.
- 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.
- Use `@internal` to indicate this API item is intended for internal use only, which will also remove it from the docs.

#### Interfaces vs inlined types

Prefer types and interfaces over complex inline objects. For example, prefer:

```ts
/**
* The SearchSpec interface contains settings for creating a new SearchService, like
* username and password.
*/
export interface SearchSpec {
/**
* Stores the username. Duh,
*/
username: string;
/**
* Stores the password. I hope it's encrypted!
*/
password: string;
}

/**
* Retrieve search services
* @param searchSpec Configuration information for initializing the search service.
* @returns the id of the search service
*/
export getSearchService: (searchSpec: SearchSpec) => string;
```

over:

```ts
/**
* Retrieve search services
* @param searchSpec Configuration information for initializing the search service.
* @returns the id of the search service
*/
export getSearchService: (searchSpec: { username: string; password: string }) => string;
```

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:

![prefer interfaces documentation](../assets/dev_docs_nested_object.png)

#### Export every type used in a public API

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.

Do:

```ts
export interface AnInterface { bar: string };
export type foo: string | AnInterface;
```

Don't:

```ts
interface AnInterface { bar: string };
export type foo: string | AnInterface;
```

#### Avoid “Pick”

`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.

![pick api documentation](../assets/api_doc_pick.png)

### Example plugins

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.

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
of the demos are currently not working.
Documentation best practices can be found <DocLink id="kibDocumentation" text="here"/>.

## Performance

Expand Down
Loading

0 comments on commit 969313e

Please sign in to comment.