Skip to content

Commit

Permalink
Bump dependencies versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gregaubert committed Apr 26, 2018
1 parent 282d679 commit f04d7ec
Show file tree
Hide file tree
Showing 13 changed files with 2,931 additions and 2,140 deletions.
2 changes: 1 addition & 1 deletion common/ts/helpers/__tests__/utils-test.ts
@@ -1,4 +1,4 @@
import { isWindows, setIfNotEmpty, toCleanJSON } from '../utils';
import { setIfNotEmpty, toCleanJSON } from '../utils';

describe('toCleanJSON', () => {
it('should jsonify', () => {
Expand Down
4 changes: 2 additions & 2 deletions common/ts/helpers/utils.ts
Expand Up @@ -12,11 +12,11 @@ export const PROP_NAMES = {
PROJECTSETTINGS: 'project.settings'
};

export function toCleanJSON(props: { [key: string]: string }) {
export function toCleanJSON(props: { [key: string]: string | undefined }) {
return JSON.stringify(props, Object.keys(props).filter(key => props[key] != null));
}

export function setIfNotEmpty(props: { [key: string]: string }, key: string, value: string) {
export function setIfNotEmpty(props: { [key: string]: string }, key: string, value?: string) {
if (value) {
props[key] = value;
}
Expand Down
127 changes: 67 additions & 60 deletions common/ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions common/ts/package.json
Expand Up @@ -6,8 +6,8 @@
"license": "LGPL-3.0",
"dependencies": {
"fs-extra": "5.0.0",
"request": "2.83.0",
"vsts-task-lib": "2.3.0",
"request": "2.85.0",
"vsts-task-lib": "2.4.0",
"vso-node-api": "6.3.2"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions common/ts/prepare-task.ts
Expand Up @@ -13,7 +13,7 @@ export default async function prepareTask(endpoint: Endpoint, rootPath: string)
const props: { [key: string]: string } = {};

if (endpoint.type === EndpointType.SonarCloud) {
await populateBranchAndPrProps(endpoint, props);
await populateBranchAndPrProps(props);
tl.debug(`[SQ] Branch and PR parameters: ${JSON.stringify(props)}`);
}

Expand All @@ -37,7 +37,7 @@ export default async function prepareTask(endpoint: Endpoint, rootPath: string)
await scanner.runPrepare();
}

async function populateBranchAndPrProps(endpoint: Endpoint, props: { [key: string]: string }) {
async function populateBranchAndPrProps(props: { [key: string]: string }) {
const collectionUrl = tl.getVariable('System.TeamFoundationCollectionUri');
const prId = tl.getVariable('System.PullRequest.PullRequestId');
const provider = tl.getVariable('Build.Repository.Provider');
Expand Down Expand Up @@ -86,7 +86,7 @@ async function getDefaultBranch(provider: string, collectionUrl: string) {
return DEFAULT;
}
try {
const vsts: vm.WebApi = getWebApi(collectionUrl);
const vsts = getWebApi(collectionUrl);
const gitApi = await vsts.getGitApi();
const repo = await gitApi.getRepository(
tl.getVariable(REPO_NAME_VAR),
Expand Down
6 changes: 5 additions & 1 deletion common/ts/sonarqube/Analysis.ts
Expand Up @@ -77,7 +77,11 @@ export default class Analysis {
}

const rows = failedConditions.map(condition => {
const metric = this.metrics.getMetricByKey(condition.metricKey);
const metric = this.metrics && this.metrics.getMetricByKey(condition.metricKey);
if (!metric) {
return null;
}

const threshold =
condition.status === 'WARN' ? condition.warningThreshold : condition.errorThreshold;
return `<tr>
Expand Down

0 comments on commit f04d7ec

Please sign in to comment.