Manually incrementing the hardcoded master version to 6.0 (#535)
* Manually incrementing the hardcoded master version to 6.0 * Adding branch_versions to the package.json * Modifying the way branch_versions work
This commit is contained in:
@ -36,7 +36,10 @@
|
|||||||
"unstable_es_branches": [
|
"unstable_es_branches": [
|
||||||
"5.x",
|
"5.x",
|
||||||
"master"
|
"master"
|
||||||
]
|
],
|
||||||
|
"branch_versions": {
|
||||||
|
"master": "6.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@spalger/eslint-config-personal": "^0.4.0",
|
"@spalger/eslint-config-personal": "^0.4.0",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var pkg = require('../package.json');
|
var pkg = require('../package.json');
|
||||||
var branches = pkg.config.supported_es_branches;
|
var branches = pkg.config.supported_es_branches;
|
||||||
|
var branchVersions = pkg.config.branch_versions;
|
||||||
var semver = require('semver');
|
var semver = require('semver');
|
||||||
|
|
||||||
var maxMinorVersion = function (majorV) {
|
var maxMinorVersion = function (majorV) {
|
||||||
@ -18,14 +19,14 @@ function Version(v) {
|
|||||||
Version.fromBranch = function (branch) {
|
Version.fromBranch = function (branch) {
|
||||||
var m;
|
var m;
|
||||||
|
|
||||||
// master === the highest version number
|
var branchVersion = branchVersions[branch];
|
||||||
if (branch === 'master') return new Version('5.0.0');
|
var versionString = branchVersion ? branchVersion : branch;
|
||||||
|
|
||||||
// n.m -> n.m.0
|
// n.m -> n.m.0
|
||||||
if (m = branch.match(/^\d+\.\d+$/)) return new Version(branch + '.0');
|
if (m = versionString.match(/^\d+\.\d+$/)) return new Version(versionString + '.0');
|
||||||
|
|
||||||
// n.x -> n.(maxVersion + 1).0
|
// n.x -> n.(maxVersion + 1).0
|
||||||
if (m = branch.match(/^(\d+)\.x$/i)) return maxMinorVersion(m[1]).increment('minor');
|
if (m = versionString.match(/^(\d+)\.x$/i)) return maxMinorVersion(m[1]).increment('minor');
|
||||||
|
|
||||||
throw new Error('unable to convert branch "' + branch + '" to semver');
|
throw new Error('unable to convert branch "' + branch + '" to semver');
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,7 @@ var ca = require('../client_action').makeFactoryWithModifier(function (spec) {
|
|||||||
var namespace = require('../client_action').namespaceFactory;
|
var namespace = require('../client_action').namespaceFactory;
|
||||||
var api = module.exports = {};
|
var api = module.exports = {};
|
||||||
|
|
||||||
api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks'];
|
api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'snapshot', 'tasks'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-bulk.html) request
|
* Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.x/docs-bulk.html) request
|
||||||
@ -5990,6 +5990,19 @@ api.reindexRethrottle = ca({
|
|||||||
method: 'POST'
|
method: 'POST'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.remote = namespace();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform a [remote.info](http://www.elastic.co/guide/en/elasticsearch/reference/master/remote-info.html) request
|
||||||
|
*
|
||||||
|
* @param {Object} params - An object with parameters used to carry out this action
|
||||||
|
*/
|
||||||
|
api.remote.prototype.info = ca({
|
||||||
|
url: {
|
||||||
|
fmt: '/_remote/info'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/5.x/search-template.html) request
|
* Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/5.x/search-template.html) request
|
||||||
*
|
*
|
||||||
|
|||||||
@ -11,7 +11,7 @@ var ca = require('../client_action').makeFactoryWithModifier(function (spec) {
|
|||||||
var namespace = require('../client_action').namespaceFactory;
|
var namespace = require('../client_action').namespaceFactory;
|
||||||
var api = module.exports = {};
|
var api = module.exports = {};
|
||||||
|
|
||||||
api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks'];
|
api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'snapshot', 'tasks'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
|
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
|
||||||
@ -1206,7 +1206,10 @@ api.clearScroll = ca({
|
|||||||
fmt: '/_search/scroll'
|
fmt: '/_search/scroll'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
paramAsBody: 'scrollId',
|
paramAsBody: {
|
||||||
|
param: 'scrollId',
|
||||||
|
body: 'scroll_id'
|
||||||
|
},
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -5679,6 +5682,19 @@ api.reindexRethrottle = ca({
|
|||||||
method: 'POST'
|
method: 'POST'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.remote = namespace();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform a [remote.info](http://www.elastic.co/guide/en/elasticsearch/reference/master/remote-info.html) request
|
||||||
|
*
|
||||||
|
* @param {Object} params - An object with parameters used to carry out this action
|
||||||
|
*/
|
||||||
|
api.remote.prototype.info = ca({
|
||||||
|
url: {
|
||||||
|
fmt: '/_remote/info'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html) request
|
* Perform a [renderSearchTemplate](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html) request
|
||||||
*
|
*
|
||||||
@ -5732,7 +5748,10 @@ api.scroll = ca({
|
|||||||
fmt: '/_search/scroll'
|
fmt: '/_search/scroll'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
paramAsBody: 'scrollId',
|
paramAsBody: {
|
||||||
|
param: 'scrollId',
|
||||||
|
body: 'scroll_id'
|
||||||
|
},
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user