diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20030f9edea74..d0b1c8ce13fea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,10 @@ A high level overview of our contributing guidelines. - [Voicing the importance of an issue](#voicing-the-importance-of-an-issue) - ["My issue isn't getting enough attention"](#my-issue-isnt-getting-enough-attention) - ["I want to help!"](#i-want-to-help) +- [How We Use Git and GitHub](#how-we-use-git-and-github) + - [Branching](#branching) + - [Commits and Merging](#commits-and-merging) + - [What Goes Into a Pull Request](#what-goes-into-a-pull-request) - [Contributing Code](#contributing-code) - [Setting Up Your Development Environment](#setting-up-your-development-environment) - [Customizing `config/kibana.dev.yml`](#customizing-configkibanadevyml) @@ -65,6 +69,31 @@ Feel free to bump your issues if you think they've been neglected for a prolonge We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code. +## How We Use Git and GitHub + +### Branching + +* All work on the next major release goes into master. +* Past major release branches are named `{majorVersion}.x`. They contain work that will go into the next minor release. For example, if the next minor release is `5.2.0`, work for it should go into the `5.x` branch. +* Past minor release branches are named `{majorVersion}.{minorVersion}`. They contain work that will go into the next patch release. For example, if the next patch release is `5.3.1`, work for it should go into the `5.3` branch. +* All work is done on feature branches and merged into one of these branches. +* Where appropriate, we'll backport changes into older release branches. + +### Commits and Merging + +* Feel free to make as many commits as you want, while working on a branch. +* When submitting a PR for review, please perform an interactive rebase to present a logical history that's easy for the reviewers to follow. +* Please use your commit messages to include helpful information on your changes, e.g. changes to APIs, UX changes, bugs fixed, and an explanation of *why* you made the changes that you did. +* Resolve merge conflicts by rebasing the target branch over your feature branch, and force-pushing. +* When merging, we'll squash your commits into a single commit. + +### What Goes Into a Pull Request + +* Please include an explanation of your changes in your PR description. +* Links to relevant issues, external resources, or related PRs are very important and useful. +* Please update any tests that pertain to your code, and add new tests where appropriate. +* See [Submitting a Pull Request](#submitting-a-pull-request) for more info. + ## Contributing Code These guidelines will help you get your Pull Request into shape so that a code review can start as soon as possible. diff --git a/README.md b/README.md index 03bf3e789de6a..6e6ad0f3a34e1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ _Note: The version numbers below are only examples, meant to illustrate the rela | ES patch number is newer. | 5.1.__2__ | 5.1.__5__ | ⚠️ Logged warning | | ES minor number is newer. | 5.__1__.2 | 5.__5__.0 | ⚠️ Logged warning | | ES major number is newer. | __5__.1.2 | __6__.0.0 | 🚫 Fatal error | -| ES patch number is older. | 5.1.__2__ | 5.1.__0__ | 🚫 Fatal error | +| ES patch number is older. | 5.1.__2__ | 5.1.__0__ | ⚠️ Logged warning | | ES minor number is older. | 5.__1__.2 | 5.__0__.0 | 🚫 Fatal error | | ES major number is older. | __5__.1.2 | __4__.0.0 | 🚫 Fatal error | diff --git a/docs/getting-started/tutorial-load-dataset.asciidoc b/docs/getting-started/tutorial-load-dataset.asciidoc index 395bd2ed63915..44a42bc853445 100644 --- a/docs/getting-started/tutorial-load-dataset.asciidoc +++ b/docs/getting-started/tutorial-load-dataset.asciidoc @@ -4,9 +4,9 @@ The tutorials in this section rely on the following data sets: * The complete works of William Shakespeare, suitably parsed into fields. Download this data set by clicking here: - https://www.elastic.co/guide/en/kibana/3.0/snippets/shakespeare.json[shakespeare.json]. + https://download.elastic.co/demos/kibana/gettingstarted/shakespeare.json[shakespeare.json]. * A set of fictitious accounts with randomly generated data. Download this data set by clicking here: - https://github.com/bly2k/files/blob/master/accounts.zip?raw=true[accounts.zip] + https://download.elastic.co/demos/kibana/gettingstarted/accounts.zip[accounts.zip] * A set of randomly generated log files. Download this data set by clicking here: https://download.elastic.co/demos/kibana/gettingstarted/logs.jsonl.gz[logs.jsonl.gz] diff --git a/src/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js b/src/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js index 7220c7703a579..d2c98858815b9 100644 --- a/src/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js +++ b/src/core_plugins/elasticsearch/lib/__tests__/is_es_compatible_with_kibana.js @@ -16,10 +16,6 @@ describe('plugins/elasticsearch', () => { it('when majors are equal, but ES minor is less than Kibana minor', () => { expect(isEsCompatibleWithKibana('1.0.0', '1.1.0')).to.be(false); }); - - it('when majors and minors are equal, but ES patch is less than Kibana patch', () => { - expect(isEsCompatibleWithKibana('1.1.0', '1.1.1')).to.be(false); - }); }); describe('returns true', () => { @@ -34,6 +30,10 @@ describe('plugins/elasticsearch', () => { it('when majors and minors are equal, and ES patch is greater than Kibana patch', () => { expect(isEsCompatibleWithKibana('1.1.1', '1.1.0')).to.be(true); }); + + it('when majors and minors are equal, but ES patch is less than Kibana patch', () => { + expect(isEsCompatibleWithKibana('1.1.0', '1.1.1')).to.be(true); + }); }); }); }); diff --git a/src/core_plugins/elasticsearch/lib/check_es_version.js b/src/core_plugins/elasticsearch/lib/check_es_version.js index d00fce6f85b07..a3570af0472fe 100644 --- a/src/core_plugins/elasticsearch/lib/check_es_version.js +++ b/src/core_plugins/elasticsearch/lib/check_es_version.js @@ -4,7 +4,6 @@ */ import _ from 'lodash'; -import semver from 'semver'; import isEsCompatibleWithKibana from './is_es_compatible_with_kibana'; /** @@ -36,9 +35,9 @@ module.exports = function checkEsVersion(server, kibanaVersion) { return incompatibleNodes.push(esNode); } - // It's acceptable if ES is ahead of Kibana, but we want to prompt users to upgrade Kibana - // to match it. - if (semver.gt(esNode.version, kibanaVersion)) { + // It's acceptable if ES and Kibana versions are not the same so long as + // they are not incompatible, but we should warn about it + if (esNode.version !== kibanaVersion) { warningNodes.push(esNode); } }); @@ -64,9 +63,9 @@ module.exports = function checkEsVersion(server, kibanaVersion) { lastWarnedNodesForServer.set(server, warningNodeNames); server.log(['warning'], { tmpl: ( - `You're running Kibana ${kibanaVersion} with some newer versions of ` + - 'Elasticsearch. Update Kibana to the latest version to prevent compatibility issues: ' + - warningNodeNames + `You're running Kibana ${kibanaVersion} with some different versions of ` + + 'Elasticsearch. Update Kibana or Elasticsearch to the same ' + + `version to prevent compatibility issues: ${warningNodeNames}` ), kibanaVersion, nodes: simplifiedNodes, diff --git a/src/core_plugins/elasticsearch/lib/es_bool.js b/src/core_plugins/elasticsearch/lib/es_bool.js deleted file mode 100644 index 353520f3fea32..0000000000000 --- a/src/core_plugins/elasticsearch/lib/es_bool.js +++ /dev/null @@ -1,17 +0,0 @@ -const map = { - 'false': false, - 'off': false, - 'no': false, - '0': false, - 'true': true, - 'on': true, - 'yes': true, - '1': true -}; -module.exports = function (str) { - const bool = map[String(str)]; - if (typeof bool !== 'boolean') { - throw new TypeError('"' + str + '" does not map to an esBool'); - } - return bool; -}; diff --git a/src/core_plugins/elasticsearch/lib/is_es_compatible_with_kibana.js b/src/core_plugins/elasticsearch/lib/is_es_compatible_with_kibana.js index 21bec63869e5a..954e25033ee00 100644 --- a/src/core_plugins/elasticsearch/lib/is_es_compatible_with_kibana.js +++ b/src/core_plugins/elasticsearch/lib/is_es_compatible_with_kibana.js @@ -29,10 +29,5 @@ export default function isEsCompatibleWithKibana(esVersion, kibanaVersion) { return false; } - // Reject older patch versions of ES. - if (esVersionNumbers.patch < kibanaVersionNumbers.patch) { - return false; - } - return true; } diff --git a/src/core_plugins/metric_vis/public/metric_vis.js b/src/core_plugins/metric_vis/public/metric_vis.js index f73b9ffe5a7a9..6a192f74dc01d 100644 --- a/src/core_plugins/metric_vis/public/metric_vis.js +++ b/src/core_plugins/metric_vis/public/metric_vis.js @@ -21,7 +21,7 @@ function MetricVisProvider(Private) { name: 'metric', title: 'Metric', description: 'One big number for all of your one big number needs. Perfect for showing ' + - 'a count of hits, or the exact average a numeric field.', + 'a count of hits, or the exact average of a numeric field.', icon: 'fa-calculator', template: metricVisTemplate, params: { diff --git a/src/core_plugins/table_vis/public/table_vis.js b/src/core_plugins/table_vis/public/table_vis.js index 85ede8dbd9bb5..af004bcc633a4 100644 --- a/src/core_plugins/table_vis/public/table_vis.js +++ b/src/core_plugins/table_vis/public/table_vis.js @@ -32,7 +32,7 @@ function TableVisTypeProvider(Private) { title: 'Data table', icon: 'fa-table', description: 'The data table provides a detailed breakdown, in tabular format, of the results of a composed ' + - 'aggregation. Tip, a data table is available from many other charts by clicking grey bar at the bottom of the chart.', + 'aggregation. Tip, a data table is available from many other charts by clicking the grey bar at the bottom of the chart.', template: tableVisTemplate, params: { defaults: { diff --git a/src/core_plugins/timelion/public/vis/index.js b/src/core_plugins/timelion/public/vis/index.js index 6801b72aed908..e5243a8ec4336 100644 --- a/src/core_plugins/timelion/public/vis/index.js +++ b/src/core_plugins/timelion/public/vis/index.js @@ -18,7 +18,7 @@ function TimelionVisProvider(Private) { title: 'Timeseries', icon: 'fa-clock-o', description: 'Create timeseries charts using the timelion expression language. ' + - 'Perfect for computing and combining timeseries set with functions suchs as derivatives and moving averages', + 'Perfect for computing and combining timeseries sets with functions such as derivatives and moving averages', template: require('plugins/timelion/vis/timelion_vis.html'), params: { editor: require('plugins/timelion/vis/timelion_vis_params.html') diff --git a/src/ui/public/url/__tests__/url.js b/src/ui/public/url/__tests__/url.js index f881be13ffce9..d29dfa4a69c9b 100644 --- a/src/ui/public/url/__tests__/url.js +++ b/src/ui/public/url/__tests__/url.js @@ -368,7 +368,7 @@ describe('kbnUrl', function () { }); it('should call replace on $location', function () { - sinon.stub(kbnUrl, '_shouldAutoReload').returns(false); + sinon.stub(kbnUrl, '_shouldForceReload').returns(false); sinon.stub($location, 'replace'); expect($location.replace.callCount).to.be(0); @@ -403,7 +403,7 @@ describe('kbnUrl', function () { }); it('should call replace on $location', function () { - sinon.stub(kbnUrl, '_shouldAutoReload').returns(false); + sinon.stub(kbnUrl, '_shouldForceReload').returns(false); sinon.stub($location, 'replace'); expect($location.replace.callCount).to.be(0); @@ -412,7 +412,7 @@ describe('kbnUrl', function () { }); }); - describe('_shouldAutoReload', function () { + describe('_shouldForceReload', function () { let next; let prev; @@ -430,7 +430,7 @@ describe('kbnUrl', function () { it('returns false if the passed url doesn\'t match the current route', function () { next.path = '/not current'; - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); describe('if the passed url does match the route', function () { @@ -438,14 +438,14 @@ describe('kbnUrl', function () { describe('and the path is the same', function () { describe('and the search params are the same', function () { it('returns true', function () { - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true); }); }); describe('but the search params are different', function () { it('returns false', function () { next.search = {}; prev.search = { q: 'search term' }; - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); }); }); @@ -457,14 +457,14 @@ describe('kbnUrl', function () { describe('and the search params are the same', function () { it('returns false', function () { - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); }); describe('but the search params are different', function () { it('returns false', function () { next.search = {}; prev.search = { q: 'search term' }; - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); }); }); @@ -478,14 +478,14 @@ describe('kbnUrl', function () { describe('and the path is the same', function () { describe('and the search params are the same', function () { it('returns true', function () { - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true); }); }); describe('but the search params are different', function () { it('returns true', function () { next.search = {}; prev.search = { q: 'search term' }; - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(true); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(true); }); }); }); @@ -497,14 +497,14 @@ describe('kbnUrl', function () { describe('and the search params are the same', function () { it('returns false', function () { - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); }); describe('but the search params are different', function () { it('returns false', function () { next.search = {}; prev.search = { q: 'search term' }; - expect(kbnUrl._shouldAutoReload(next, prev, $route)).to.be(false); + expect(kbnUrl._shouldForceReload(next, prev, $route)).to.be(false); }); }); }); diff --git a/src/ui/public/url/url.js b/src/ui/public/url/url.js index 9dd01aeda9853..2292bbca56a22 100644 --- a/src/ui/public/url/url.js +++ b/src/ui/public/url/url.js @@ -164,7 +164,7 @@ function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) { if ($injector.has('$route')) { const $route = $injector.get('$route'); - if (self._shouldAutoReload(next, prev, $route)) { + if (self._shouldForceReload(next, prev, $route)) { const appState = Private(AppStateProvider).getAppState(); if (appState) appState.destroy(); @@ -179,13 +179,18 @@ function KbnUrlProvider($injector, $location, $rootScope, $parse, Private) { } }; - self._shouldAutoReload = function (next, prev, $route) { + // determine if the router will automatically reload the route + self._shouldForceReload = function (next, prev, $route) { if (reloading) return false; const route = $route.current && $route.current.$$route; if (!route) return false; - if (next.path !== prev.path) return false; + // for the purposes of determining whether the router will + // automatically be reloading, '' and '/' are equal + const nextPath = next.path || '/'; + const prevPath = prev.path || '/'; + if (nextPath !== prevPath) return false; const reloadOnSearch = route.reloadOnSearch; const searchSame = _.isEqual(next.search, prev.search); diff --git a/src/ui/public/vislib/visualizations/_map.js b/src/ui/public/vislib/visualizations/_map.js index 93b748d7d06e7..a0b5c66fab71f 100644 --- a/src/ui/public/vislib/visualizations/_map.js +++ b/src/ui/public/vislib/visualizations/_map.js @@ -253,21 +253,21 @@ export default function MapFactory(Private, tilemap, $sanitize) { const southEast = bounds.getSouthEast(); const northWest = bounds.getNorthWest(); - let SouthEastLng = southEast.lng; - if (SouthEastLng > 180) { - SouthEastLng -= 360; + let southEastLng = southEast.lng; + if (southEastLng > 180) { + southEastLng -= 360; } - let NorthWestLng = northWest.lng; - if (NorthWestLng < -180) { - NorthWestLng += 360; + let northWestLng = northWest.lng; + if (northWestLng < -180) { + northWestLng += 360; } - const SouthEastLat = southEast.lat; - const NorthWestLat = northWest.lat; + const southEastLat = southEast.lat; + const northWestLat = northWest.lat; //Bounds cannot be created unless they form a box with larger than 0 dimensions //Invalid areas are rejected by ES. - if (SouthEastLat === NorthWestLat || SouthEastLng === NorthWestLng) { + if (southEastLat === northWestLat || southEastLng === northWestLng) { return; } @@ -276,12 +276,12 @@ export default function MapFactory(Private, tilemap, $sanitize) { chart: self._chartData, bounds: { bottom_right: { - lat: SouthEastLat, - lon: SouthEastLng + lat: southEastLat, + lon: southEastLng }, top_left: { - lat: NorthWestLat, - lon: NorthWestLng + lat: northWestLat, + lon: northWestLng } } }); diff --git a/src/ui/public/vislib/visualizations/pie_chart.js b/src/ui/public/vislib/visualizations/pie_chart.js index ddd24217c451f..7884d97463dac 100644 --- a/src/ui/public/vislib/visualizations/pie_chart.js +++ b/src/ui/public/vislib/visualizations/pie_chart.js @@ -119,6 +119,7 @@ export default function PieChartFactory(Private) { return Math.max(0, Math.min(2 * Math.PI, x(d.x))); }) .endAngle(function (d) { + if (d.dx < 1e-8) return x(d.x); return Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx))); }) .innerRadius(function (d) { diff --git a/src/ui/settings/defaults.js b/src/ui/settings/defaults.js index 62c89bddb2ef1..606c13ec126d9 100644 --- a/src/ui/settings/defaults.js +++ b/src/ui/settings/defaults.js @@ -73,7 +73,7 @@ export default function defaultSettingsProvider() { 'doc_table:highlight': { value: true, description: 'Highlight results in Discover and Saved Searches Dashboard.' + - 'Highlighing makes request slow when working on big documents.', + 'Highlighting makes requests slow when working on big documents.', }, 'courier:maxSegmentCount': { value: 30, @@ -94,11 +94,11 @@ export default function defaultSettingsProvider() { }, 'histogram:barTarget': { value: 50, - description: 'Attempt to generate around this many bar when using "auto" interval in date histograms', + description: 'Attempt to generate around this many bars when using "auto" interval in date histograms', }, 'histogram:maxBars': { value: 100, - description: 'Never show more than this many bar in date histograms, scale values if needed', + description: 'Never show more than this many bars in date histograms, scale values if needed', }, 'visualization:tileMap:maxPrecision': { value: 7,