ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [26/50] [abbrv] ambari git commit: AMBARI-21072. Removal of from/to Upgrade Versions in Web Client (alexantonenko)
Date Wed, 31 May 2017 20:12:57 GMT
AMBARI-21072. Removal of from/to Upgrade Versions in Web Client (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1e2ccbf0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1e2ccbf0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1e2ccbf0

Branch: refs/heads/trunk
Commit: 1e2ccbf0869283aafcdab8d37ee3fc36e4b41179
Parents: ace89b7
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri May 19 15:52:06 2017 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri May 19 15:52:06 2017 +0300

----------------------------------------------------------------------
 .../assets/data/stack_versions/upgrades.json    | 17 +++++++++--
 .../main/admin/stack_and_upgrade_controller.js  | 19 ++++++------
 .../app/mappers/stack_upgrade_history_mapper.js | 10 ++++--
 ambari-web/app/messages.js                      | 11 ++++---
 .../stack_version/stack_upgrade_history.js      |  3 +-
 ambari-web/app/utils/ajax/ajax.js               |  2 +-
 .../admin/stack_upgrade/upgrade_history_view.js |  5 +--
 .../admin/stack_and_upgrade_controller_test.js  |  7 ++---
 .../test/controllers/wizard/step8_test.js       |  5 ++-
 .../stack_upgrade_history_mapper_test.js        | 32 +++++++++-----------
 10 files changed, 62 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/assets/data/stack_versions/upgrades.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/stack_versions/upgrades.json b/ambari-web/app/assets/data/stack_versions/upgrades.json
index 5d0d743..f041994 100644
--- a/ambari-web/app/assets/data/stack_versions/upgrades.json
+++ b/ambari-web/app/assets/data/stack_versions/upgrades.json
@@ -1,5 +1,5 @@
 {
-  "href": "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/upgrades?fields=Upgrade/request_status,Upgrade/to_version,Upgrade/request_id,Upgrade/direction",
+  "href": "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/upgrades?fields=Upgrade/request_status,Upgrade/versions,Upgrade/request_id,Upgrade/direction",
   "items": [
     {
       "href": "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/upgrades/19",
@@ -8,7 +8,20 @@
         "direction": "UPGRADE",
         "request_id": 19,
         "request_status": "COMPLETED",
-        "to_version": "2.2.3.0-2610"
+        "versions": {
+          "STORM": {
+            "from_repository_id": 1,
+            "from_repository_version": "2.5.0.0-1237",
+            "target_repository_id": 5,
+            "target_repository_version": "2.5.4.0-121"
+          },
+          "ZOOKEEPER": {
+            "from_repository_id": 2,
+            "from_repository_version": "2.5.2.9-9999",
+            "target_repository_id": 5,
+            "target_repository_version": "2.5.4.0-121"
+          }
+        }
       }
     }
   ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index d444b2d..8c97d7b 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -154,7 +154,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     if (this.get('isDowngrade')) {
       return Em.I18n.t('admin.stackUpgrade.dialog.downgrade.header').format(this.get('upgradeVersion'));
     }
-    return Em.I18n.t('admin.stackUpgrade.dialog.header').format(this.get('upgradeTypeDisplayName'),
this.get('upgradeVersion'));
+    return Em.I18n.t('admin.stackUpgrade.dialog.header').format(this.get('upgradeVersion'));
   }.property('upgradeTypeDisplayName', 'upgradeVersion', 'isDowngrade'),
 
   /**
@@ -897,7 +897,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   upgradeSuccessCallback: function (data, opt, params) {
     this.set('upgradeData', null);
     this.set('upgradeId', data.resources[0].Upgrade.request_id);
-    this.set('fromVersion', data.resources[0].Upgrade.from_version);
+    this.set('fromVersion', params.isDowngrade ? data.resources[0].Upgrade.associated_version
: null);
     this.set('upgradeVersion', params.label);
     this.set('isDowngrade', !!params.isDowngrade);
     var upgradeMethod = this.get('upgradeMethods').findProperty('type', params.type),
@@ -921,7 +921,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     this.setDBProperties({
       upgradeVersion: params.label,
       upgradeId: data.resources[0].Upgrade.request_id,
-      fromVersion: data.resources[0].Upgrade.from_version,
+      fromVersion: params.isDowngrade ? data.resources[0].Upgrade.associated_version : null,
       upgradeState: 'PENDING',
       isDowngrade: !!params.isDowngrade,
       upgradeType: upgradeType,
@@ -1176,13 +1176,12 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
           version.skipComponentFailures = this.get('skipComponentFailures');
           version.skipSCFailures = this.get('skipSCFailures');
 
-          var fromVersion = self.get('upgradeVersion') || App.RepositoryVersion.find().findProperty('status',
'CURRENT').get('displayName');
           var toVersion = version.get('displayName');
           var bodyMessage = Em.Object.create({
             confirmButton: Em.I18n.t('yes'),
             confirmMsg: upgradeMethod.get('type') === 'ROLLING' ?
-              Em.I18n.t('admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg').format(fromVersion,
toVersion) :
-              Em.I18n.t('admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg').format(fromVersion,
toVersion)
+              Em.I18n.t('admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg').format(toVersion)
:
+              Em.I18n.t('admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg').format(toVersion)
           });
           return App.showConfirmationFeedBackPopup(function (query) {
             return self.runPreUpgradeCheck.call(self, version);
@@ -1954,11 +1953,11 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   restoreLastUpgrade: function(lastUpgradeData) {
     var self = this;
     var upgradeType = this.get('upgradeMethods').findProperty('type', lastUpgradeData.Upgrade.upgrade_type);
-
+    const isDowngrade = lastUpgradeData.Upgrade.direction === 'DOWNGRADE';
     this.setDBProperties({
-      fromVersion: lastUpgradeData.Upgrade.from_version,
+      fromVersion: isDowngrade ? lastUpgradeData.Upgrade.associated_version : null,
       upgradeId: lastUpgradeData.Upgrade.request_id,
-      isDowngrade: lastUpgradeData.Upgrade.direction === 'DOWNGRADE',
+      isDowngrade,
       upgradeState: lastUpgradeData.Upgrade.request_status,
       upgradeType: lastUpgradeData.Upgrade.upgrade_type,
       isWizardRestricted: upgradeType.get('isWizardRestricted'),
@@ -1970,7 +1969,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       })
     });
     this.loadRepoVersionsToModel().done(function () {
-      var toVersion = App.RepositoryVersion.find().findProperty('repositoryVersion', lastUpgradeData.Upgrade.to_version);
+      var toVersion = isDowngrade ? null : App.RepositoryVersion.find().findProperty('repositoryVersion',
lastUpgradeData.Upgrade.associated_version);
       self.setDBProperty('upgradeVersion', toVersion && toVersion.get('displayName'));
       self.initDBProperties();
       self.loadUpgradeData(true);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/mappers/stack_upgrade_history_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_upgrade_history_mapper.js b/ambari-web/app/mappers/stack_upgrade_history_mapper.js
index 25e9d06..47d248a 100644
--- a/ambari-web/app/mappers/stack_upgrade_history_mapper.js
+++ b/ambari-web/app/mappers/stack_upgrade_history_mapper.js
@@ -26,8 +26,8 @@ App.stackUpgradeHistoryMapper = App.QuickDataMapper.create({
     "request_id": "Upgrade.request_id",
     "cluster_name": "Upgrade.cluster_name",
     "direction": "Upgrade.direction",
-    "from_version": "Upgrade.from_version",
-    "to_version": "Upgrade.to_version",
+    "associated_version": "Upgrade.associated_version",
+    "versions" : "Upgrade.versions",
     "end_time":"Upgrade.end_time",
     "start_time":"Upgrade.start_time",
     "create_time": "Upgrade.create_time",
@@ -44,6 +44,12 @@ App.stackUpgradeHistoryMapper = App.QuickDataMapper.create({
     var result = [];
     json.items.forEach(function(item) {
       var parseResult = this.parseIt(item, this.get('config'));
+      if (parseResult.direction === 'UPGRADE') {
+        parseResult.to_version = parseResult.associated_version;
+      }
+      else {
+        parseResult.from_version = parseResult.associated_version;
+      }
       result.push(parseResult);
     }, this);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f34cbdc..b7ccdd5 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1779,8 +1779,8 @@ Em.I18n.translations = {
   'admin.stackVersions.version.upgrade.upgradeOptions.preCheck.allPassed.msg':'All checks
passed',
   'admin.stackVersions.version.upgrade.upgradeOptions.preCheck.failed.tooltip':'Option not
available',
   'admin.stackVersions.version.upgrade.upgradeOptions.notAllowed':'Not allowed by the current
version',
-  'admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg': 'You are about to
perform an <b>Express Upgrade</b> from <b>{0}</b> to <b>{1}</b>.
This will incur cluster downtime. Are you sure you want to proceed?',
-  'admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg': 'You are about to
perform a <b>Rolling Upgrade</b> from <b>{0}</b> to <b>{1}</b>.
Are you sure you want to proceed?',
+  'admin.stackVersions.version.upgrade.upgradeOptions.EU.confirm.msg': 'You are about to
perform an <b>Express Upgrade</b> to <b>{1}</b>. This will incur cluster
downtime. Are you sure you want to proceed?',
+  'admin.stackVersions.version.upgrade.upgradeOptions.RU.confirm.msg': 'You are about to
perform a <b>Rolling Upgrade</b> to <b>{1}</b>. Are you sure you want
to proceed?',
   'admin.stackVersions.version.upgrade.upgradeOptions.error': 'Could not proceed with upgrade:',
   'admin.stackVersions.version.upgrade.upgradeOptions.loading': 'Checking for supported upgrade
types...',
 
@@ -1815,7 +1815,8 @@ Em.I18n.translations = {
   'admin.stackVersions.upgradeHistory.filter.failed.upgrade': 'Failed Upgrade ({0})',
   'admin.stackVersions.upgradeHistory.filter.failed.downgrade': 'Failed Downgrade ({0})',
   'admin.stackVersions.upgradeHistory.no.history': 'No upgrade/downgrade history available',
-  'admin.stackVersions.upgradeHistory.record.title': '{0} {1} to {2}',
+  'admin.stackVersions.upgradeHistory.record.title.upgrade': '{0} {1} to {2}',
+  'admin.stackVersions.upgradeHistory.record.title.downgrade': '{0} {1} from {2}',
 
   'admin.stackUpgrade.preCheck.warning.message': "{0} Warning {1}",
   'admin.stackUpgrade.preCheck.bypass.message': "{0} Error {1}",
@@ -1866,8 +1867,8 @@ Em.I18n.translations = {
   'admin.stackUpgrade.state.paused.downgrade': "Downgrade Paused",
   'admin.stackUpgrade.state.aborted.downgrade': "Downgrade Aborted",
   'admin.stackUpgrade.state.completed.downgrade': "Downgrade Finished",
-  'admin.stackUpgrade.dialog.header': "{0} to {1}",
-  'admin.stackUpgrade.dialog.downgrade.header': "Downgrade to {0}",
+  'admin.stackUpgrade.dialog.header': "Upgrade to {0}",
+  'admin.stackUpgrade.dialog.downgrade.header': "Downgrade from {0}",
   'admin.stackUpgrade.dialog.operationFailed': "This operation failed.",
   'admin.stackUpgrade.dialog.stop': "Stop Upgrade",
   'admin.stackUpgrade.dialog.continue': "Ignore and Proceed",

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/models/stack_version/stack_upgrade_history.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/stack_upgrade_history.js b/ambari-web/app/models/stack_version/stack_upgrade_history.js
index 7276c5c..9b0c8b2 100644
--- a/ambari-web/app/models/stack_version/stack_upgrade_history.js
+++ b/ambari-web/app/models/stack_version/stack_upgrade_history.js
@@ -24,8 +24,7 @@ App.StackUpgradeHistory = DS.Model.extend({
   requestId: DS.attr('number'),
   clusterName: DS.attr('string'),
   direction: DS.attr('string'),
-  fromVersion: DS.attr('string'),
-  toVersion: DS.attr('string'),
+  associatedVersion: DS.attr('string'),
   requestStatus: DS.attr('string'),
   upgradeType: DS.attr('string'),
   downgradeAllowed: DS.attr('boolean'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 4dc04f4..888dee3 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1357,7 +1357,7 @@ var urls = {
     'mock': '/data/clusters/info.json'
   },
   'cluster.load_last_upgrade': {
-    'real': '/clusters/{clusterName}/upgrades?fields=Upgrade/request_status,Upgrade/request_id,Upgrade/to_version,Upgrade/from_version,Upgrade/direction,Upgrade/upgrade_type,Upgrade/downgrade_allowed,Upgrade/skip_failures,Upgrade/skip_service_check_failures',
+    'real': `/clusters/{clusterName}/upgrades?fields=Upgrade/request_status,Upgrade/request_id,Upgrade/versions,Upgrade/associated_version,Upgrade/direction,Upgrade/upgrade_type,Upgrade/downgrade_allowed,Upgrade/skip_failures,Upgrade/skip_service_check_failures`,
     'mock': '/data/stack_versions/upgrades.json'
   },
   'cluster.update_upgrade_version': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/app/views/main/admin/stack_upgrade/upgrade_history_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_history_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_history_view.js
index aeee96e..718ddc7 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_history_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_history_view.js
@@ -290,16 +290,17 @@ App.MainAdminStackUpgradeHistoryView = App.TableView.extend(App.TableServerViewM
   showUpgradeHistoryRecord: function (event) {
     var record = event.context;
     var direction = App.format.normalizeName(record.get('direction'));
-    var toVersion = record.get('toVersion');
+    var associatedVersion = record.get('associatedVersion');
     var type = this.get('upgradeMethods').findProperty('type', record.get('upgradeType'));
     var displayName = type ? type.get('displayName') : App.format.normalizeName(record.get('upgradeType'));
+    const i18nKeySuffix = direction === 'UPGRADE' ? 'upgrade' : 'downgrade';
 
     this.get('controller').set('currentUpgradeRecord', record);
 
     App.ModalPopup.show({
       classNames: ['wide-modal-wrapper'],
       modalDialogClasses: ['modal-xlg'],
-      header: Em.I18n.t('admin.stackVersions.upgradeHistory.record.title').format(displayName,
direction, toVersion),
+      header: Em.I18n.t(`admin.stackVersions.upgradeHistory.record.title.${i18nKeySuffix}`).format(displayName,
direction, associatedVersion),
       bodyClass: App.MainAdminStackUpgradeHistoryDetailsView,
       primary: Em.I18n.t('common.dismiss'),
       secondary: null,

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index fa0a0b9..698331e 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -1741,7 +1741,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
 
     var data = {
       Upgrade: {
-        from_version: '1.1',
+        associated_version: '1.1',
         request_id: 1,
         direction: 'UPGRADE',
         request_status: 'PENDING',
@@ -1781,7 +1781,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
     });
     it('proper data is saved to the localDB', function () {
       expect(controller.setDBProperties.getCall(0).args[0]).to.eql({
-        fromVersion: '1.1',
+        fromVersion: null,
         upgradeId: 1,
         isDowngrade: false,
         upgradeState: 'PENDING',
@@ -1798,9 +1798,6 @@ describe('App.MainAdminStackAndUpgradeController', function() {
     it('models are saved', function () {
       expect(controller.loadRepoVersionsToModel.calledOnce).to.be.true;
     });
-    it('correct upgradeVersion is saved to the DB', function () {
-      expect(controller.setDBProperty.calledWith('upgradeVersion', 'HDP-1')).to.be.true;
-    });
     it('initDBProperties is called', function () {
       expect(controller.initDBProperties.calledOnce).to.be.true;
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 1a3214e..6435aa3 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -157,11 +157,11 @@ describe('App.WizardStep8Controller', function () {
 
     tests.forEach(function (test) {
       it(test.selectedServices.join(','), function () {
-        var services = test.selectedServices.map(function (serviceName) {
+        var mappedServices = test.selectedServices.map(function (serviceName) {
           return Em.Object.create({isSelected: true, isInstalled: false, serviceName: serviceName});
         });
         installerStep8Controller = App.WizardStep8Controller.create({
-          content: {controllerName: 'addServiceController', services: services},
+          content: {controllerName: 'addServiceController', services: mappedServices},
           configs: configs
         });
         var serviceData = installerStep8Controller.createSelectedServicesData();
@@ -2343,7 +2343,6 @@ describe('App.WizardStep8Controller', function () {
   });
   //TODO
   describe('#generateBlueprint', function () {
-     console.log("testing.......")
      beforeEach(function () {
          installerStep8Controller = getController();
          installerStep8Controller.set('configs', configs);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e2ccbf0/ambari-web/test/mappers/stack_upgrade_history_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/stack_upgrade_history_mapper_test.js b/ambari-web/test/mappers/stack_upgrade_history_mapper_test.js
index 07027e1..aa1501f 100644
--- a/ambari-web/test/mappers/stack_upgrade_history_mapper_test.js
+++ b/ambari-web/test/mappers/stack_upgrade_history_mapper_test.js
@@ -37,7 +37,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463779266087,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -61,7 +61,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463779299440,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -85,7 +85,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463780757685,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -109,7 +109,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463780794009,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -133,7 +133,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463781341452,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -157,7 +157,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1463781371778,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -181,7 +181,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464120881477,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -205,7 +205,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464120918774,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -229,7 +229,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464121132856,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -253,7 +253,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464121167178,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -277,7 +277,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464121301821,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Upgrading to 2.4.0.0-169",
@@ -301,7 +301,7 @@ describe('App.stackUpgradeHistoryMapper', function () {
               "downgrade_allowed" : true,
               "end_time" : 1464121336149,
               "exclusive" : false,
-              "from_version" : "2.3.6.0-3712",
+              "associated_version" : "2.3.6.0-3712",
               "pack" : "nonrolling-upgrade-2.4",
               "progress_percent" : 100.0,
               "request_context" : "Downgrading to 2.3.6.0-3712",
@@ -325,13 +325,11 @@ describe('App.stackUpgradeHistoryMapper', function () {
         "direction" : "DOWNGRADE",
         "downgradeAllowed" : true,
         "endTime" : 1464121336149,
-        "fromVersion" : "2.3.6.0-3712",
         "requestId" : 18,
         "requestStatus" : "COMPLETED",
         "skipFailures" : false,
         "skipServiceCheckFailures" : false,
         "startTime" : 1464121302941,
-        "toVersion" : "2.3.6.0-3712",
         "upgradeType" : "NON_ROLLING"
     };
 
@@ -353,10 +351,10 @@ describe('App.stackUpgradeHistoryMapper', function () {
       var total_upgrades = 0;
       upgrades.forEach(function(upgrade){
         var direction = upgrade.get('direction')
-        if ('DOWNGRADE' == direction){
+        if ('DOWNGRADE' === direction){
           total_downgrades++;
         }
-        if ('UPGRADE' == direction){
+        if ('UPGRADE' === direction){
           total_upgrades++;
         }
       });
@@ -369,4 +367,4 @@ describe('App.stackUpgradeHistoryMapper', function () {
       });
     });
   });
-});
\ No newline at end of file
+});


Mime
View raw message