Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into alert…
Browse files Browse the repository at this point in the history
…ing/updated-at
  • Loading branch information
ymao1 committed Nov 17, 2020
2 parents dc1dc4b + a46bf54 commit 2b1b9ef
Show file tree
Hide file tree
Showing 100 changed files with 735 additions and 498 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/groovy

env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 'true'
library 'kibana-pipeline-library'
kibanaLibrary.load()

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/contributing/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
== Contributing

Whether you want to fix a bug, implement a feature, or add some other improvements or apis, the following sections will
guide you on the process.
guide you on the process. After committing your code, check out the link:https://www.elastic.co/community/contributor[Elastic Contributor Program] where you can earn points and rewards for your contributions.

Read <<development-getting-started>> to get your environment up and running, then read <<development-best-practices>>.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"@elastic/datemath": "link:packages/elastic-datemath",
"@elastic/elasticsearch": "7.10.0-rc.1",
"@elastic/ems-client": "7.10.0",
"@elastic/eui": "30.1.1",
"@elastic/eui": "30.2.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/node-crypto": "1.2.1",
Expand Down
1 change: 1 addition & 0 deletions src/cli/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

require('../apm')(process.env.ELASTIC_APM_SERVICE_NAME || 'kibana-proxy');
require('../setup_node_env');
require('../setup_node_env/root');
require('./cli');
1 change: 1 addition & 0 deletions src/cli/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

require('../apm')();
require('../setup_node_env/dist');
require('../setup_node_env/root');
require('./cli');
2 changes: 1 addition & 1 deletion src/cli_keystore/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
* under the License.
*/

