Skip to content

Commit 3936051

Browse files
Merge pull request #141 from snyk/docs/contributing
docs: update CONTRIBUTING.md with development info
2 parents 9be8f3e + 51c15ad commit 3936051

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

.github/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Contributing
22

3+
## Development
4+
### Setup
5+
Run `npm run build` in the root folder. All tooling prerequisites (Node.js, TypeScript etc.) can be seen [here](https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops#prerequisites) and should be installed.
6+
7+
### Test and Run
8+
Unit tests can be run via `npm run test:unit` command.
9+
10+
To run the code, a GitHub PR against `develop` should be raised with the committed code to the branch PR. The PR runs deployment script with deploy to development environment. The script builds the code that's added as part of your change and installs it in Azure DevOps organization as an extension that can be added to run a pipeline.
11+
12+
## Release
13+
The release process is fully-automated: all you need to do is create a PR to merge `develop` into `master` and call the PR `Merge develop into master for release`.
14+
315
## Contributor Agreement
416
A pull-request will only be considered for merging into the upstream codebase after you have signed our [contributor agreement](https://github.com/snyk/snyk-azure-pipelines-task/blob/master/Contributor-Agreement.md), assigning us the rights to the contributed code and granting you a license to use it in return. If you submit a pull request, you will be prompted to review and sign the agreement with one click (we use [CLA assistant](https://cla-assistant.io/)).
517

ops/deploy/install-extension-to-dev-org.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,22 @@ async function main() {
3232
publisherName,
3333
extensionName,
3434
);
35-
const alreadyInstalledVersion = alreadyInstalledExtensionInfo.version;
36-
console.log(
37-
`Extension version currently installed: ${alreadyInstalledVersion}`,
38-
);
3935

40-
console.log(`Uninstalling previously installed extension`);
41-
await uninstallExtension(webApi, publisherName, extensionName);
36+
if (alreadyInstalledExtensionInfo) {
37+
const alreadyInstalledVersion = alreadyInstalledExtensionInfo.version;
38+
console.log(
39+
`Extension version currently installed: ${alreadyInstalledVersion}`,
40+
);
41+
42+
console.log(`Uninstalling previously installed extension`);
43+
await uninstallExtension(webApi, publisherName, extensionName);
44+
}
4245

4346
console.log(
4447
'Attempting to install latest version of extension into org...',
4548
);
4649
// installExtension will throw an error if it is already installed
47-
const installRes = await installExtension(
48-
webApi,
49-
publisherName,
50-
extensionName,
51-
version,
52-
);
50+
await installExtension(webApi, publisherName, extensionName, version);
5351

5452
const afterInstallExtensionInfo = await getInstalledExtensionInfo(
5553
webApi,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"author": "snyk.io",
4949
"license": "Apache-2.0",
5050
"dependencies": {
51-
"azure-pipelines-task-lib": "2.9.3",
51+
"azure-pipelines-task-lib": "3.1.0",
5252
"jquery": "^3.4.1",
5353
"vss-web-extension-sdk": "^5.141.0"
5454
},

vss-extension-dev.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "snyk-security-scan-dev",
44
"name": "Snyk Security Scan (Dev)",
55
"version": "0.2.2",
6-
"publisher": "agranado-snyk-pub",
6+
"publisher": "snyk-dev",
77
"targets": [
88
{
99
"id": "Microsoft.VisualStudio.Services"

0 commit comments

Comments
 (0)