@itentialopensource/adapter-azure_devops 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/adapter.js +118 -0
- package/entities/Commits/action.json +21 -0
- package/entities/Commits/schema.json +255 -1
- package/package.json +1 -1
- package/pronghorn.json +294 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +6 -6
- package/test/integration/adapterTestIntegration.js +25 -0
- package/test/unit/adapterTestUnit.js +63 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.1.5 [11-22-2022]
|
|
3
|
+
|
|
4
|
+
* Implement API request Commits – Get Commits
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/devops-netops/adapter-azure_devops!5
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
2
10
|
## 0.1.4 [11-22-2022]
|
|
3
11
|
|
|
4
12
|
* Query parameter across all apis showing as “apiVersion” instead of api-version
|
package/adapter.js
CHANGED
|
@@ -5003,6 +5003,124 @@ class AzureDevops extends AdapterBaseCl {
|
|
|
5003
5003
|
}
|
|
5004
5004
|
}
|
|
5005
5005
|
|
|
5006
|
+
/**
|
|
5007
|
+
* @function commitsGetCommits
|
|
5008
|
+
* @pronghornType method
|
|
5009
|
+
* @name commitsGetCommits
|
|
5010
|
+
* @summary Retrieve git commits for a project.
|
|
5011
|
+
*
|
|
5012
|
+
* @param {string} organization - The name of the Azure DevOps organization.
|
|
5013
|
+
* @param {string} repositoryId - The id or friendly name of the repository. To use the friendly name, projectId must also be specified.
|
|
5014
|
+
* @param {string} project - Project ID or project name
|
|
5015
|
+
* @param {number} [skip] - Number of entries to skip.
|
|
5016
|
+
* @param {number} [top] - Maximum number of entries to retrieve.
|
|
5017
|
+
* @param {string} searchCriteriaAuthor - Alias or display name of the author
|
|
5018
|
+
* @param {string} searchCriteriaCompareVersionVersion - Version string identifier (name of tag/branch, SHA1 of commit)
|
|
5019
|
+
* @param {string} searchCriteriaCompareVersionVersionOptions - Version options - Specify additional modifiers to version (e.g Previous)
|
|
5020
|
+
* @param {string} searchCriteriaCompareVersionVersionType - Version type (branch, tag, or commit). Determines how Id is interpreted
|
|
5021
|
+
* @param {boolean} searchCriteriaExcludeDeletes - This determines whether to exclude delete entries of the specified path.
|
|
5022
|
+
* @param {string} searchCriteriaFromCommitId - If provided, a lower bound for filtering commits alphabetically
|
|
5023
|
+
* @param {string} searchCriteriaFromDate - If provided, only include history entries created after this date
|
|
5024
|
+
* @param {string} searchCriteriaHistoryMode - What Git history mode should be used.
|
|
5025
|
+
* @param {array} searchCriteriaIds - If provided, specifies the exact commit ids of the commits to fetch
|
|
5026
|
+
* @param {boolean} searchCriteriaIncludeLinks - Whether to include the _links field on the shallow references
|
|
5027
|
+
* @param {boolean} searchCriteriaIncludePushData - Whether to include the push information
|
|
5028
|
+
* @param {boolean} searchCriteriaIncludeUserImageUrl - Whether to include the image Url for committers and authors
|
|
5029
|
+
* @param {boolean} searchCriteriaIncludeWorkItems - Whether to include linked work items
|
|
5030
|
+
* @param {string} searchCriteriaItemPath - Path of item to search under
|
|
5031
|
+
* @param {string} searchCriteriaItemVersionVersion - Version string identifier (name of tag/branch, SHA1 of commit)
|
|
5032
|
+
* @param {string} searchCriteriaItemVersionVersionOptions - Version options - Specify additional modifiers to version (e.g Previous)
|
|
5033
|
+
* @param {string} searchCriteriaItemVersionVersionType - Version type (branch, tag, or commit). Determines how Id is interpreted
|
|
5034
|
+
* @param {boolean} searchCriteriaShowOldestCommitsFirst - If enabled, this option will ignore the itemVersion and compareVersion parameters
|
|
5035
|
+
* @param {string} searchCriteriaToCommitId - If provided, an upper bound for filtering commits alphabetically
|
|
5036
|
+
* @param {string} searchCriteriaToDate - If provided, only include history entries created before this date (string)
|
|
5037
|
+
* @param {string} searchCriteriaUser - Alias or display name of the committer
|
|
5038
|
+
* @param {string} apiVersion - Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.
|
|
5039
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
5040
|
+
* @return {object} results - An object containing the response of the action
|
|
5041
|
+
*
|
|
5042
|
+
* @route {GET} /commitsGetCommits
|
|
5043
|
+
* @roles admin
|
|
5044
|
+
* @task true
|
|
5045
|
+
*/
|
|
5046
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
5047
|
+
commitsGetCommits(organization, repositoryId, project, skip, top, searchCriteriaAuthor, searchCriteriaCompareVersionVersion, searchCriteriaCompareVersionVersionOptions, searchCriteriaCompareVersionVersionType, searchCriteriaExcludeDeletes, searchCriteriaFromCommitId, searchCriteriaFromDate, searchCriteriaHistoryMode, searchCriteriaIds, searchCriteriaIncludeLinks, searchCriteriaIncludePushData, searchCriteriaIncludeUserImageUrl, searchCriteriaIncludeWorkItems, searchCriteriaItemPath, searchCriteriaItemVersionVersion, searchCriteriaItemVersionVersionOptions, searchCriteriaItemVersionVersionType, searchCriteriaShowOldestCommitsFirst, searchCriteriaToCommitId, searchCriteriaToDate, searchCriteriaUser, apiVersion, callback) {
|
|
5048
|
+
const meth = 'adapter-commitsGetCommits';
|
|
5049
|
+
const origin = `${this.id}-${meth}`;
|
|
5050
|
+
log.trace(origin);
|
|
5051
|
+
|
|
5052
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
5053
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
5054
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5055
|
+
return callback(null, errorObj);
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5058
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
5059
|
+
if (organization === undefined || organization === null || organization === '') {
|
|
5060
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['organization'], null, null, null);
|
|
5061
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5062
|
+
return callback(null, errorObj);
|
|
5063
|
+
}
|
|
5064
|
+
if (repositoryId === undefined || repositoryId === null || repositoryId === '') {
|
|
5065
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['repositoryId'], null, null, null);
|
|
5066
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5067
|
+
return callback(null, errorObj);
|
|
5068
|
+
}
|
|
5069
|
+
if (apiVersion === undefined || apiVersion === null || apiVersion === '') {
|
|
5070
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['apiVersion'], null, null, null);
|
|
5071
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5072
|
+
return callback(null, errorObj);
|
|
5073
|
+
}
|
|
5074
|
+
|
|
5075
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
5076
|
+
const queryParamsAvailable = { skip, top, searchCriteriaAuthor, searchCriteriaCompareVersionVersion, searchCriteriaCompareVersionVersionOptions, searchCriteriaCompareVersionVersionType, searchCriteriaExcludeDeletes, searchCriteriaFromCommitId, searchCriteriaFromDate, searchCriteriaHistoryMode, searchCriteriaIds, searchCriteriaIncludeLinks, searchCriteriaIncludePushData, searchCriteriaIncludeUserImageUrl, searchCriteriaIncludeWorkItems, searchCriteriaItemPath, searchCriteriaItemVersionVersion, searchCriteriaItemVersionVersionOptions, searchCriteriaItemVersionVersionType, searchCriteriaShowOldestCommitsFirst, searchCriteriaToCommitId, searchCriteriaToDate, searchCriteriaUser, apiVersion };
|
|
5077
|
+
const queryParams = {};
|
|
5078
|
+
const pathVars = [organization, project, repositoryId];
|
|
5079
|
+
const bodyVars = {};
|
|
5080
|
+
|
|
5081
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
5082
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
5083
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
5084
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
5085
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
5086
|
+
}
|
|
5087
|
+
});
|
|
5088
|
+
|
|
5089
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
5090
|
+
// see adapter code documentation for more information on the request object's fields
|
|
5091
|
+
const reqObj = {
|
|
5092
|
+
payload: bodyVars,
|
|
5093
|
+
uriPathVars: pathVars,
|
|
5094
|
+
uriQuery: queryParams
|
|
5095
|
+
};
|
|
5096
|
+
|
|
5097
|
+
try {
|
|
5098
|
+
// Make the call -
|
|
5099
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
5100
|
+
return this.requestHandlerInst.identifyRequest('Commits', 'commitsGetCommits', reqObj, true, (irReturnData, irReturnError) => {
|
|
5101
|
+
// if we received an error or their is no response on the results
|
|
5102
|
+
// return an error
|
|
5103
|
+
if (irReturnError) {
|
|
5104
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
5105
|
+
return callback(null, irReturnError);
|
|
5106
|
+
}
|
|
5107
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
5108
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['commitsGetCommits'], null, null, null);
|
|
5109
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5110
|
+
return callback(null, errorObj);
|
|
5111
|
+
}
|
|
5112
|
+
|
|
5113
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
5114
|
+
// return the response
|
|
5115
|
+
return callback(irReturnData, null);
|
|
5116
|
+
});
|
|
5117
|
+
} catch (ex) {
|
|
5118
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
5119
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
5120
|
+
return callback(null, errorObj);
|
|
5121
|
+
}
|
|
5122
|
+
}
|
|
5123
|
+
|
|
5006
5124
|
/**
|
|
5007
5125
|
* @function commitsGetCommitsBatch
|
|
5008
5126
|
* @pronghornType method
|
|
@@ -63,6 +63,27 @@
|
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
"name": "commitsGetCommits",
|
|
68
|
+
"protocol": "REST",
|
|
69
|
+
"method": "GET",
|
|
70
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/_apis/git/repositories/{pathv3}/commits?{query}",
|
|
71
|
+
"requestSchema": "schema.json",
|
|
72
|
+
"responseSchema": "schema.json",
|
|
73
|
+
"timeout": 0,
|
|
74
|
+
"sendEmpty": false,
|
|
75
|
+
"sendGetBody": false,
|
|
76
|
+
"requestDatatype": "JSON",
|
|
77
|
+
"responseDatatype": "JSON",
|
|
78
|
+
"headers": {},
|
|
79
|
+
"responseObjects": [
|
|
80
|
+
{
|
|
81
|
+
"type": "default",
|
|
82
|
+
"key": "",
|
|
83
|
+
"mockFile": ""
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
66
87
|
{
|
|
67
88
|
"name": "commitsGetCommitsBatch",
|
|
68
89
|
"protocol": "REST",
|
|
@@ -8,15 +8,269 @@
|
|
|
8
8
|
"ph_request_type": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"description": "type of request (internal to adapter)",
|
|
11
|
-
"default": "
|
|
11
|
+
"default": "commitsGetCommits",
|
|
12
12
|
"enum": [
|
|
13
13
|
"commitsGetPushCommits",
|
|
14
14
|
"commitsGet",
|
|
15
15
|
"commitsGetChanges",
|
|
16
|
+
"commitsGetCommits",
|
|
16
17
|
"commitsGetCommitsBatch"
|
|
17
18
|
],
|
|
18
19
|
"external_name": "ph_request_type"
|
|
19
20
|
},
|
|
21
|
+
"skip": {
|
|
22
|
+
"type": "number",
|
|
23
|
+
"description": "Number of entries to skip",
|
|
24
|
+
"parse": false,
|
|
25
|
+
"encode": false,
|
|
26
|
+
"encrypt": {
|
|
27
|
+
"type": "AES",
|
|
28
|
+
"key": ""
|
|
29
|
+
},
|
|
30
|
+
"external_name": "$skip"
|
|
31
|
+
},
|
|
32
|
+
"top": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"description": "Maximum number of entries to retrieve",
|
|
35
|
+
"parse": false,
|
|
36
|
+
"encode": false,
|
|
37
|
+
"encrypt": {
|
|
38
|
+
"type": "AES",
|
|
39
|
+
"key": ""
|
|
40
|
+
},
|
|
41
|
+
"external_name": "$top"
|
|
42
|
+
},
|
|
43
|
+
"searchCriteriaAuthor": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Alias or display name of the author",
|
|
46
|
+
"parse": false,
|
|
47
|
+
"encode": false,
|
|
48
|
+
"encrypt": {
|
|
49
|
+
"type": "AES",
|
|
50
|
+
"key": ""
|
|
51
|
+
},
|
|
52
|
+
"external_name": "searchCriteria\\.author"
|
|
53
|
+
},
|
|
54
|
+
"searchCriteriaCompareVersionVersion": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Version string identifier (name of tag/branch, SHA1 of commit)",
|
|
57
|
+
"parse": false,
|
|
58
|
+
"encode": false,
|
|
59
|
+
"encrypt": {
|
|
60
|
+
"type": "AES",
|
|
61
|
+
"key": ""
|
|
62
|
+
},
|
|
63
|
+
"external_name": "searchCriteria\\.compareVersion\\.version"
|
|
64
|
+
},
|
|
65
|
+
"searchCriteriaCompareVersionVersionOptions": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Version options - Specify additional modifiers to version (e.g Previous)",
|
|
68
|
+
"parse": true,
|
|
69
|
+
"encode": false,
|
|
70
|
+
"encrypt": {
|
|
71
|
+
"type": "AES",
|
|
72
|
+
"key": ""
|
|
73
|
+
},
|
|
74
|
+
"external_name": "searchCriteria\\.compareVersion\\.versionOptions"
|
|
75
|
+
},
|
|
76
|
+
"searchCriteriaCompareVersionVersionType": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "Version type (branch, tag, or commit). Determines how Id is interpreted",
|
|
79
|
+
"parse": false,
|
|
80
|
+
"encode": false,
|
|
81
|
+
"encrypt": {
|
|
82
|
+
"type": "AES",
|
|
83
|
+
"key": ""
|
|
84
|
+
},
|
|
85
|
+
"external_name": "searchCriteria\\.compareVersion\\.versionType"
|
|
86
|
+
},
|
|
87
|
+
"searchCriteriaExcludeDeletes": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"description": "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path.",
|
|
90
|
+
"parse": false,
|
|
91
|
+
"encode": false,
|
|
92
|
+
"encrypt": {
|
|
93
|
+
"type": "AES",
|
|
94
|
+
"key": ""
|
|
95
|
+
},
|
|
96
|
+
"external_name": "searchCriteria\\.excludeDeletes"
|
|
97
|
+
},
|
|
98
|
+
"searchCriteriaFromCommitId": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "If provided, a lower bound for filtering commits alphabetically",
|
|
101
|
+
"parse": false,
|
|
102
|
+
"encode": false,
|
|
103
|
+
"encrypt": {
|
|
104
|
+
"type": "AES",
|
|
105
|
+
"key": ""
|
|
106
|
+
},
|
|
107
|
+
"external_name": "searchCriteria\\.fromCommitId"
|
|
108
|
+
},
|
|
109
|
+
"searchCriteriaFromDate": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "If provided, only include history entries created after this date (string)",
|
|
112
|
+
"parse": false,
|
|
113
|
+
"encode": false,
|
|
114
|
+
"encrypt": {
|
|
115
|
+
"type": "AES",
|
|
116
|
+
"key": ""
|
|
117
|
+
},
|
|
118
|
+
"external_name": "searchCriteria\\.fromDate"
|
|
119
|
+
},
|
|
120
|
+
"searchCriteriaHistoryMode": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.",
|
|
123
|
+
"parse": false,
|
|
124
|
+
"encode": false,
|
|
125
|
+
"encrypt": {
|
|
126
|
+
"type": "AES",
|
|
127
|
+
"key": ""
|
|
128
|
+
},
|
|
129
|
+
"external_name": "searchCriteria\\.historyMode"
|
|
130
|
+
},
|
|
131
|
+
"searchCriteriaIds": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"description": "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.",
|
|
134
|
+
"parse": false,
|
|
135
|
+
"encode": false,
|
|
136
|
+
"encrypt": {
|
|
137
|
+
"type": "AES",
|
|
138
|
+
"key": ""
|
|
139
|
+
},
|
|
140
|
+
"external_name": "searchCriteria\\.ids"
|
|
141
|
+
},
|
|
142
|
+
"searchCriteriaIncludeLinks": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"description": "Whether to include the _links field on the shallow references",
|
|
145
|
+
"parse": false,
|
|
146
|
+
"encode": false,
|
|
147
|
+
"encrypt": {
|
|
148
|
+
"type": "AES",
|
|
149
|
+
"key": ""
|
|
150
|
+
},
|
|
151
|
+
"external_name": "searchCriteria\\.includeLinks"
|
|
152
|
+
},
|
|
153
|
+
"searchCriteriaIncludePushData": {
|
|
154
|
+
"type": "boolean",
|
|
155
|
+
"description": "Whether to include the push information",
|
|
156
|
+
"parse": false,
|
|
157
|
+
"encode": false,
|
|
158
|
+
"encrypt": {
|
|
159
|
+
"type": "AES",
|
|
160
|
+
"key": ""
|
|
161
|
+
},
|
|
162
|
+
"external_name": "searchCriteria\\.includePushData"
|
|
163
|
+
},
|
|
164
|
+
"searchCriteriaIncludeUserImageUrl": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"description": "Whether to include the image Url for committers and authors",
|
|
167
|
+
"parse": false,
|
|
168
|
+
"encode": false,
|
|
169
|
+
"encrypt": {
|
|
170
|
+
"type": "AES",
|
|
171
|
+
"key": ""
|
|
172
|
+
},
|
|
173
|
+
"external_name": "searchCriteria\\.includeUserImageUrl"
|
|
174
|
+
},
|
|
175
|
+
"searchCriteriaIncludeWorkItems": {
|
|
176
|
+
"type": "boolean",
|
|
177
|
+
"description": "Whether to include linked work items",
|
|
178
|
+
"parse": false,
|
|
179
|
+
"encode": false,
|
|
180
|
+
"encrypt": {
|
|
181
|
+
"type": "AES",
|
|
182
|
+
"key": ""
|
|
183
|
+
},
|
|
184
|
+
"external_name": "searchCriteria\\.includeWorkItems"
|
|
185
|
+
},
|
|
186
|
+
"searchCriteriaItemPath": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"description": "Path of item to search under",
|
|
189
|
+
"parse": false,
|
|
190
|
+
"encode": false,
|
|
191
|
+
"encrypt": {
|
|
192
|
+
"type": "AES",
|
|
193
|
+
"key": ""
|
|
194
|
+
},
|
|
195
|
+
"external_name": "searchCriteria\\.itemPath"
|
|
196
|
+
},
|
|
197
|
+
"searchCriteriaItemVersionVersion": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"description": "Version string identifier (name of tag/branch, SHA1 of commit)",
|
|
200
|
+
"parse": false,
|
|
201
|
+
"encode": false,
|
|
202
|
+
"encrypt": {
|
|
203
|
+
"type": "AES",
|
|
204
|
+
"key": ""
|
|
205
|
+
},
|
|
206
|
+
"external_name": "searchCriteria\\.itemVersion\\.version"
|
|
207
|
+
},
|
|
208
|
+
"searchCriteriaItemVersionVersionOptions": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"description": "Version options - Specify additional modifiers to version (e.g Previous)",
|
|
211
|
+
"parse": false,
|
|
212
|
+
"encode": false,
|
|
213
|
+
"encrypt": {
|
|
214
|
+
"type": "AES",
|
|
215
|
+
"key": ""
|
|
216
|
+
},
|
|
217
|
+
"external_name": "searchCriteria\\.itemVersion\\.versionOptions"
|
|
218
|
+
},
|
|
219
|
+
"searchCriteriaItemVersionVersionType": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"description": "Version type (branch, tag, or commit). Determines how Id is interpreted",
|
|
222
|
+
"parse": false,
|
|
223
|
+
"encode": false,
|
|
224
|
+
"encrypt": {
|
|
225
|
+
"type": "AES",
|
|
226
|
+
"key": ""
|
|
227
|
+
},
|
|
228
|
+
"external_name": "searchCriteria\\.itemVersion\\.versionType"
|
|
229
|
+
},
|
|
230
|
+
"searchCriteriaShowOldestCommitsFirst": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"description": "If enabled, this option will ignore the itemVersion and compareVersion parameters",
|
|
233
|
+
"parse": false,
|
|
234
|
+
"encode": false,
|
|
235
|
+
"encrypt": {
|
|
236
|
+
"type": "AES",
|
|
237
|
+
"key": ""
|
|
238
|
+
},
|
|
239
|
+
"external_name": "searchCriteria\\.showOldestCommitsFirst"
|
|
240
|
+
},
|
|
241
|
+
"searchCriteriaToCommitId": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"description": "If provided, an upper bound for filtering commits alphabetically",
|
|
244
|
+
"parse": false,
|
|
245
|
+
"encode": false,
|
|
246
|
+
"encrypt": {
|
|
247
|
+
"type": "AES",
|
|
248
|
+
"key": ""
|
|
249
|
+
},
|
|
250
|
+
"external_name": "searchCriteria\\.toCommitId"
|
|
251
|
+
},
|
|
252
|
+
"searchCriteriaToDate": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"description": "If provided, only include history entries created before this date (string)",
|
|
255
|
+
"parse": false,
|
|
256
|
+
"encode": false,
|
|
257
|
+
"encrypt": {
|
|
258
|
+
"type": "AES",
|
|
259
|
+
"key": ""
|
|
260
|
+
},
|
|
261
|
+
"external_name": "searchCriteria\\.toDate"
|
|
262
|
+
},
|
|
263
|
+
"searchCriteriaUser": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"description": "Alias or display name of the committer",
|
|
266
|
+
"parse": false,
|
|
267
|
+
"encode": false,
|
|
268
|
+
"encrypt": {
|
|
269
|
+
"type": "AES",
|
|
270
|
+
"key": ""
|
|
271
|
+
},
|
|
272
|
+
"external_name": "searchCriteria\\.user"
|
|
273
|
+
},
|
|
20
274
|
"apiVersion": {
|
|
21
275
|
"type": "string",
|
|
22
276
|
"description": "Version of the API to use. This should be set to '6.1-preview.1' to use this version of the api.",
|
package/package.json
CHANGED
package/pronghorn.json
CHANGED
|
@@ -24043,6 +24043,300 @@
|
|
|
24043
24043
|
},
|
|
24044
24044
|
"task": true
|
|
24045
24045
|
},
|
|
24046
|
+
{
|
|
24047
|
+
"name": "commitsGetCommits",
|
|
24048
|
+
"summary": "Retrieve git commits for a project.",
|
|
24049
|
+
"description": "Retrieve git commits for a project.",
|
|
24050
|
+
"input": [
|
|
24051
|
+
{
|
|
24052
|
+
"name": "organization",
|
|
24053
|
+
"type": "string",
|
|
24054
|
+
"info": "The name of the Azure DevOps organization.: string",
|
|
24055
|
+
"required": true,
|
|
24056
|
+
"schema": {
|
|
24057
|
+
"title": "organization",
|
|
24058
|
+
"type": "string"
|
|
24059
|
+
}
|
|
24060
|
+
},
|
|
24061
|
+
{
|
|
24062
|
+
"name": "repositoryId",
|
|
24063
|
+
"type": "string",
|
|
24064
|
+
"info": "The id or friendly name of the repository. To use the friendly name, projectId must also be specified.: string",
|
|
24065
|
+
"required": true,
|
|
24066
|
+
"schema": {
|
|
24067
|
+
"title": "repositoryId",
|
|
24068
|
+
"type": "string"
|
|
24069
|
+
}
|
|
24070
|
+
},
|
|
24071
|
+
{
|
|
24072
|
+
"name": "project",
|
|
24073
|
+
"type": "string",
|
|
24074
|
+
"info": "Project ID or project name: string",
|
|
24075
|
+
"required": false,
|
|
24076
|
+
"schema": {
|
|
24077
|
+
"title": "project",
|
|
24078
|
+
"type": "string"
|
|
24079
|
+
}
|
|
24080
|
+
},
|
|
24081
|
+
{
|
|
24082
|
+
"name": "skip",
|
|
24083
|
+
"type": "number",
|
|
24084
|
+
"info": "Number of entries to skip",
|
|
24085
|
+
"required": false,
|
|
24086
|
+
"schema": {
|
|
24087
|
+
"title": "skip",
|
|
24088
|
+
"type": "number"
|
|
24089
|
+
}
|
|
24090
|
+
},
|
|
24091
|
+
{
|
|
24092
|
+
"name": "top",
|
|
24093
|
+
"type": "number",
|
|
24094
|
+
"info": "Maximum number of entries to retrieve",
|
|
24095
|
+
"required": false,
|
|
24096
|
+
"schema": {
|
|
24097
|
+
"title": "top",
|
|
24098
|
+
"type": "number"
|
|
24099
|
+
}
|
|
24100
|
+
},
|
|
24101
|
+
{
|
|
24102
|
+
"name": "searchCriteriaAuthor",
|
|
24103
|
+
"type": "string",
|
|
24104
|
+
"info": "Alias or display name of the author",
|
|
24105
|
+
"required": false,
|
|
24106
|
+
"schema": {
|
|
24107
|
+
"title": "searchCriteriaAuthor",
|
|
24108
|
+
"type": "string"
|
|
24109
|
+
}
|
|
24110
|
+
},
|
|
24111
|
+
{
|
|
24112
|
+
"name": "searchCriteriaCompareVersionVersion",
|
|
24113
|
+
"type": "string",
|
|
24114
|
+
"info": "Version string identifier (name of tag/branch, SHA1 of commit)",
|
|
24115
|
+
"required": false,
|
|
24116
|
+
"schema": {
|
|
24117
|
+
"title": "searchCriteriaCompareVersionVersion",
|
|
24118
|
+
"type": "string"
|
|
24119
|
+
}
|
|
24120
|
+
},
|
|
24121
|
+
{
|
|
24122
|
+
"name": "searchCriteriaCompareVersionVersionOptions",
|
|
24123
|
+
"type": "string",
|
|
24124
|
+
"info": "Version options - Specify additional modifiers to version (e.g Previous)",
|
|
24125
|
+
"required": false,
|
|
24126
|
+
"schema": {
|
|
24127
|
+
"title": "searchCriteriaCompareVersionVersionOptions",
|
|
24128
|
+
"type": "string"
|
|
24129
|
+
}
|
|
24130
|
+
},
|
|
24131
|
+
{
|
|
24132
|
+
"name": "searchCriteriaCompareVersionVersionType",
|
|
24133
|
+
"type": "string",
|
|
24134
|
+
"info": "Version type (branch, tag, or commit). Determines how Id is interpreted",
|
|
24135
|
+
"required": false,
|
|
24136
|
+
"schema": {
|
|
24137
|
+
"title": "searchCriteriaCompareVersionVersionType",
|
|
24138
|
+
"type": "string"
|
|
24139
|
+
}
|
|
24140
|
+
},
|
|
24141
|
+
{
|
|
24142
|
+
"name": "searchCriteriaExcludeDeletes",
|
|
24143
|
+
"type": "boolean",
|
|
24144
|
+
"info": "Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path.",
|
|
24145
|
+
"required": false,
|
|
24146
|
+
"schema": {
|
|
24147
|
+
"title": "searchCriteriaExcludeDeletes",
|
|
24148
|
+
"type": "boolean"
|
|
24149
|
+
}
|
|
24150
|
+
},
|
|
24151
|
+
{
|
|
24152
|
+
"name": "searchCriteriaFromCommitId",
|
|
24153
|
+
"type": "string",
|
|
24154
|
+
"info": "If provided, a lower bound for filtering commits alphabetically",
|
|
24155
|
+
"required": false,
|
|
24156
|
+
"schema": {
|
|
24157
|
+
"title": "searchCriteriaFromCommitId",
|
|
24158
|
+
"type": "string"
|
|
24159
|
+
}
|
|
24160
|
+
},
|
|
24161
|
+
{
|
|
24162
|
+
"name": "searchCriteriaFromDate",
|
|
24163
|
+
"type": "string",
|
|
24164
|
+
"info": "If provided, only include history entries created after this date (string)",
|
|
24165
|
+
"required": false,
|
|
24166
|
+
"schema": {
|
|
24167
|
+
"title": "searchCriteriaFromDate",
|
|
24168
|
+
"type": "string"
|
|
24169
|
+
}
|
|
24170
|
+
},
|
|
24171
|
+
{
|
|
24172
|
+
"name": "searchCriteriaHistoryMode",
|
|
24173
|
+
"type": "string",
|
|
24174
|
+
"info": "What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified.",
|
|
24175
|
+
"required": false,
|
|
24176
|
+
"schema": {
|
|
24177
|
+
"title": "searchCriteriaHistoryMode",
|
|
24178
|
+
"type": "string"
|
|
24179
|
+
}
|
|
24180
|
+
},
|
|
24181
|
+
{
|
|
24182
|
+
"name": "searchCriteriaIds",
|
|
24183
|
+
"type": "array",
|
|
24184
|
+
"info": "If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.",
|
|
24185
|
+
"required": false,
|
|
24186
|
+
"schema": {
|
|
24187
|
+
"title": "searchCriteriaIds",
|
|
24188
|
+
"type": "array"
|
|
24189
|
+
}
|
|
24190
|
+
},
|
|
24191
|
+
{
|
|
24192
|
+
"name": "searchCriteriaIncludeLinks",
|
|
24193
|
+
"type": "boolean",
|
|
24194
|
+
"info": "Whether to include the _links field on the shallow references",
|
|
24195
|
+
"required": false,
|
|
24196
|
+
"schema": {
|
|
24197
|
+
"title": "searchCriteriaIncludeLinks",
|
|
24198
|
+
"type": "boolean"
|
|
24199
|
+
}
|
|
24200
|
+
},
|
|
24201
|
+
{
|
|
24202
|
+
"name": "searchCriteriaIncludePushData",
|
|
24203
|
+
"type": "boolean",
|
|
24204
|
+
"info": "Whether to include the push information",
|
|
24205
|
+
"required": false,
|
|
24206
|
+
"schema": {
|
|
24207
|
+
"title": "searchCriteriaIncludePushData",
|
|
24208
|
+
"type": "boolean"
|
|
24209
|
+
}
|
|
24210
|
+
},
|
|
24211
|
+
{
|
|
24212
|
+
"name": "searchCriteriaIncludeUserImageUrl",
|
|
24213
|
+
"type": "boolean",
|
|
24214
|
+
"info": "Whether to include the image Url for committers and authors",
|
|
24215
|
+
"required": false,
|
|
24216
|
+
"schema": {
|
|
24217
|
+
"title": "searchCriteriaIncludeUserImageUrl",
|
|
24218
|
+
"type": "boolean"
|
|
24219
|
+
}
|
|
24220
|
+
},
|
|
24221
|
+
{
|
|
24222
|
+
"name": "searchCriteriaIncludeWorkItems",
|
|
24223
|
+
"type": "boolean",
|
|
24224
|
+
"info": "Whether to include linked work items",
|
|
24225
|
+
"required": false,
|
|
24226
|
+
"schema": {
|
|
24227
|
+
"title": "searchCriteriaIncludeWorkItems",
|
|
24228
|
+
"type": "boolean"
|
|
24229
|
+
}
|
|
24230
|
+
},
|
|
24231
|
+
{
|
|
24232
|
+
"name": "searchCriteriaItemPath",
|
|
24233
|
+
"type": "string",
|
|
24234
|
+
"info": "Path of item to search under",
|
|
24235
|
+
"required": false,
|
|
24236
|
+
"schema": {
|
|
24237
|
+
"title": "searchCriteriaItemPath",
|
|
24238
|
+
"type": "string"
|
|
24239
|
+
}
|
|
24240
|
+
},
|
|
24241
|
+
{
|
|
24242
|
+
"name": "searchCriteriaItemVersionVersion",
|
|
24243
|
+
"type": "string",
|
|
24244
|
+
"info": "Version string identifier (name of tag/branch, SHA1 of commit)",
|
|
24245
|
+
"required": false,
|
|
24246
|
+
"schema": {
|
|
24247
|
+
"title": "searchCriteriaItemVersionVersion",
|
|
24248
|
+
"type": "string"
|
|
24249
|
+
}
|
|
24250
|
+
},
|
|
24251
|
+
{
|
|
24252
|
+
"name": "searchCriteriaItemVersionVersionOptions",
|
|
24253
|
+
"type": "string",
|
|
24254
|
+
"info": "Version options - Specify additional modifiers to version (e.g Previous)",
|
|
24255
|
+
"required": false,
|
|
24256
|
+
"schema": {
|
|
24257
|
+
"title": "searchCriteriaItemVersionVersionOptions",
|
|
24258
|
+
"type": "string"
|
|
24259
|
+
}
|
|
24260
|
+
},
|
|
24261
|
+
{
|
|
24262
|
+
"name": "searchCriteriaItemVersionVersionType",
|
|
24263
|
+
"type": "string",
|
|
24264
|
+
"info": "Version type (branch, tag, or commit). Determines how Id is interpreted",
|
|
24265
|
+
"required": false,
|
|
24266
|
+
"schema": {
|
|
24267
|
+
"title": "searchCriteriaItemVersionVersionType",
|
|
24268
|
+
"type": "string"
|
|
24269
|
+
}
|
|
24270
|
+
},
|
|
24271
|
+
{
|
|
24272
|
+
"name": "searchCriteriaShowOldestCommitsFirst",
|
|
24273
|
+
"type": "boolean",
|
|
24274
|
+
"info": "If enabled, this option will ignore the itemVersion and compareVersion parameters",
|
|
24275
|
+
"required": false,
|
|
24276
|
+
"schema": {
|
|
24277
|
+
"title": "searchCriteriaShowOldestCommitsFirst",
|
|
24278
|
+
"type": "boolean"
|
|
24279
|
+
}
|
|
24280
|
+
},
|
|
24281
|
+
{
|
|
24282
|
+
"name": "searchCriteriaToCommitId",
|
|
24283
|
+
"type": "string",
|
|
24284
|
+
"info": "If provided, an upper bound for filtering commits alphabetically",
|
|
24285
|
+
"required": false,
|
|
24286
|
+
"schema": {
|
|
24287
|
+
"title": "searchCriteriaToCommitId",
|
|
24288
|
+
"type": "string"
|
|
24289
|
+
}
|
|
24290
|
+
},
|
|
24291
|
+
{
|
|
24292
|
+
"name": "searchCriteriaToDate",
|
|
24293
|
+
"type": "string",
|
|
24294
|
+
"info": "If provided, only include history entries created before this date (string)",
|
|
24295
|
+
"required": false,
|
|
24296
|
+
"schema": {
|
|
24297
|
+
"title": "searchCriteriaToDate",
|
|
24298
|
+
"type": "string"
|
|
24299
|
+
}
|
|
24300
|
+
},
|
|
24301
|
+
{
|
|
24302
|
+
"name": "searchCriteriaUser",
|
|
24303
|
+
"type": "string",
|
|
24304
|
+
"info": "Alias or display name of the committer",
|
|
24305
|
+
"required": false,
|
|
24306
|
+
"schema": {
|
|
24307
|
+
"title": "searchCriteriaUser",
|
|
24308
|
+
"type": "string"
|
|
24309
|
+
}
|
|
24310
|
+
},
|
|
24311
|
+
{
|
|
24312
|
+
"name": "apiVersion",
|
|
24313
|
+
"type": "string",
|
|
24314
|
+
"info": "Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.: string",
|
|
24315
|
+
"required": true,
|
|
24316
|
+
"schema": {
|
|
24317
|
+
"title": "apiVersion",
|
|
24318
|
+
"type": "string"
|
|
24319
|
+
}
|
|
24320
|
+
}
|
|
24321
|
+
],
|
|
24322
|
+
"output": {
|
|
24323
|
+
"name": "result",
|
|
24324
|
+
"type": "object",
|
|
24325
|
+
"description": "A JSON Object containing status, code and the result",
|
|
24326
|
+
"schema": {
|
|
24327
|
+
"title": "result",
|
|
24328
|
+
"type": "object"
|
|
24329
|
+
}
|
|
24330
|
+
},
|
|
24331
|
+
"roles": [
|
|
24332
|
+
"admin"
|
|
24333
|
+
],
|
|
24334
|
+
"route": {
|
|
24335
|
+
"verb": "POST",
|
|
24336
|
+
"path": "/commitsGet"
|
|
24337
|
+
},
|
|
24338
|
+
"task": true
|
|
24339
|
+
},
|
|
24046
24340
|
{
|
|
24047
24341
|
"name": "commitsGetChanges",
|
|
24048
24342
|
"summary": "Retrieve changes for a particular commit.",
|
|
Binary file
|
package/report/adapterInfo.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.3",
|
|
3
|
-
"configLines":
|
|
3
|
+
"configLines": 53490,
|
|
4
4
|
"scriptLines": 1707,
|
|
5
|
-
"codeLines":
|
|
6
|
-
"testLines":
|
|
7
|
-
"testCases":
|
|
8
|
-
"totalCodeLines":
|
|
9
|
-
"wfTasks":
|
|
5
|
+
"codeLines": 15450,
|
|
6
|
+
"testLines": 19825,
|
|
7
|
+
"testCases": 968,
|
|
8
|
+
"totalCodeLines": 36982,
|
|
9
|
+
"wfTasks": 135
|
|
10
10
|
}
|
|
@@ -2782,6 +2782,31 @@ describe('[integration] Azure_devops Adapter Test', () => {
|
|
|
2782
2782
|
}).timeout(attemptTimeout);
|
|
2783
2783
|
});
|
|
2784
2784
|
|
|
2785
|
+
describe('#commitsGetCommits - errors', () => {
|
|
2786
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2787
|
+
try {
|
|
2788
|
+
a.commitsGetCommits('fakedata', 'fakedata', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 'fakedata', (data, error) => {
|
|
2789
|
+
try {
|
|
2790
|
+
if (stub) {
|
|
2791
|
+
const displayE = 'Error 400 received on request';
|
|
2792
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-azure_devops-connectorRest-handleEndResponse', displayE);
|
|
2793
|
+
} else {
|
|
2794
|
+
runCommonAsserts(data, error);
|
|
2795
|
+
}
|
|
2796
|
+
saveMockData('Commits', 'commitsGetCommits', 'default', data);
|
|
2797
|
+
done();
|
|
2798
|
+
} catch (err) {
|
|
2799
|
+
log.error(`Test Failure: ${err}`);
|
|
2800
|
+
done(err);
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
} catch (error) {
|
|
2804
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2805
|
+
done(error);
|
|
2806
|
+
}
|
|
2807
|
+
}).timeout(attemptTimeout);
|
|
2808
|
+
});
|
|
2809
|
+
|
|
2785
2810
|
const commitsCommitsGetCommitsBatchBodyParam = {
|
|
2786
2811
|
$skip: 2,
|
|
2787
2812
|
$top: 7,
|
|
@@ -4768,6 +4768,69 @@ describe('[unit] Azure_devops Adapter Test', () => {
|
|
|
4768
4768
|
}).timeout(attemptTimeout);
|
|
4769
4769
|
});
|
|
4770
4770
|
|
|
4771
|
+
describe('#commitsGetCommits - errors', () => {
|
|
4772
|
+
it('should have a commitsGetCommits function', (done) => {
|
|
4773
|
+
try {
|
|
4774
|
+
assert.equal(true, typeof a.commitsGetCommits === 'function');
|
|
4775
|
+
done();
|
|
4776
|
+
} catch (error) {
|
|
4777
|
+
log.error(`Test Failure: ${error}`);
|
|
4778
|
+
done(error);
|
|
4779
|
+
}
|
|
4780
|
+
}).timeout(attemptTimeout);
|
|
4781
|
+
it('should error if - missing organization', (done) => {
|
|
4782
|
+
try {
|
|
4783
|
+
a.commitsGetCommits(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
4784
|
+
try {
|
|
4785
|
+
const displayE = 'organization is required';
|
|
4786
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
|
|
4787
|
+
done();
|
|
4788
|
+
} catch (err) {
|
|
4789
|
+
log.error(`Test Failure: ${err}`);
|
|
4790
|
+
done(err);
|
|
4791
|
+
}
|
|
4792
|
+
});
|
|
4793
|
+
} catch (error) {
|
|
4794
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4795
|
+
done(error);
|
|
4796
|
+
}
|
|
4797
|
+
}).timeout(attemptTimeout);
|
|
4798
|
+
it('should error if - missing repositoryId', (done) => {
|
|
4799
|
+
try {
|
|
4800
|
+
a.commitsGetCommits('fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
4801
|
+
try {
|
|
4802
|
+
const displayE = 'repositoryId is required';
|
|
4803
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
|
|
4804
|
+
done();
|
|
4805
|
+
} catch (err) {
|
|
4806
|
+
log.error(`Test Failure: ${err}`);
|
|
4807
|
+
done(err);
|
|
4808
|
+
}
|
|
4809
|
+
});
|
|
4810
|
+
} catch (error) {
|
|
4811
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4812
|
+
done(error);
|
|
4813
|
+
}
|
|
4814
|
+
}).timeout(attemptTimeout);
|
|
4815
|
+
it('should error if - missing apiVersion', (done) => {
|
|
4816
|
+
try {
|
|
4817
|
+
a.commitsGetCommits('fakeparam', 'fakeparam', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
4818
|
+
try {
|
|
4819
|
+
const displayE = 'apiVersion is required';
|
|
4820
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-commitsGetCommits', displayE);
|
|
4821
|
+
done();
|
|
4822
|
+
} catch (err) {
|
|
4823
|
+
log.error(`Test Failure: ${err}`);
|
|
4824
|
+
done(err);
|
|
4825
|
+
}
|
|
4826
|
+
});
|
|
4827
|
+
} catch (error) {
|
|
4828
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4829
|
+
done(error);
|
|
4830
|
+
}
|
|
4831
|
+
}).timeout(attemptTimeout);
|
|
4832
|
+
});
|
|
4833
|
+
|
|
4771
4834
|
describe('#commitsGetCommitsBatch - errors', () => {
|
|
4772
4835
|
it('should have a commitsGetCommitsBatch function', (done) => {
|
|
4773
4836
|
try {
|