require('../setup_node_env');
require('../setup_node_env/no_transpilation');
require('./cli_keystore');
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ kibana_vars=(
xpack.security.authc.oidc.realm
xpack.security.authc.saml.realm
xpack.security.authc.saml.maxRedirectURLSize
xpack.security.authc.selector.enabled
xpack.security.cookieName
xpack.security.enabled
xpack.security.encryptionKey
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/os_packages/docker_generator/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function runDockerGenerator(
ubi: boolean = false
) {
// UBI var config
const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:8.2' : 'centos:8';
const baseOSImage = ubi ? 'docker.elastic.co/ubi8/ubi-minimal:latest' : 'centos:8';
const ubiVersionTag = 'ubi8';
const ubiImageFlavor = ubi ? `-${ubiVersionTag}` : '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,9 @@ EXPOSE 5601
{{#ubi}}
# https://github.com/rpm-software-management/microdnf/issues/50
RUN mkdir -p /run/user/$(id -u)

# crypto-policies not currently compatible with libnss :sadpanda:
RUN printf "[main]\nexclude=crypto-policies" > /etc/dnf/dnf.conf
{{/ubi}}

RUN for iter in {1..10}; do \
{{#ubi}}
# update microdnf to have exclusion feature for dnf configuration
{{packageManager}} update microdnf --setopt=tsflags=nodocs -y && \
{{/ubi}}
{{packageManager}} update --setopt=tsflags=nodocs -y && \
{{packageManager}} install --setopt=tsflags=nodocs -y \
fontconfig freetype shadow-utils libnss3.so {{#ubi}}findutils{{/ubi}} && \
Expand Down
15 changes: 14 additions & 1 deletion src/dev/build/tasks/os_packages/package_scripts/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ case $1 in
IS_UPGRADE=true
fi

PACKAGE=deb
setup
;;
abort-deconfigure|abort-upgrade|abort-remove)
PACKAGE=deb
;;

# Red Hat
Expand All @@ -63,7 +65,8 @@ case $1 in
if [ "$1" = "2" ]; then
IS_UPGRADE=true
fi


PACKAGE=rpm
setup
;;

Expand All @@ -86,3 +89,13 @@ if [ "$IS_UPGRADE" = "true" ]; then
echo " OK"
fi
fi

# the equivalent code for rpm is in posttrans
if [ "$PACKAGE" = "deb" ]; then
if [ ! -f "${KBN_PATH_CONF}"/kibana.keystore ]; then
/usr/share/kibana/bin/kibana-keystore create
chown root:<%= group %> "${KBN_PATH_CONF}"/kibana.keystore
chmod 660 "${KBN_PATH_CONF}"/kibana.keystore
md5sum "${KBN_PATH_CONF}"/kibana.keystore > "${KBN_PATH_CONF}"/.kibana.keystore.initial_md5sum
fi
fi
8 changes: 8 additions & 0 deletions src/dev/build/tasks/os_packages/package_scripts/post_trans.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export KBN_PATH_CONF=${KBN_PATH_CONF:-<%= configDir %>}

if [ ! -f "${KBN_PATH_CONF}"/kibana.keystore ]; then
/usr/share/kibana/bin/kibana-keystore create
chown root:<%= group %> "${KBN_PATH_CONF}"/kibana.keystore
chmod 660 "${KBN_PATH_CONF}"/kibana.keystore
md5sum "${KBN_PATH_CONF}"/kibana.keystore > "${KBN_PATH_CONF}"/.kibana.keystore.initial_md5sum
fi
9 changes: 9 additions & 0 deletions src/dev/build/tasks/os_packages/run_fpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export async function runFpm(
}
};

const envFolder = type === 'rpm' ? 'sysconfig' : 'default';

const args = [
// Force output even if it will overwrite an existing file
'--force',
Expand Down Expand Up @@ -92,6 +94,8 @@ export async function runFpm(
resolve(__dirname, 'package_scripts/pre_remove.sh'),
'--after-remove',
resolve(__dirname, 'package_scripts/post_remove.sh'),
'--rpm-posttrans',
resolve(__dirname, 'package_scripts/post_trans.sh'),

// tell fpm about the config file so that it is called out in the package definition
'--config-files',
Expand Down Expand Up @@ -140,6 +144,11 @@ export async function runFpm(

// copy package configurations
`${resolveWithTrailingSlash(__dirname, 'service_templates/systemd/')}=/`,

`${resolveWithTrailingSlash(
__dirname,
'service_templates/env/kibana'
)}=/etc/${envFolder}/kibana`,
];

log.debug('calling fpm with args:', args);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/setup_node_env/no_transpilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ require('./harden');

require('symbol-observable');
require('source-map-support/register');
require('./root');
require('./node_version_validator');
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import {
} from '@testing-library/react';
import * as apmApi from '../../../../../../services/rest/createCallApmApi';

export const removeExternalLinkText = (str: string) =>
str.replace(/\(opens in a new tab or window\)/g, '');

describe('LinkPreview', () => {
let callApmApiSpy: jest.SpyInstance<any, never>;
beforeAll(() => {
Expand Down Expand Up @@ -53,7 +56,9 @@ describe('LinkPreview', () => {
);
expect(getElementValue(container, 'preview-label')).toEqual('foo');
expect(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
removeExternalLinkText(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
)
).toEqual('https://baz.co');
});
});
Expand All @@ -69,7 +74,9 @@ describe('LinkPreview', () => {
);
expect(getElementValue(container, 'preview-label')).toEqual('foo');
expect(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
removeExternalLinkText(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
)
).toEqual('https://baz.co?service.name={{invalid}');
expect(getByTestId(container, 'preview-warning')).toBeInTheDocument();
});
Expand All @@ -85,7 +92,9 @@ describe('LinkPreview', () => {
await waitFor(() => expect(callApmApiSpy).toHaveBeenCalled());
expect(getElementValue(container, 'preview-label')).toEqual('foo');
expect(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
removeExternalLinkText(
(getByTestId(container, 'preview-link') as HTMLAnchorElement).text
)
).toEqual('https://baz.co?transaction=foo');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ test('MLLink produces the correct URL', async () => {
);

expect(href).toMatchInlineSnapshot(
`"/app/ml/jobs?_a=(queryText:'id:(something)%20groups:(apm)')&_g=(refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"`
`"/app/ml/jobs?_a=(jobs:(queryText:'id:(something)%20groups:(apm)'))&_g=(refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"`
);
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2b1b9ef

Please sign in to comment.