Skip to content

Commit 0c6178e

Browse files
authored
Add testTargetId (#23)
* Add testTargetId
1 parent 24a38c9 commit 0c6178e

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ To use this task a token is required. Don't have one? We're here to help.
1616
inputs:
1717
url:
1818
token: ${{ secrets.AUTOMAGICALLY_TOKEN }}
19+
testTargetId: <your testTargetId that you also get from us>
1920
```
2021
22+
## Change Log
23+
24+
- 2023-07-23: Added requirement for setting `testTargetId` to enable v2 API
25+
2126
## Publishing notes
2227

2328
There is currently no way to publish without a personal access token. It currently is relying

automagicallyexecute/index.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import fetch from 'node-fetch'
1313
const urlDefault = 'https://app.octomind.dev/'
1414
const urlOverride = getInput('automagicallyUrl', false) ?? ''
1515
const automagicallyUrl = urlOverride.length === 0 ? urlDefault : urlOverride
16-
const executeUrl = `${automagicallyUrl}/api/v1/execute`
16+
const executeUrl = `${automagicallyUrl}/api/v2/execute`
1717

1818
const run = async (): Promise<void> => {
1919
try {
@@ -29,6 +29,12 @@ const run = async (): Promise<void> => {
2929
return
3030
}
3131

32+
const testTargetId = getInputRequired('testTargetId')
33+
if (!testTargetId) {
34+
setResult(TaskResult.Failed, 'testTargetId is required')
35+
return
36+
}
37+
3238
// https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables
3339
const collectionUri = getVariable('System.TeamFoundationCollectionUri')
3440

@@ -67,6 +73,7 @@ const run = async (): Promise<void> => {
6773
body: JSON.stringify({
6874
token,
6975
url,
76+
testTargetId,
7077
context: {
7178
source: 'azureDevOps',
7279
accessToken,

automagicallyexecute/task.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"category": "Utility",
88
"author": "OctoMind GmbH",
99
"version": {
10-
"Major": 1,
11-
"Minor": 2,
10+
"Major": 2,
11+
"Minor": 0,
1212
"Patch": 0
1313
},
1414
"instanceNameFormat": "Execute Automagically",
@@ -26,6 +26,13 @@
2626
"label": "Deployment URL",
2727
"required": true,
2828
"helpMarkDown": "URL to your publicly accessible deployment that will be tested"
29+
},
30+
{
31+
"name": "testTargetId",
32+
"type": "string",
33+
"label": "Test Target ID",
34+
"required": true,
35+
"helpMarkDown": "ID for your test target, recevied from us"
2936
}
3037
],
3138
"execution": {

overview.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ To use this task a token is required. Don't have one? We're here to help.
1616
inputs:
1717
url: https://public.url
1818
token: ${{ secrets.AUTOMAGICALLY_TOKEN }}
19+
testTargetId: <your testTargetId that you also get from us>
1920
```

vss-extension.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "automagically-execute-task",
44
"name": "octomind automagically execute",
5-
"version": "1.2.0",
5+
"version": "2.0.0",
66
"publisher": "octomind",
77
"targets": [
88
{
@@ -14,7 +14,9 @@
1414
"path": "overview.md"
1515
}
1616
},
17-
"galleryFlags": [ "Preview" ],
17+
"galleryFlags": [
18+
"Preview"
19+
],
1820
"public": true,
1921
"description": "Tools for interacting with octomind. Includes one execute task.",
2022
"categories": [
@@ -25,7 +27,7 @@
2527
},
2628
"scopes": [
2729
"vso.threads_full"
28-
],
30+
],
2931
"files": [
3032
{
3133
"path": "automagicallyexecute"

0 commit comments

Comments
 (0)