Skip to content

Commit

Permalink
Merge pull request #3256 from jrsquared/isolated-testing-target-stage
Browse files Browse the repository at this point in the history
(netflix) Add Isolated Testing Target stage
  • Loading branch information
anotherchrisberry authored Feb 9, 2017
2 parents f7fc33f + ed61a59 commit 17d1d68
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _ from 'lodash';
let angular = require('angular');

module.exports = angular
.module('spinnaker.netfilx.widgits.canaryConfigSelector.directive', [
.module('spinnaker.netflix.widgits.canaryConfigSelector.directive', [
require('./canary.read.service'),
])
.directive('canaryConfigSelector', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let angular = require('angular');

module.exports = angular
.module('spinnaker.netfilx.fastProperty.pod.component', [
.module('spinnaker.netflix.fastProperty.pod.component', [
require('angular-ui-router'),
])
.component('fastPropertyPod', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let angular = require('angular');
import _ from 'lodash';

module.exports = angular
.module('spinnaker.netfilx.globalFastProperty.pods.component', [
.module('spinnaker.netflix.globalFastProperty.pods.component', [
require('angular-ui-router'),
])
.component('globalFastPropertyPods', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CreateFastPropertyWizardController {

}

export const CREATE_FAST_PROPERTY_WIZARD_CONTROLLER = 'spinnaker.netfilx.fastProperty.createWizard.controller';
export const CREATE_FAST_PROPERTY_WIZARD_CONTROLLER = 'spinnaker.netflix.fastProperty.createWizard.controller';

module(CREATE_FAST_PROPERTY_WIZARD_CONTROLLER, [
FAST_PROPERTY_DETAILS_COMPONENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ module.exports = angular
contents: `<p>The name of the package you want installed (without any version identifiers).</p>
<p>If your build produces a deb file named "myapp_1.27-h343", you would want to enter "myapp" here.</p>`
},
{
key: 'pipeline.config.isolatedTestingTarget.clusters',
contents: `<p>These clusters will allow you to select a cluster that you want to mimic, and will clone the properties
and override the VIP to provide an isolated testing target.</p>`
},
{
key: 'pipeline.config.isolatedTestingTarget.vips',
contents: `<p>These VIPs will show the value of the VIP of the old cluster that is being copied from and the VIP that will be given to the new cluster.</p>`
},
{
key: 'chaos.documentation',
contents: `<p>Chaos Monkey documentation can be found
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/modules/netflix/netflix.module.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {APPLICATION_DATA_SOURCE_REGISTRY} from 'core/application/service/applicationDataSource.registry';
import {CLOUD_PROVIDER_REGISTRY} from 'core/cloudProvider/cloudProvider.registry';
import {TABLEAU_STATES} from './tableau/tableau.states';
import {ISOLATED_TESTING_TARGET_STAGE_MODULE} from './pipeline/stage/isolatedTestingTarget/isolatedTestingTargetStage.module';


let angular = require('angular');

Expand All @@ -20,6 +22,7 @@ module.exports = angular
require('./instance/aws/netflixAwsInstanceDetails.controller.js'),
require('./instance/titus/netflixTitusInstanceDetails.controller.js'),
require('./pipeline/stage/canary/canaryStage.module.js'),
ISOLATED_TESTING_TARGET_STAGE_MODULE,
require('./pipeline/stage/acaTask/acaTaskStage.module'),
require('./pipeline/stage/properties'),
require('./pipeline/stage/quickPatchAsg/quickPatchAsgStage.module.js'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {module} from 'angular';
import {IModalServiceInstance} from 'angular-ui-bootstrap';

class EditVipModalCtrl {
public cancel: (reason?: any) => void;
public invalid: boolean = false;
public errorMessage: string = null;

constructor(public vip: string, private $uibModalInstance: IModalServiceInstance) {
this.cancel = $uibModalInstance.dismiss;
}

public update(): void {
if (this.vip.length === 0) {
this.invalid = true;
this.errorMessage = 'VIP must have a value';
} else {
this.$uibModalInstance.close(this.vip);
}
}
}

export const EDIT_VIP_MODAL_CONTROLLER = 'spinnaker.netflix.pipeline.stage.isolatedTestingTarget.editVip';

module(EDIT_VIP_MODAL_CONTROLLER, [])
.controller('EditVipModalCtrl', EditVipModalCtrl);

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div modal-page class="flex-fill">
<modal-close dismiss="$dismiss()"></modal-close>
<div class="modal-header">
<h3>Edit VIP</h3>
</div>
<div class="modal-body flex-fill">
<form role="form" name="form" class="form-horizontal flex-fill">
<div class="flex-fill">
<input type="text" class="form-control" ng-model="vm.vip"/>
</div>
</form>
<div class="row">
<div class="form-group row slide-in" ng-if="vm.invalid">
<div class="col-sm-9 col-sm-offset-3 error-message">
Error: {{vm.errorMessage}}
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="vm.cancel()">Cancel</button>
<button class="btn btn-primary"
ng-click="vm.update()">
<span class="glyphicon glyphicon-ok-circle"></span> Update
</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<div class="form-horizontal isolated-testing-target-config-view">
<h4>Isolated Testing Target Config</h4>

<h5>Owner</h5>
<div class="horizontal-rule"></div>
<stage-config-field label="Email">
<input type="email" required ng-model="stage.owner"
class="form-control input-sm" />
</stage-config-field>

<h5>Clusters<help-field key="pipeline.config.isolatedTestingTarget.clusters"></help-field></h5>
<div class="horizontal-rule"></div>
<div class="row">
<div style="margin: 10px 10px 0px 50px;">
<div class="well well-sm">
<table class="table">
<thead>
<tr>
<th>Location</th>
<th>New Cluster</th>
<th>VIPs <help-field key="pipeline.config.isolatedTestingTarget.vips"></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="cluster in stage.clusters">
<td>
<account-tag account="cluster.account"></account-tag>
{{isolatedTestingTargetStageCtrl.getRegion(cluster)}}
</td>
<td>
{{isolatedTestingTargetStageCtrl.getClusterName(cluster)}}
<br/>
<a href ng-click="isolatedTestingTargetStageCtrl.editCluster(cluster, $index)">Edit</a>
</td>
<td>
<strong>Overridden:</strong> {{isolatedTestingTargetStageCtrl.getClusterOldVIPs(cluster)}} <a href ng-click="isolatedTestingTargetStageCtrl.editVip(cluster, 'oldVip')">Edit</a>
<br/>
<strong>New:</strong> {{isolatedTestingTargetStageCtrl.getClusterNewVIPs(cluster)}} <a href ng-click="isolatedTestingTargetStageCtrl.editVip(cluster, 'newVip')">Edit</a>
</td>
<td>
<a href ng-click="isolatedTestingTargetStageCtrl.deleteCluster($index);">
<span class="glyphicon glyphicon-trash" uib-tooltip="Delete Cluster"></span>
</a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4">
<button class="btn btn-block btn-sm add-new" ng-click="isolatedTestingTargetStageCtrl.addCluster()">
<span class="glyphicon glyphicon-plus-sign"></span> Add cluster
</button>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {module} from 'angular';

import {ACCOUNT_SERVICE} from 'core/account/account.service';
import {NAMING_SERVICE} from 'core/naming/naming.service';
import {ISOLATED_TESTING_TARGET_STAGE} from './isolatedTestingTargetStage';

export const ISOLATED_TESTING_TARGET_STAGE_MODULE = 'spinnaker.netflix.pipeline.stage.isolatedTestingTarget';

module(ISOLATED_TESTING_TARGET_STAGE_MODULE, [
ISOLATED_TESTING_TARGET_STAGE,
ACCOUNT_SERVICE,
NAMING_SERVICE,
]);
Loading

0 comments on commit 17d1d68

Please sign in to comment.