Skip to content

Commit

Permalink
Merge pull request #935 from Azure/master
Browse files Browse the repository at this point in the history
Merge master to stable for fix release 0.10.1
  • Loading branch information
timotheeguerin authored Nov 30, 2017
2 parents a35b1ba + 066a691 commit 871508c
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 43 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 0.10.1
[All items](https://github.com/Azure/BatchLabs/milestone/13?closed=1)

### Bug:

* Nodes with start task failed state don't show the files [\#929](https://github.com/Azure/BatchLabs/issues/929)
* OS Family Not Reported on Pool Correctly [\#927](https://github.com/Azure/BatchLabs/issues/927)
* Error reading job prep-task [\#926](https://github.com/Azure/BatchLabs/issues/926)


# 0.10.0
[All items](https://github.com/Azure/BatchLabs/milestone/11?closed=1)

Expand Down
2 changes: 1 addition & 1 deletion app/components/file/browse/node-file-browse.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FileLoader, FileNavigator } from "app/services/file";
import "./node-file-browse.scss";

const availableStates = new Set([
NodeState.idle, NodeState.running, NodeState.waitingForStartTask,
NodeState.idle, NodeState.running, NodeState.waitingForStartTask, NodeState.startTaskFailed,
]);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
import { Component, Input } from "@angular/core";
import { JobHookTask } from "app/models";
import { Component, Input, OnInit } from "@angular/core";

import { FileExplorerConfig } from "app/components/file/browse/file-explorer";
import { JobHookTask, Node } from "app/models";
import { NodeParams, NodeService } from "app/services";
import { EntityView } from "app/services/core";
import "./job-hook-task-details.scss";

@Component({
selector: "bl-job-hook-task-details",
templateUrl: "job-hook-task-details.html",
})
export class JobHookTaskDetailsComponent {
export class JobHookTaskDetailsComponent implements OnInit {
@Input() public task: JobHookTask;

@Input() public type: string = "preparationTask";
public node: Node;
public loading = true;

public fileExplorerConfig: FileExplorerConfig = {
showTreeView: false,
};

private _nodeData: EntityView<Node, NodeParams>;

constructor(nodeService: NodeService) {
this._nodeData = nodeService.view();
this._nodeData.item.subscribe((node) => {
this.node = node;
});
}

public ngOnInit() {
this._nodeData.fetch().subscribe({
next: () => {
this.loading = false;
},
error: () => {
this.loading = false;
},
});
}

public get currentFolder() {
const info = this.task[this.type];
return info && info.taskRootDirectory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<div *ngIf="task">
<div class="info">
<span>Node: <a [routerLink]="['/pools', task.poolId, 'nodes', task.nodeId]">{{task.nodeId}}</a></span>
<span>Node:
<a [routerLink]="['/pools', task.poolId, 'nodes', task.nodeId]">{{task.nodeId}}</a>
</span>
</div>
<bl-node-file-browse [poolId]="task.poolId" [nodeId]="task.nodeId" [fileExplorerConfig]="fileExplorerConfig" [folder]="currentFolder"
*ngIf="currentFolder">
<bl-node-file-browse [poolId]="task.poolId" [nodeId]="task.nodeId" [node]="node" [fileExplorerConfig]="fileExplorerConfig"
[folder]="currentFolder" *ngIf="node && currentFolder">
</bl-node-file-browse>

<div *ngIf="!node && !loading" class="info-overlay node-unavailable">
Node where this task ran doesn't exists anymore.
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
bl-job-hook-task-details {
display: block;
position: relative;
height: 100%;
.info {
padding: 0 10px;
}
Expand Down
30 changes: 18 additions & 12 deletions app/models/cloud-service-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import { Record } from "immutable";

// tslint:disable:variable-name object-literal-sort-keys
const CloudServiceConfigurationRecord = Record({
osFamily: null,
targetOSVersion: null,
currentOSVersion: null,
});
import { Model, Prop, Record } from "app/core";

export interface CloudServiceConfigurationAttributes {
osFamily: CloudServiceOsFamily;
targetOSVersion: string;
currentOSVersion: string;
}
/**
* Class for displaying Batch CloudServiceConfiguration information.
*/
export class CloudServiceConfiguration extends CloudServiceConfigurationRecord {
public osFamily: number;
public targetOSVersion: string;
public currentOSVersion: string;
@Model()
export class CloudServiceConfiguration extends Record<CloudServiceConfigurationAttributes> {
@Prop() public osFamily: CloudServiceOsFamily;
@Prop() public targetOSVersion: string;
@Prop() public currentOSVersion: string;
}

export enum CloudServiceOsFamily {
windowsServer2008R2 = "2",
windowsServer2012 = "3",
windowsServer2012R2 = "4",
windowsServer2016 = "5",
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CloudServiceConfiguration } from "app/models";
import { CloudServiceConfiguration, CloudServiceOsFamily } from "app/models";
import { DecoratorBase } from "app/utils/decorators";

export class CloudServiceConfigurationDecorator extends DecoratorBase<CloudServiceConfiguration> {
Expand All @@ -14,7 +14,7 @@ export class CloudServiceConfigurationDecorator extends DecoratorBase<CloudServi
this.currentOSVersion = this.stringField(cloudServiceConfiguration.currentOSVersion);
}

private _translateOSFamily(osName: string, osFamilyId: number): string {
private _translateOSFamily(osName: string, osFamilyId: CloudServiceOsFamily): string {
return `${osName}, (ID: ${osFamilyId})`;
}
}
9 changes: 4 additions & 5 deletions app/utils/pool-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Icon, IconSources } from "app/components/base/icon";
import { Pool, PoolAllocationState, SpecCost } from "app/models";
import { CloudServiceOsFamily, Pool, PoolAllocationState, SpecCost } from "app/models";
import { LowPriDiscount } from "app/utils/constants";
import * as Icons from "./icons";

Expand Down Expand Up @@ -113,12 +113,11 @@ export class PoolUtils {
public static getOsName(pool: Pool): string {
if (pool.cloudServiceConfiguration) {
let osFamily = pool.cloudServiceConfiguration.osFamily;

if (osFamily === 2) {
if (osFamily === CloudServiceOsFamily.windowsServer2008R2) {
return "Windows Server 2008 R2 SP1";
} else if (osFamily === 3) {
} else if (osFamily === CloudServiceOsFamily.windowsServer2012) {
return "Windows Server 2012";
} else if (osFamily === 4) {
} else if (osFamily === CloudServiceOsFamily.windowsServer2012R2) {
return "Windows Server 2012 R2";
} else {
return "Windows Server 2016";
Expand Down
Binary file added docs/images/merge-commit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 15 additions & 6 deletions docs/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@ Running the following command will update any required third party notices.
npm run ts scripts/lca/generate-third-party
```

You might see an error like:
**Important:** Make sure you have an environment variable called GH_TOKEN set that contains a valid GitHub API auth token.
You can manage and setup personal access tokens here: [https://github.com/settings/tokens](https://github.com/settings/tokens)

If you see an error like the following while executing the 'generate-third-party' script:
```
const value = match[1];
^
TypeError: Cannot read property '1' of null
```

This probably means that a dependancy in package.json has a differnt format to what we are expecting.
You will need to modify '\scripts\lca\generate-third-party.ts' in order to get it to work.

#### Double check the prod build is working

Expand All @@ -80,13 +84,18 @@ Now create a pull request against stable. Wait for the CI to pass.

**Important:** DO NOT squash merge the changes.(Go in BatchLabs [settings](https://github.com/Azure/BatchLabs/settings) and renenable "Allow merge commits")
Then click on merge commit(Make sure it is not squash merge)

![](images/merge-commit.png)

All the commits in master should now be in stable with the merge commit.
Now disable the "Allow merge commit" again to prevent mistake when merging to master.

## Step 5: Publish the release
* Wait for the CI to test and build stable branch [Travis](https://travis-ci.org/Azure/BatchLabs/branches)
* Wait for the CI to test and build stable branch [Travis](https://travis-ci.org/Azure/BatchLabs/branches).
* Go to github [release](https://github.com/Azure/BatchLabs/releases).
* You should see a new draft release with the new version
* Double check every platform executable and installer is present(exe, app, zip, dmg, deb, rpm)
* Copy the changelog(only for the version) in the description
* Click publish release(Mark as pre-release for now)
* You should see a new draft release with the new version.
* Double check every platform executable and installer is present (exe, app, zip, dmg, deb, rpm).
* Download and install one of the versions to make sure it runs and validate that the Python server is correctly running by creating an empty file-group or kicking off an NCJ job.
* Copy the changelog(only for the version) in the description in MD format.
* Change the "Target: master" to "Target: stable" if applicable by the "create a new tag on publish".
* Click publish release (Mark as pre-release for now).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "Microsoft Corporation",
"email": "[email protected]"
},
"version": "0.10.0",
"version": "0.10.1",
"main": "build/client/main.prod.js",
"scripts": {
"ts": "ts-node --project tsconfig.node.json",
Expand Down
18 changes: 9 additions & 9 deletions test/app/utils/pool-utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Pool, SpecCost } from "app/models";
import { CloudServiceOsFamily, Pool, SpecCost } from "app/models";
import { PoolUtils } from "app/utils";

describe("PoolUtils", () => {
Expand All @@ -7,28 +7,28 @@ describe("PoolUtils", () => {
const cs2Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 2,
osFamily: CloudServiceOsFamily.windowsServer2008R2,
},
});

const cs3Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 3,
osFamily: CloudServiceOsFamily.windowsServer2012,
},
});

const cs4Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 4,
osFamily: CloudServiceOsFamily.windowsServer2012R2,
},
});

const cs5Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 5,
osFamily: CloudServiceOsFamily.windowsServer2016,
},
});

Expand Down Expand Up @@ -70,28 +70,28 @@ describe("PoolUtils", () => {
const cs2Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 2,
osFamily: CloudServiceOsFamily.windowsServer2008R2,
},
});

const cs3Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 3,
osFamily: CloudServiceOsFamily.windowsServer2012,
},
});

const cs4Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 4,
osFamily: CloudServiceOsFamily.windowsServer2012R2,
},
});

const cs5Pool = new Pool({
cloudServiceConfiguration: {
currentOSVersion: "*",
osFamily: 5,
osFamily: CloudServiceOsFamily.windowsServer2016,
},
});

Expand Down

0 comments on commit 871508c

Please sign in to comment.