Skip to content

Commit f9ae783

Browse files
authored
Merge pull request #125 from snyk/develop
Merge develop into master for release
2 parents 11ee34f + 8c1e32f commit f9ae783

File tree

6 files changed

+319
-97
lines changed

6 files changed

+319
-97
lines changed

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@ This extension requires that Node.js and npm be installed on the build agent. Th
1919

2020
## Task Parameters
2121

22-
| Parameter | Description | Required | Default | Type |
23-
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ------------- | --------------------------------------------------------------------------------- |
24-
| serviceConnectionEndpoint | The Azure DevOps service connection endpoint where your Snyk API token is defined. Define this within your Azure DevOps project settings / S | no | none | String / Azure Service Connection Endpoint of type SnykAuth / Snyk Authentication |
25-
| testType | Used by the task UI only | no | "application" | string: "app" or "container" |
26-
| dockerImageName | The name of the container image to test. | yes, if container image test | none | string |
27-
| dockerfilePath | The path to the Dockerfile corresponding to the `dockerImageName` | yes, if container image test | none | string |
28-
| targetFile | Applicable to application type tests ony. The path to the manifest file to be used by Snyk. Should only be provided if non-standard. | no | none | string |
29-
| severityThreshold | The severity-threshold to use when testing. By default, issues of all severity types will be found. | no | "low" | string: "low" or "medium" or "high" or "critical" |
30-
| monitorOnBuild | Whether or not to capture the dependencies of the application / container image and monitor them within Snyk. | yes | true | boolean |
31-
| failOnIssues | This specifies if builds should be failed or continued based on issues found by Snyk. | yes | true | boolean |
32-
| projectName | A custom name for the Snyk project to be created on snyk.io | no | none | string |
33-
| organization | Name of the Snyk organisation name, under which this project should be tested and monitored | no | none | string |
34-
| testDirectory | Alternate working directory. For example, if you want to test a manifest file in a directory other than the root of your repo, you would put in relative path to that directory. | no | none | string |
35-
| ignoreUnknownCA | Use to ignore unknown or self-signed certificates. This might be useful in for self-hosted build agents with unusual network configurations or for Snyk on-prem installs configured with a self-signed certificate. | no | false | boolean |
36-
| additionalArguments | Additional Snyk CLI arguments to be passed in. Refer to the Snyk CLI help page for information on additional arguments. | no | none | string |
22+
| Parameter | Description | Required | Default | Type |
23+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | --------------- | --------------------------------------------------------------------------------- |
24+
| serviceConnectionEndpoint | The Azure DevOps service connection endpoint where your Snyk API token is defined. Define this within your Azure DevOps project settings / S | no | none | String / Azure Service Connection Endpoint of type SnykAuth / Snyk Authentication |
25+
| testType | Used by the task UI only | no | "application" | string: "app" or "container" |
26+
| dockerImageName | The name of the container image to test. | yes, if container image test | none | string |
27+
| dockerfilePath | The path to the Dockerfile corresponding to the `dockerImageName` | yes, if container image test | none | string |
28+
| targetFile | Applicable to application type tests ony. The path to the manifest file to be used by Snyk. Should only be provided if non-standard. | no | none | string |
29+
| severityThreshold | The severity-threshold to use when testing. By default, issues of all severity types will be found. | no | "low" | string: "low" or "medium" or "high" or "critical" |
30+
| monitorOnBuild | Whether or not to capture the dependencies of the application / container image and monitor them within Snyk. | yes | true | boolean |
31+
| monitorWhen | When to run `snyk monitor`. Valid options are `never`, `noIssuesFound` (default), and `always`. If set, this option overrides the value of `monitorOnBuild`. | no | 'noIssuesFound' | boolean |
32+
| failOnIssues | This specifies if builds should be failed or continued based on issues found by Snyk. | yes | true | boolean |
33+
| projectName | A custom name for the Snyk project to be created on snyk.io | no | none | string |
34+
| organization | Name of the Snyk organisation name, under which this project should be tested and monitored | no | none | string |
35+
| testDirectory | Alternate working directory. For example, if you want to test a manifest file in a directory other than the root of your repo, you would put in relative path to that directory. | no | none | string |
36+
| ignoreUnknownCA | Use to ignore unknown or self-signed certificates. This might be useful in for self-hosted build agents with unusual network configurations or for Snyk on-prem installs configured with a self-signed certificate. | no | false | boolean |
37+
| additionalArguments | Additional Snyk CLI arguments to be passed in. Refer to the Snyk CLI help page for information on additional arguments. | no | none | string |
3738

3839
## Usage Examples
3940

snykTask/src/__tests__/task-lib.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ afterAll(() => {
3333
});
3434

3535
test('getOptionsToExecuteSnyk builds IExecOptions like we need it', () => {
36-
const taskArgs: TaskArgs = new TaskArgs();
36+
const taskArgs: TaskArgs = new TaskArgs({
37+
monitorOnBuild: true,
38+
failOnIssues: true,
39+
});
3740
taskArgs.testDirectory = '/some/path';
3841

3942
const options: tr.IExecOptions = getOptionsToExecuteCmd(taskArgs);
@@ -47,7 +50,10 @@ test('getOptionsToExecuteSnykCLICommand builds IExecOptions like we need it', ()
4750
const taskNameForAnalytics = 'AZURE_PIPELINES';
4851
const version = '1.2.3';
4952

50-
const taskArgs: TaskArgs = new TaskArgs();
53+
const taskArgs: TaskArgs = new TaskArgs({
54+
monitorOnBuild: true,
55+
failOnIssues: true,
56+
});
5157
taskArgs.testDirectory = '/some/path';
5258

5359
const options: tr.IExecOptions = getOptionsToExecuteSnykCLICommand(
@@ -67,7 +73,10 @@ test('getOptionsToExecuteSnykCLICommand builds IExecOptions like we need it', ()
6773

6874
describe('getOptionsForSnykToHtml', () => {
6975
it('builds IExecOptions for running snyk-to-html', async () => {
70-
const taskArgs: TaskArgs = new TaskArgs();
76+
const taskArgs: TaskArgs = new TaskArgs({
77+
monitorOnBuild: true,
78+
failOnIssues: true,
79+
});
7180
taskArgs.testDirectory = '/some/path';
7281
const htmlReportFilePath = path.resolve(tempFolder, 'report.html');
7382
const options: tr.IExecOptions = getOptionsForSnykToHtml(

snykTask/src/__tests__/test-task-args.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)