Skip to content

Commit 95389e5

Browse files
Merge branch 'master' into persistable_stae
2 parents 984c57e + 44d4d23 commit 95389e5

File tree

181 files changed

+3765
-1268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+3765
-1268
lines changed

dev_docs/assets/pr_details.png

155 KB
Loading

dev_docs/assets/pr_header.png

128 KB
Loading

dev_docs/assets/pr_open.png

54 KB
Loading
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
id: kibDevTutorialSubmitPullRequest
3+
slug: /kibana-dev-docs/tutorial/submit-pull-request
4+
title: Submitting a Kibana pull request
5+
summary: Learn how to submit a Kibana pull request
6+
date: 2021-06-24
7+
tags: ['kibana', 'onboarding', 'dev', 'tutorials', 'github', 'pr', 'pull request', 'ci']
8+
---
9+
10+
## Create and clone a fork of Kibana
11+
12+
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.
13+
14+
To create and clone a fork:
15+
16+
1. Login to [GitHub](https://github.com)
17+
2. Navigate to the [Kibana repository](https://github.com/elastic/kibana)
18+
3. Follow the [GitHub instructions](https://docs.github.com/en/get-started/quickstart/fork-a-repo) for forking and cloning repos
19+
20+
## Create a branch
21+
22+
After cloning your fork and navigating to the directory containing your fork:
23+
24+
```bash
25+
# Make sure you currently have the branch checked out off of which you'd like to work
26+
git checkout master
27+
28+
# Create a new branch
29+
git checkout -b fix-typos-in-readme
30+
31+
# Edit some code
32+
vi README.md
33+
34+
# Add/commit the change
35+
git add README.md
36+
git commit -m "Fixed all of the typos in the README"
37+
38+
# Push the branch to your fork
39+
git push -u origin fix-typos-in-readme
40+
```
41+
42+
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.
43+
44+
## Create a pull request
45+
46+
1. Navigate to your fork in Github
47+
2. If you see your branch at the top of the screen with a `Compare & pull request` button, click that. Otherwise:
48+
1. Navigate to your branch
49+
2. Click Contribute, followed by `Open pull request`
50+
3. Fill out the details that are relevant for your change in the pull request template
51+
1. If your pull request relates to an open issue, you can also reference that issue here, e.g. `Closes #12345`
52+
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.
53+
5. [Elastic employees only] Add any relevant labels
54+
1. Versions: Add a label for each version of Kibana in which your change will ship. For example, `v8.0.0`, `v7.14.0`
55+
2. Features: Add labels for any relevant feature areas, e.g. `Feature:Development`
56+
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.
57+
4. Release Note: Add `release_note:skip` if this pull request should not automatically get added to release notes for Kibana
58+
5. Auto Backport: Add `auto-backport` if you'd like your pull request automatically backported to all labeled versions.
59+
6. Submit the pull request. If it's not quite ready for review, it can also be submitted as a Draft pull request.
60+
61+
![Screenshot of Compare and pull request header](../assets/pr_header.png)
62+
63+
![Screenshot of opening a pull request from the branch page](../assets/pr_open.png)
64+
65+
![Screenshot of pull request details](../assets/pr_details.png)
66+
67+
## Sign the Contributor Agreement
68+
69+
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.
70+
71+
## Review Process
72+
73+
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.
74+
75+
See [Pull request review guidelines](https://www.elastic.co/guide/en/kibana/master/pr-review.html) for our general philosophy for pull request reviews.
76+
77+
## Updating your PR with upstream
78+
79+
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.
80+
81+
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.
82+
83+
## Re-triggering CI
84+
85+
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.

docs/user/ml/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ browser so that it does not block pop-up windows or create an exception for your
8080

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

8585
[[xpack-ml-dfanalytics]]
8686
== {dfanalytics-cap}

docs/user/production-considerations/production.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ These can be used to automatically update the list of hosts as a cluster is resi
136136
[float]
137137
[[memory]]
138138
=== Memory
139-
Kibana has a default maximum memory limit of 1.4 GB, and in most cases, we recommend leaving this unconfigured. In some scenarios, such as large reporting jobs,
139+
Kibana has a default memory limit that scales based on total memory available. In some scenarios, such as large reporting jobs,
140140
it may make sense to tweak limits to meet more specific requirements.
141141

142-
You can modify this limit by setting `--max-old-space-size` in the `node.options` config file that can be found inside `kibana/config` folder or any other configured with the environment variable `KBN_PATH_CONF` (for example in debian based system would be `/etc/kibana`).
142+
A limit can be defined by setting `--max-old-space-size` in the `node.options` config file found inside the `kibana/config` folder or any other folder configured with the environment variable `KBN_PATH_CONF`. For example, in the Debian-based system, the folder is `/etc/kibana`.
143143

144144
The option accepts a limit in MB:
145145
[source,js]

docs/user/security/authentication/index.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ image::user/security/images/kibana-login.png["Login Selector UI"]
6565

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

68+
TIP: If you have multiple authentication providers configured, you can use the `auth_provider_hint` URL query parameter to create a deep
69+
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`
70+
to the login page URL, which will take you directly to the basic login page.
71+
6872
[[basic-authentication]]
6973
==== Basic authentication
7074

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"**/minimist": "^1.2.5",
8484
"**/node-jose/node-forge": "^0.10.0",
8585
"**/pdfkit/crypto-js": "4.0.0",
86-
"**/prismjs": "1.23.0",
86+
"**/prismjs": "1.24.0",
8787
"**/react-syntax-highlighter": "^15.3.1",
8888
"**/react-syntax-highlighter/**/highlight.js": "^10.4.1",
8989
"**/refractor": "^3.3.1",
@@ -99,7 +99,7 @@
9999
"dependencies": {
100100
"@elastic/apm-rum": "^5.8.0",
101101
"@elastic/apm-rum-react": "^1.2.11",
102-
"@elastic/charts": "31.0.0",
102+
"@elastic/charts": "31.1.0",
103103
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
104104
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.13",
105105
"@elastic/ems-client": "7.14.0",
@@ -310,7 +310,7 @@
310310
"nock": "12.0.3",
311311
"node-fetch": "^2.6.1",
312312
"node-forge": "^0.10.0",
313-
"nodemailer": "^6.4.16",
313+
"nodemailer": "^6.6.2",
314314
"normalize-path": "^3.0.0",
315315
"object-hash": "^1.3.1",
316316
"object-path-immutable": "^3.1.1",

packages/kbn-apm-config-loader/src/config.test.ts

Lines changed: 63 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import {
1717

1818
import { ApmConfiguration } from './config';
1919

20-
const initialEnv = { ...process.env };
21-
2220
describe('ApmConfiguration', () => {
2321
beforeEach(() => {
22+
// start with an empty env to avoid CI from spoiling snapshots, env is unique for each jest file
23+
process.env = {};
24+
2425
packageMock.raw = {
2526
version: '8.0.0',
2627
build: {
@@ -30,7 +31,6 @@ describe('ApmConfiguration', () => {
3031
});
3132

3233
afterEach(() => {
33-
process.env = { ...initialEnv };
3434
resetAllMocks();
3535
});
3636

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

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

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

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

81-
it('uses the correct default config depending on the `isDistributable` parameter', () => {
81+
it('overrides metricsInterval, breakdownMetrics, captureHeaders, and captureBody when `isDistributable` is true', () => {
8282
let config = new ApmConfiguration(mockedRootDir, {}, false);
83-
expect(config.getConfig('serviceName')).toEqual(
84-
expect.objectContaining({
85-
breakdownMetrics: true,
86-
})
87-
);
83+
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
84+
Object {
85+
"active": false,
86+
"breakdownMetrics": true,
87+
"captureSpanStackTraces": false,
88+
"centralConfig": false,
89+
"environment": "development",
90+
"globalLabels": Object {},
91+
"logUncaughtExceptions": true,
92+
"metricsInterval": "30s",
93+
"secretToken": "ZQHYvrmXEx04ozge8F",
94+
"serverUrl": "https://38b80fbd79fb4c91bae06b4642d4d093.apm.us-east-1.aws.cloud.es.io",
95+
"serviceName": "serviceName",
96+
"serviceVersion": "8.0.0",
97+
"transactionSampleRate": 1,
98+
}
99+
`);
88100

89101
config = new ApmConfiguration(mockedRootDir, {}, true);
90-
expect(config.getConfig('serviceName')).toEqual(
91-
expect.objectContaining({
92-
breakdownMetrics: false,
93-
})
94-
);
102+
expect(config.getConfig('serviceName')).toMatchInlineSnapshot(`
103+
Object {
104+
"active": false,
105+
"breakdownMetrics": false,
106+
"captureBody": "off",
107+
"captureHeaders": false,
108+
"captureSpanStackTraces": false,
109+
"centralConfig": false,
110+
"environment": "development",
111+
"globalLabels": Object {
112+
"git_rev": "sha",
113+
},
114+
"logUncaughtExceptions": true,
115+
"metricsInterval": "120s",
116+
"secretToken": "ZQHYvrmXEx04ozge8F",
117+
"serverUrl": "https://38b80fbd79fb4c91bae06b4642d4d093.apm.us-east-1.aws.cloud.es.io",
118+
"serviceName": "serviceName",
119+
"serviceVersion": "8.0.0",
120+
"transactionSampleRate": 1,
121+
}
122+
`);
95123
});
96124

97125
it('loads the configuration from the kibana config file', () => {
@@ -119,7 +147,7 @@ describe('ApmConfiguration', () => {
119147
active: true,
120148
serverUrl: 'https://dev-url.co',
121149
};
122-
const config = new ApmConfiguration(mockedRootDir, {}, true);
150+
const config = new ApmConfiguration(mockedRootDir, {}, false);
123151
expect(config.getConfig('serviceName')).toEqual(
124152
expect.objectContaining({
125153
active: true,
@@ -128,7 +156,20 @@ describe('ApmConfiguration', () => {
128156
);
129157
});
130158

131-
it('respect the precedence of the dev config', () => {
159+
it('does not load the configuration from the dev config in distributable', () => {
160+
devConfigMock.raw = {
161+
active: true,
162+
serverUrl: 'https://dev-url.co',
163+
};
164+
const config = new ApmConfiguration(mockedRootDir, {}, true);
165+
expect(config.getConfig('serviceName')).toEqual(
166+
expect.objectContaining({
167+
active: false,
168+
})
169+
);
170+
});
171+
172+
it('overwrites the standard config file with the dev config', () => {
132173
const kibanaConfig = {
133174
elastic: {
134175
apm: {
@@ -142,7 +183,7 @@ describe('ApmConfiguration', () => {
142183
active: true,
143184
serverUrl: 'https://dev-url.co',
144185
};
145-
const config = new ApmConfiguration(mockedRootDir, kibanaConfig, true);
186+
const config = new ApmConfiguration(mockedRootDir, kibanaConfig, false);
146187
expect(config.getConfig('serviceName')).toEqual(
147188
expect.objectContaining({
148189
active: true,
@@ -152,7 +193,7 @@ describe('ApmConfiguration', () => {
152193
);
153194
});
154195

155-
it('correctly sets environment', () => {
196+
it('correctly sets environment by reading env vars', () => {
156197
delete process.env.ELASTIC_APM_ENVIRONMENT;
157198
delete process.env.NODE_ENV;
158199

0 commit comments

Comments
 (0)