Skip to content

Commit

Permalink
Merge branch 'fix/formula-multiple-fields' of github.com:dej611/kiban…
Browse files Browse the repository at this point in the history
…a into fix/formula-multiple-fields
  • Loading branch information
dej611 committed Jul 7, 2021
2 parents 2bc89e8 + 8c042c1 commit aa4b7f6
Show file tree
Hide file tree
Showing 206 changed files with 4,822 additions and 1,311 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
/src/plugins/security_oss/ @elastic/kibana-security
/src/plugins/spaces_oss/ @elastic/kibana-security
/src/plugins/user_setup/ @elastic/kibana-security
/test/security_functional/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
Expand Down
Binary file added dev_docs/assets/pr_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev_docs/assets/pr_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev_docs/assets/pr_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions dev_docs/tutorials/submit_a_pull_request.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
id: kibDevTutorialSubmitPullRequest
slug: /kibana-dev-docs/tutorial/submit-pull-request
title: Submitting a Kibana pull request
summary: Learn how to submit a Kibana pull request
date: 2021-06-24
tags: ['kibana', 'onboarding', 'dev', 'tutorials', 'github', 'pr', 'pull request', 'ci']
---

## Create and clone a fork of Kibana

Kibana has hundreds of developers, some of whom are outside of Elastic, so we use a fork-based approach for creating branches and pull requests.

To create and clone a fork:

