<commit_before>var gulp = require("gulp");
var eclint = require("eclint");
var jsonlint = require("gulp-jsonlint");
var zip = require("gulp-zip");
var dateFormat = require("dateformat");
var jsonfile = require('jsonfile');
var _ = require('lodash');
var addsrc = require('gulp-add-src');

jsonfile.spaces = 2;

gulp.task("patch", function(cb) {
  jsonfile.readFile("../src/allowedValues.json", function(err, obj) {
    var versions = obj.versions;
    var vmSizes = obj.vmSizes;

    var mainTemplate = "../src/mainTemplate.json";
    var uiTemplate = "../src/createUiDefinition.json";

    jsonfile.readFile(mainTemplate, function(err, obj) {
      obj.parameters.esVersion.allowedValues = versions;
      obj.parameters.vmSizeDataNodes.allowedValues = vmSizes;
      obj.parameters.vmSizeMasterNodes.allowedValues = vmSizes;
      obj.parameters.vmSizeClientNodes.allowedValues = vmSizes;
      jsonfile.writeFile(mainTemplate, obj, function (err) {
        jsonfile.readFile(uiTemplate, function(err, obj) {
          var clusterStep = _.find(obj.parameters.steps, function (step) {
            return step.name == "clusterSettingsStep";
          });
          var versionControl = _.find(clusterStep.elements, function (el) {
            return el.name == "esVersion";
          });
          versionControl.constraints.allowedValues = _.map(versions, function(v)<commit_msg>automatically move to latest version as part of the build<commit_after>var gulp = require("gulp");
var eclint = require("eclint");
var jsonlint = require("gulp-jsonlint");
var zip = require("gulp-zip");
var dateFormat = require("dateformat");
var jsonfile = require('jsonfile');
var _ = require('lodash');
var addsrc = require('gulp-add-src');

jsonfile.spaces = 2;

gulp.task("patch", function(cb) {
  jsonfile.readFile("../src/allowedValues.json", function(err, obj) {
    var versions = obj.versions;
    var vmSizes = obj.vmSizes;

    var mainTemplate = "../src/mainTemplate.json";
    var uiTemplate = "../src/createUiDefinition.json";

    jsonfile.readFile(mainTemplate, function(err, obj) {
      obj.parameters.esVersion.allowedValues = versions;
      obj.parameters.esVersion.defaultValue = _.last(versions);
      obj.parameters.vmSizeDataNodes.allowedValues = vmSizes;
      obj.parameters.vmSizeMasterNodes.allowedValues = vmSizes;
      obj.parameters.vmSizeClientNodes.allowedValues = vmSizes;
      jsonfile.writeFile(mainTemplate, obj, function (err) {
        jsonfile.readFile(uiTemplate, function(err, obj) {
          var clusterStep = _.find(obj.parameters.steps, function (step) {
            return step.name == "clusterSettingsStep";
          });
          var versionControl = _.find(clusterStep.elements, function (el) {
            return el.name == "esVersion";
          });
          versionControl.constraints.allowedValues = _.map(versions, function(v)
{'fraction_non_alphanumeric': 0.13389121338912133, 'fraction_numerical': 0.000697350069735007, 'mean_word_length': 3.6499189627228525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2048559', 'n_tokens_mistral': 834, 'n_tokens_neox': 828, 'n_words': 168}