forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
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 alerting/consumer-based-rbac
* master: (25 commits) Properly redirect legacy URLs (elastic#68284) Redirect to Logged Out UI on SAML Logout Response. Prefer Login Selector UI to Logged Out UI whenever possible. (elastic#69676) Fixes elastic#69344: Don't allow empty string for server.basePath config (elastic#69377) Migrate legacy import/export endpoints (elastic#69474) [ML] Fixes anomaly chart and validation for one week bucket span (elastic#69671) Support deep links inside of `RelayState` for SAML IdP initiated login. (elastic#69401) [Obs] Update Observability landing page text (elastic#69727) [Metrics UI] Add inventory alert preview (elastic#68909) remove scroll in drag & drop context (elastic#69710) [SECURITY] Add endpoint alerts url (elastic#69707) [Index Management] Fix API Integration Test and use of `timestamp_field` (elastic#69666) [Maps] Remove extra layer of telemetry nesting under "attributes" (elastic#66137) Add plugin API for customizing the logging configuration (elastic#68704) adds kibana navigation tests (elastic#69733) fix link to analytics results from management (elastic#69550) [ML] Transform: Enable force delete if one of the transforms failed (elastic#69472) [ML] Transform: Table enhancements (elastic#69307) [Monitoring] Love for APM (elastic#69052) [chore] TS 3.9: convert ts-ignore to ts-expect-error (elastic#69541) Disabled multiple select for preconfigured connectors to avoid requesting bulk delete on them (elastic#69459) ...
- Loading branch information
Showing
559 changed files
with
8,565 additions
and
5,428 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
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
12 changes: 12 additions & 0 deletions
12
docs/development/core/server/kibana-plugin-core-server.appenderconfigtype.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,12 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [AppenderConfigType](./kibana-plugin-core-server.appenderconfigtype.md) | ||
|
||
## AppenderConfigType type | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type AppenderConfigType = TypeOf<typeof appendersSchema>; | ||
``` |
13 changes: 13 additions & 0 deletions
13
docs/development/core/server/kibana-plugin-core-server.coresetup.logging.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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreSetup](./kibana-plugin-core-server.coresetup.md) > [logging](./kibana-plugin-core-server.coresetup.logging.md) | ||
|
||
## CoreSetup.logging property | ||
|
||
[LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
logging: LoggingServiceSetup; | ||
``` |
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
12 changes: 12 additions & 0 deletions
12
docs/development/core/server/kibana-plugin-core-server.loggerconfigtype.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,12 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md) | ||
|
||
## LoggerConfigType type | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare type LoggerConfigType = TypeOf<typeof loggerSchema>; | ||
``` |
11 changes: 11 additions & 0 deletions
11
...ent/core/server/kibana-plugin-core-server.loggercontextconfiginput.appenders.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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) > [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md) | ||
|
||
## LoggerContextConfigInput.appenders property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
appenders?: Record<string, AppenderConfigType> | Map<string, AppenderConfigType>; | ||
``` |
11 changes: 11 additions & 0 deletions
11
...pment/core/server/kibana-plugin-core-server.loggercontextconfiginput.loggers.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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) > [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | ||
|
||
## LoggerContextConfigInput.loggers property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
loggers?: LoggerConfigType[]; | ||
``` |
20 changes: 20 additions & 0 deletions
20
docs/development/core/server/kibana-plugin-core-server.loggercontextconfiginput.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,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) | ||
|
||
## LoggerContextConfigInput interface | ||
|
||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface LoggerContextConfigInput | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md) | <code>Record<string, AppenderConfigType> | Map<string, AppenderConfigType></code> | | | ||
| [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | <code>LoggerConfigType[]</code> | | | ||
|
42 changes: 42 additions & 0 deletions
42
...elopment/core/server/kibana-plugin-core-server.loggingservicesetup.configure.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,42 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) > [configure](./kibana-plugin-core-server.loggingservicesetup.configure.md) | ||
|
||
## LoggingServiceSetup.configure() method | ||
|
||
Customizes the logging config for the plugin's context. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
configure(config$: Observable<LoggerContextConfigInput>): void; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| config$ | <code>Observable<LoggerContextConfigInput></code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`void` | ||
|
||
## Remarks | ||
|
||
Assumes that that the `context` property of the individual `logger` items emitted by `config$` are relative to the plugin's logging context (defaults to `plugins.<plugin_id>`<!-- -->). | ||
|
||
## Example | ||
|
||
Customize the configuration for the plugins.data.search context. | ||
|
||
```ts | ||
core.logging.configure( | ||
of({ | ||
appenders: new Map(), | ||
loggers: [{ context: 'search', appenders: ['default'] }] | ||
}) | ||
) | ||
|
||
``` | ||
|
20 changes: 20 additions & 0 deletions
20
docs/development/core/server/kibana-plugin-core-server.loggingservicesetup.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,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | ||
|
||
## LoggingServiceSetup interface | ||
|
||
Provides APIs to plugins for customizing the plugin's logger. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface LoggingServiceSetup | ||
``` | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [configure(config$)](./kibana-plugin-core-server.loggingservicesetup.configure.md) | Customizes the logging config for the plugin's context. | | ||
|
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
Oops, something went wrong.