-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into implement/share-styled-components
- Loading branch information
Showing
1,877 changed files
with
52,889 additions
and
24,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import org.junit.* | ||
import static groovy.test.GroovyAssert.* | ||
|
||
class BuildStateTest extends KibanaBasePipelineTest { | ||
def buildState | ||
|
||
@Before | ||
void setUp() { | ||
super.setUp() | ||
|
||
buildState = loadScript("vars/buildState.groovy") | ||
} | ||
|
||
@Test | ||
void 'get() returns existing data'() { | ||
buildState.add('test', 1) | ||
def actual = buildState.get('test') | ||
assertEquals(1, actual) | ||
} | ||
|
||
@Test | ||
void 'get() returns null for missing data'() { | ||
def actual = buildState.get('missing_key') | ||
assertEquals(null, actual) | ||
} | ||
|
||
@Test | ||
void 'add() does not overwrite existing keys'() { | ||
assertTrue(buildState.add('test', 1)) | ||
assertFalse(buildState.add('test', 2)) | ||
|
||
def actual = buildState.get('test') | ||
|
||
assertEquals(1, actual) | ||
} | ||
|
||
@Test | ||
void 'set() overwrites existing keys'() { | ||
assertFalse(buildState.has('test')) | ||
buildState.set('test', 1) | ||
assertTrue(buildState.has('test')) | ||
buildState.set('test', 2) | ||
|
||
def actual = buildState.get('test') | ||
|
||
assertEquals(2, actual) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import org.junit.* | ||
import static org.mockito.Mockito.*; | ||
|
||
class GithubCommitStatusTest extends KibanaBasePipelineTest { | ||
def githubCommitStatus | ||
def githubApiMock | ||
def buildStateMock | ||
|
||
def EXPECTED_STATUS_URL = 'repos/elastic/kibana/statuses/COMMIT_HASH' | ||
def EXPECTED_CONTEXT = 'kibana-ci' | ||
def EXPECTED_BUILD_URL = 'http://jenkins.localhost:8080/job/elastic+kibana+master/1/' | ||
|
||
interface BuildState { | ||
Object get(String key) | ||
} | ||
|
||
interface GithubApi { | ||
Object post(String url, Map data) | ||
} | ||
|
||
@Before | ||
void setUp() { | ||
super.setUp() | ||
|
||
buildStateMock = mock(BuildState) | ||
githubApiMock = mock(GithubApi) | ||
|
||
when(buildStateMock.get('checkoutInfo')).thenReturn([ commit: 'COMMIT_HASH', ]) | ||
when(githubApiMock.post(any(), any())).thenReturn(null) | ||
|
||
props([ | ||
buildState: buildStateMock, | ||
githubApi: githubApiMock, | ||
]) | ||
|
||
githubCommitStatus = loadScript("vars/githubCommitStatus.groovy") | ||
} | ||
|
||
void verifyStatusCreate(String state, String description) { | ||
verify(githubApiMock).post( | ||
EXPECTED_STATUS_URL, | ||
[ | ||
'state': state, | ||
'description': description, | ||
'context': EXPECTED_CONTEXT, | ||
'target_url': EXPECTED_BUILD_URL, | ||
] | ||
) | ||
} | ||
|
||
@Test | ||
void 'onStart() should create a pending status'() { | ||
githubCommitStatus.onStart() | ||
verifyStatusCreate('pending', 'Build started.') | ||
} | ||
|
||
@Test | ||
void 'onFinish() should create a success status'() { | ||
githubCommitStatus.onFinish() | ||
verifyStatusCreate('success', 'Build completed successfully.') | ||
} | ||
|
||
@Test | ||
void 'onFinish() should create an error status for failed builds'() { | ||
mockFailureBuild() | ||
githubCommitStatus.onFinish() | ||
verifyStatusCreate('error', 'Build failed.') | ||
} | ||
|
||
@Test | ||
void 'onStart() should exit early for PRs'() { | ||
prop('githubPr', [ isPr: { true } ]) | ||
|
||
githubCommitStatus.onStart() | ||
verifyZeroInteractions(githubApiMock) | ||
} | ||
|
||
@Test | ||
void 'onFinish() should exit early for PRs'() { | ||
prop('githubPr', [ isPr: { true } ]) | ||
|
||
githubCommitStatus.onFinish() | ||
verifyZeroInteractions(githubApiMock) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"output": "src/plugins/telemetry/schema/legacy_oss_plugins.json", | ||
"root": "src/legacy/core_plugins/", | ||
"exclude": [ | ||
"src/legacy/core_plugins/testbed", | ||
"src/legacy/core_plugins/elasticsearch", | ||
"src/legacy/core_plugins/tests_bundle" | ||
] | ||
}, | ||
{ | ||
"output": "src/plugins/telemetry/schema/oss_plugins.json", | ||
"root": "src/plugins/", | ||
"exclude": [ | ||
"src/plugins/kibana_react/", | ||
"src/plugins/testbed/", | ||
"src/plugins/kibana_utils/", | ||
"src/plugins/kibana_usage_collection/server/collectors/kibana/kibana_usage_collector.ts", | ||
"src/plugins/kibana_usage_collection/server/collectors/application_usage/telemetry_application_usage_collector.ts", | ||
"src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts", | ||
"src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts", | ||
"src/plugins/telemetry/server/collectors/usage/telemetry_usage_collector.ts" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
docs/development/core/public/kibana-plugin-core-public.app.exactroute.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [exactRoute](./kibana-plugin-core-public.app.exactroute.md) | ||
|
||
## App.exactRoute property | ||
|
||
If set to true, the application's route will only be checked against an exact match. Defaults to `false`<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
exactRoute?: boolean; | ||
``` | ||
|
||
## Example | ||
|
||
|
||
```ts | ||
core.application.register({ | ||
id: 'my_app', | ||
title: 'My App' | ||
exactRoute: true, | ||
mount: () => { ... }, | ||
}) | ||
|
||
// '[basePath]/app/my_app' will be matched | ||
// '[basePath]/app/my_app/some/path' will not be matched | ||
|
||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...elopment/core/public/kibana-plugin-core-public.chromestart.getcustomnavlink_.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [getCustomNavLink$](./kibana-plugin-core-public.chromestart.getcustomnavlink_.md) | ||
|
||
## ChromeStart.getCustomNavLink$() method | ||
|
||
Get an observable of the current custom nav link | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getCustomNavLink$(): Observable<Partial<ChromeNavLink> | undefined>; | ||
``` | ||
<b>Returns:</b> | ||
|
||
`Observable<Partial<ChromeNavLink> | undefined>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...velopment/core/public/kibana-plugin-core-public.chromestart.setcustomnavlink.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [setCustomNavLink](./kibana-plugin-core-public.chromestart.setcustomnavlink.md) | ||
|
||
## ChromeStart.setCustomNavLink() method | ||
|
||
Override the current set of custom nav link | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
setCustomNavLink(newCustomNavLink?: Partial<ChromeNavLink>): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| newCustomNavLink | <code>Partial<ChromeNavLink></code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`void` | ||
|
13 changes: 0 additions & 13 deletions
13
docs/development/core/public/kibana-plugin-core-public.coresetup.doclinks.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...lopment/core/public/kibana-plugin-core-public.doclinkssetup.doc_link_version.md
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...ment/core/public/kibana-plugin-core-public.doclinkssetup.elastic_website_url.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.