1. Login to [GitHub](https://github.com)
2. Navigate to the [Kibana repository](https://github.com/elastic/kibana)
3. Follow the [GitHub instructions](https://docs.github.com/en/get-started/quickstart/fork-a-repo) for forking and cloning repos

## Create a branch

After cloning your fork and navigating to the directory containing your fork:

```bash
# Make sure you currently have the branch checked out off of which you'd like to work
git checkout master

# Create a new branch
git checkout -b fix-typos-in-readme

# Edit some code
vi README.md

# Add/commit the change
git add README.md
git commit -m "Fixed all of the typos in the README"

# Push the branch to your fork
git push -u origin fix-typos-in-readme
```

If this is a new branch, you will see a link in your terminal that points you directly to a page to create a pull request for that branch.

## Create a pull request

1. Navigate to your fork in Github
2. If you see your branch at the top of the screen with a `Compare & pull request` button, click that. Otherwise:
1. Navigate to your branch
2. Click Contribute, followed by `Open pull request`
3. Fill out the details that are relevant for your change in the pull request template
1. If your pull request relates to an open issue, you can also reference that issue here, e.g. `Closes #12345`
4. [Elastic employees only] Add any teams/people that need to review your code under Reviewers. There's a good chance one or more teams will automatically be added based on which part of the codebase in which your changes were made.
5. [Elastic employees only] Add any relevant labels
1. Versions: Add a label for each version of Kibana in which your change will ship. For example, `v8.0.0`, `v7.14.0`
2. Features: Add labels for any relevant feature areas, e.g. `Feature:Development`
3. Team: Most PRs should have at least one `Team:` label. Add labels for teams that should follow or are responsible for the pull request.
4. Release Note: Add `release_note:skip` if this pull request should not automatically get added to release notes for Kibana
5. Auto Backport: Add `auto-backport` if you'd like your pull request automatically backported to all labeled versions.
6. Submit the pull request. If it's not quite ready for review, it can also be submitted as a Draft pull request.

![Screenshot of Compare and pull request header](../assets/pr_header.png)

![Screenshot of opening a pull request from the branch page](../assets/pr_open.png)

![Screenshot of pull request details](../assets/pr_details.png)

## Sign the Contributor Agreement

If this is your first pull request, a bot will post a comment asking you to sign our [CLA / Contributor Agreement](https://www.elastic.co/contributor-agreement). Your pull request won't be able to be merged until you've reviewed and signed the agreement.

## Review Process

At this point, your pull request will be reviewed, discussed, etc. Changes will likely be requested. For complex pull requests, this process could take several weeks. Please be patient and understand we hold our code base to a high standard.

See [Pull request review guidelines](https://www.elastic.co/guide/en/kibana/master/pr-review.html) for our general philosophy for pull request reviews.

## Updating your PR with upstream

If your pull request hasn't been updated with the latest code from the upstream/target branch, e.g. `master`, in the last 48 hours, it won't be able to merge until it is updated. This is to help prevent problems that could occur by merging stale code into upstream, e.g. something new was recently merged that is incompatible with something in your pull request.

As an alternative to using `git` to manually update your branch, you can leave a comment on your pull request with the text `@elasticmachine merge upstream`. This will automatically update your branch and kick off CI for it.

## Re-triggering CI

The easiest way to re-trigger CI is to simply update your branch (see above) with the latest code from upstream. This has the added benefit of ensuring that your branch is up-to-date and compatible.
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ In general this plugin provides:
|The Usage Collection Service defines a set of APIs for other plugins to report the usage of their features. At the same time, it provides necessary the APIs for other services (i.e.: telemetry, monitoring, ...) to consume that usage data.
|{kib-repo}blob/{branch}/src/plugins/user_setup/README.md[userSetup]
|The plugin provides UI and APIs for the interactive setup mode.
|{kib-repo}blob/{branch}/src/plugins/vis_default_editor/README.md[visDefaultEditor]
|The default editor is used in most primary visualizations, e.x. Area, Data table, Pie, etc.
It acts as a container for a particular visualization and options tabs. Contains the default "Data" tab in public/components/sidebar/data_tab.tsx.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/ml/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ browser so that it does not block pop-up windows or create an exception for your

For more information about the {anomaly-detect} feature, see
https://www.elastic.co/what-is/elastic-stack-machine-learning[{ml-cap} in the {stack}]
and {ml-docs}/xpack-ml.html[{ml-cap} {anomaly-detect}].
and {ml-docs}/ml-ad-overview.html[{ml-cap} {anomaly-detect}].

[[xpack-ml-dfanalytics]]
== {dfanalytics-cap}
Expand Down
4 changes: 4 additions & 0 deletions docs/user/security/authentication/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ image::user/security/images/kibana-login.png["Login Selector UI"]

For more information, refer to <<authentication-security-settings, authentication security settings>>.

TIP: If you have multiple authentication providers configured, you can use the `auth_provider_hint` URL query parameter to create a deep
link to any provider and bypass the Login Selector UI. Using the `kibana.yml` above as an example, you can add `?auth_provider_hint=basic1`
to the login page URL, which will take you directly to the basic login page.

[[basic-authentication]]
==== Basic authentication

Expand Down
21 changes: 20 additions & 1 deletion examples/locator_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { EuiFieldText } from '@elastic/eui';
import { EuiPageHeader } from '@elastic/eui';
import { EuiLink } from '@elastic/eui';
import { AppMountParameters } from '../../../src/core/public';
import { SharePluginSetup } from '../../../src/plugins/share/public';
import { formatSearchParams, SharePluginSetup } from '../../../src/plugins/share/public';
import {
HelloLocatorV1Params,
HelloLocatorV2Params,
Expand All @@ -34,6 +34,7 @@ interface MigratedLink {
linkText: string;
link: string;
version: string;
params: HelloLocatorV1Params | HelloLocatorV2Params;
}

const ActionsExplorer = ({ share }: Props) => {
Expand Down Expand Up @@ -93,6 +94,7 @@ const ActionsExplorer = ({ share }: Props) => {
linkText: savedLink.linkText,
link,
version: savedLink.version,
params: savedLink.params,
} as MigratedLink;
})
);
Expand Down Expand Up @@ -157,7 +159,24 @@ const ActionsExplorer = ({ share }: Props) => {
target="_blank"
>
{link.linkText}
</EuiLink>{' '}
(
<EuiLink
color={link.version !== '0.0.2' ? 'danger' : 'primary'}
data-test-subj="linkToHelloPage"
href={
'/app/r?' +
formatSearchParams({
id: 'HELLO_LOCATOR',
version: link.version,
params: link.params,
}).toString()
}
target="_blank"
>
through redirect app
</EuiLink>
)
<br />
</React.Fragment>
))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"**/minimist": "^1.2.5",
"**/node-jose/node-forge": "^0.10.0",
"**/pdfkit/crypto-js": "4.0.0",
"**/prismjs": "1.23.0",
"**/prismjs": "1.24.0",
"**/react-syntax-highlighter": "^15.3.1",
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
"**/refractor": "^3.3.1",
Expand Down Expand Up @@ -310,7 +310,7 @@
"nock": "12.0.3",
"node-fetch": "^2.6.1",
"node-forge": "^0.10.0",
"nodemailer": "^6.4.16",
"nodemailer": "^6.6.2",
"normalize-path": "^3.0.0",
"object-hash": "^1.3.1",
"object-path-immutable": "^3.1.1",
Expand Down
85 changes: 63 additions & 22 deletions packages/kbn-apm-config-loader/src/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import {

import { ApmConfiguration } from './config';

const initialEnv = { ...process.env };

describe('ApmConfiguration', () => {
beforeEach(() => {
// start with an empty env to avoid CI from spoiling snapshots, env is unique for each jest file
process.env = {};

packageMock.raw = {
version: '8.0.0',
build: {
Expand All @@ -30,7 +31,6 @@ describe('ApmConfiguration', () => {
});

afterEach(() => {
process.env = { ...initialEnv };
resetAllMocks();
});

Expand All @@ -46,7 +46,7 @@ describe('ApmConfiguration', () => {
it('sets the git revision from `git rev-parse` command in non distribution mode', () => {
gitRevExecMock.mockReturnValue('some-git-rev');
const config = new ApmConfiguration(mockedRootDir, {}, false);
expect(config.getConfig('serviceName').globalLabels.git_rev).toBe('some-git-rev');
expect(config.getConfig('serviceName').globalLabels?.git_rev).toBe('some-git-rev');
});

it('sets the git revision from `pkg.build.sha` in distribution mode', () => {
Expand All @@ -58,13 +58,13 @@ describe('ApmConfiguration', () => {
},
};
const config = new ApmConfiguration(mockedRootDir, {}, true);
expect(config.getConfig('serviceName').globalLabels.git_rev).toBe('distribution-sha');
expect(config.getConfig('serviceName').globalLabels?.git_rev).toBe('distribution-sha');
});

it('reads the kibana uuid from the uuid file', () => {
readUuidFileMock.mockReturnValue('instance-uuid');
const config = new ApmConfiguration(mockedRootDir, {}, false);
expect(config.getConfig('serviceName').globalLabels.kibana_uuid).toBe('instance-uuid');
expect(config.getConfig('serviceName').globalLabels?.kibana_uuid).toBe('instance-uuid');
});

it('uses the uuid from the kibana config if present', () => {
Expand All @@ -75,23 +75,51 @@ describe('ApmConfiguration', () => {
},
};
const config = new ApmConfiguration(mockedRootDir, kibanaConfig, false);
expect(config.getConfig('serviceName').globalLabels.kibana_uuid).toBe('uuid-from-config');
expect(config.getConfig('serviceName').globalLabels?.kibana_uuid).toBe('uuid-from-config');
});

it('uses the correct default config depending on the `isDistributable` parameter', () => {
it('overrides metricsInterval, breakdownMetrics, captureHeaders, and captureBody when `isDistributable` is true', () => {
let config = new ApmConfiguration(mockedRootDir, {}, false);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
breakdownMetrics: true,
})
);
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
Object {
"active": false,
"breakdownMetrics": true,
"captureSpanStackTraces": false,
"centralConfig": false,
"environment": "development",
"globalLabels": Object {},
"logUncaughtExceptions": true,
"metricsInterval": "30s",
"secretToken": "ZQHYvrmXEx04ozge8F",
"serverUrl": "https://38b80fbd79fb4c91bae06b4642d4d093.apm.us-east-1.aws.cloud.es.io",
"serviceName": "serviceName",
"serviceVersion": "8.0.0",
"transactionSampleRate": 1,
}
`);

config = new ApmConfiguration(mockedRootDir, {}, true);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
breakdownMetrics: false,
})
);
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
Object {
"active": false,
"breakdownMetrics": false,
"captureBody": "off",
"captureHeaders": false,
"captureSpanStackTraces": false,
"centralConfig": false,
"environment": "development",
"globalLabels": Object {
"git_rev": "sha",
},
"logUncaughtExceptions": true,
"metricsInterval": "120s",
"secretToken": "ZQHYvrmXEx04ozge8F",
"serverUrl": "https://38b80fbd79fb4c91bae06b4642d4d093.apm.us-east-1.aws.cloud.es.io",
"serviceName": "serviceName",
"serviceVersion": "8.0.0",
"transactionSampleRate": 1,
}
`);
});

it('loads the configuration from the kibana config file', () => {
Expand Down Expand Up @@ -119,7 +147,7 @@ describe('ApmConfiguration', () => {
active: true,
serverUrl: 'https://dev-url.co',
};
const config = new ApmConfiguration(mockedRootDir, {}, true);
const config = new ApmConfiguration(mockedRootDir, {}, false);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
active: true,
Expand All @@ -128,7 +156,20 @@ describe('ApmConfiguration', () => {
);
});

it('respect the precedence of the dev config', () => {
it('does not load the configuration from the dev config in distributable', () => {
devConfigMock.raw = {
active: true,
serverUrl: 'https://dev-url.co',
};
const config = new ApmConfiguration(mockedRootDir, {}, true);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
active: false,
})
);
});

it('overwrites the standard config file with the dev config', () => {
const kibanaConfig = {
elastic: {
apm: {
Expand All @@ -142,7 +183,7 @@ describe('ApmConfiguration', () => {
active: true,
serverUrl: 'https://dev-url.co',
};
const config = new ApmConfiguration(mockedRootDir, kibanaConfig, true);
const config = new ApmConfiguration(mockedRootDir, kibanaConfig, false);
expect(config.getConfig('serviceName')).toEqual(
expect.objectContaining({
active: true,
Expand All @@ -152,7 +193,7 @@ describe('ApmConfiguration', () => {
);
});

it('correctly sets environment', () => {
it('correctly sets environment by reading env vars', () => {
delete process.env.ELASTIC_APM_ENVIRONMENT;
delete process.env.NODE_ENV;

Expand Down
Loading

0 comments on commit aa4b7f6

Please sign in to comment.