Skip to content

Commit

Permalink
Merge branch 'master' into alerting/consumer-based-rbac
Browse files Browse the repository at this point in the history
* 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
gmmorris committed Jun 24, 2020
2 parents 3ccb14f + d1a6fa2 commit a3082b0
Show file tree
Hide file tree
Showing 559 changed files with 8,565 additions and 5,428 deletions.
1 change: 1 addition & 0 deletions .ci/pipeline-library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
implementation 'org.jenkins-ci.plugins.workflow:workflow-step-api:2.19@jar'
testImplementation 'com.lesfurets:jenkins-pipeline-unit:1.4'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.+'
testImplementation 'org.assertj:assertj-core:3.15+' // Temporary https://github.com/jenkinsci/JenkinsPipelineUnit/issues/209
}

Expand Down
7 changes: 5 additions & 2 deletions .ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class KibanaBasePipelineTest extends BasePipelineTest {
env.BUILD_DISPLAY_NAME = "#${env.BUILD_ID}"

env.JENKINS_URL = 'http://jenkins.localhost:8080'
env.BUILD_URL = "${env.JENKINS_URL}/job/elastic+kibana+${env.BRANCH_NAME}/${env.BUILD_ID}/"
env.BUILD_URL = "${env.JENKINS_URL}/job/elastic+kibana+${env.BRANCH_NAME}/${env.BUILD_ID}/".toString()

env.JOB_BASE_NAME = "elastic / kibana # ${env.BRANCH_NAME}"
env.JOB_BASE_NAME = "elastic / kibana # ${env.BRANCH_NAME}".toString()
env.JOB_NAME = env.JOB_BASE_NAME

env.WORKSPACE = 'WS'
Expand All @@ -31,6 +31,9 @@ class KibanaBasePipelineTest extends BasePipelineTest {
getBuildStatus: { 'SUCCESS' },
printStacktrace: { ex -> print ex },
],
githubPr: [
isPr: { false },
],
jenkinsApi: [ getFailedSteps: { [] } ],
testUtils: [ getFailures: { [] } ],
])
Expand Down
48 changes: 48 additions & 0 deletions .ci/pipeline-library/src/test/buildState.groovy
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)
}
}
85 changes: 85 additions & 0 deletions .ci/pipeline-library/src/test/githubCommitStatus.groovy
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)
}
}
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true) {
kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) {
githubPr.withDefaultPrComments {
ciStats.trackBuild {
catchError {
Expand Down
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [AppenderConfigType](./kibana-plugin-core-server.appenderconfigtype.md)

## AppenderConfigType type


<b>Signature:</b>

```typescript
export declare type AppenderConfigType = TypeOf<typeof appendersSchema>;
```
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CoreSetup](./kibana-plugin-core-server.coresetup.md) &gt; [logging](./kibana-plugin-core-server.coresetup.logging.md)

## CoreSetup.logging property

[LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md)

<b>Signature:</b>

```typescript
logging: LoggingServiceSetup;
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
| [elasticsearch](./kibana-plugin-core-server.coresetup.elasticsearch.md) | <code>ElasticsearchServiceSetup</code> | [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) |
| [getStartServices](./kibana-plugin-core-server.coresetup.getstartservices.md) | <code>StartServicesAccessor&lt;TPluginsStart, TStart&gt;</code> | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) |
| [http](./kibana-plugin-core-server.coresetup.http.md) | <code>HttpServiceSetup &amp; {</code><br/><code> resources: HttpResources;</code><br/><code> }</code> | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) |
| [logging](./kibana-plugin-core-server.coresetup.logging.md) | <code>LoggingServiceSetup</code> | [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) |
| [metrics](./kibana-plugin-core-server.coresetup.metrics.md) | <code>MetricsServiceSetup</code> | [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) |
| [savedObjects](./kibana-plugin-core-server.coresetup.savedobjects.md) | <code>SavedObjectsServiceSetup</code> | [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) |
| [status](./kibana-plugin-core-server.coresetup.status.md) | <code>StatusServiceSetup</code> | [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) |
Expand Down
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md)

## LoggerConfigType type


<b>Signature:</b>

```typescript
export declare type LoggerConfigType = TypeOf<typeof loggerSchema>;
```
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) &gt; [appenders](./kibana-plugin-core-server.loggercontextconfiginput.appenders.md)

## LoggerContextConfigInput.appenders property

<b>Signature:</b>

```typescript
appenders?: Record<string, AppenderConfigType> | Map<string, AppenderConfigType>;
```
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) &gt; [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md)

## LoggerContextConfigInput.loggers property

<b>Signature:</b>

```typescript
loggers?: LoggerConfigType[];
```
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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [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&lt;string, AppenderConfigType&gt; &#124; Map&lt;string, AppenderConfigType&gt;</code> | |
| [loggers](./kibana-plugin-core-server.loggercontextconfiginput.loggers.md) | <code>LoggerConfigType[]</code> | |

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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) &gt; [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&lt;LoggerContextConfigInput&gt;</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'] }]
})
)

```

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) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [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. |

4 changes: 4 additions & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [LegacyServiceSetupDeps](./kibana-plugin-core-server.legacyservicesetupdeps.md) | |
| [LegacyServiceStartDeps](./kibana-plugin-core-server.legacyservicestartdeps.md) | |
| [Logger](./kibana-plugin-core-server.logger.md) | Logger exposes all the necessary methods to log any type of information and this is the interface used by the logging consumers including plugins. |
| [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) | |
| [LoggerFactory](./kibana-plugin-core-server.loggerfactory.md) | The single purpose of <code>LoggerFactory</code> interface is to define a way to retrieve a context-based logger instance. |
| [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | Provides APIs to plugins for customizing the plugin's logger. |
| [LogMeta](./kibana-plugin-core-server.logmeta.md) | Contextual metadata |
| [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) | APIs to retrieves metrics gathered and exposed by the core platform. |
| [NodesVersionCompatibility](./kibana-plugin-core-server.nodesversioncompatibility.md) | |
Expand Down Expand Up @@ -209,6 +211,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->

| Type Alias | Description |
| --- | --- |
| [AppenderConfigType](./kibana-plugin-core-server.appenderconfigtype.md) | |
| [AuthenticationHandler](./kibana-plugin-core-server.authenticationhandler.md) | See [AuthToolkit](./kibana-plugin-core-server.authtoolkit.md)<!-- -->. |
| [AuthHeaders](./kibana-plugin-core-server.authheaders.md) | Auth Headers map |
| [AuthResult](./kibana-plugin-core-server.authresult.md) | |
Expand Down Expand Up @@ -242,6 +245,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) | Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. |
| [KnownHeaders](./kibana-plugin-core-server.knownheaders.md) | Set of well-known HTTP headers. |
| [LifecycleResponseFactory](./kibana-plugin-core-server.lifecycleresponsefactory.md) | Creates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client. |
| [LoggerConfigType](./kibana-plugin-core-server.loggerconfigtype.md) | |
| [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-core-server.migration_assistance_index_action.md) | |
| [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-core-server.migration_deprecation_level.md) | |
| [MutatingOperationRefreshSetting](./kibana-plugin-core-server.mutatingoperationrefreshsetting.md) | Elasticsearch Refresh setting for mutating operation |
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-storybook/lib/webpack.dll.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ module.exports = {
'rxjs',
'sinon',
'tinycolor2',
'./src/legacy/ui/public/styles/font_awesome.less',
'./src/legacy/ui/public/styles/bootstrap/bootstrap_light.less',
],
plugins: [
Expand Down
Loading

0 comments on commit a3082b0

Please sign in to comment.