@gitkraken/provider-apis 0.17.5 → 0.19.0

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 CHANGED
@@ -1,5 +1,181 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.0
4
+
5
+ - added `getReposForCurrentUser` (Bitbucket Server)
6
+ - added `createCommit` (GitHub)
7
+
8
+ ### ⚠️ Breaking Changes
9
+
10
+ - made input argument required for `getReposForCurrentUser` functions (Bitbucket, Bitbucket Server, GitLab)
11
+
12
+ ## 0.18.1
13
+
14
+ - reverted inclusion of local test config
15
+
16
+ ## 0.18.0
17
+
18
+ ### ⚠️ Breaking Changes
19
+
20
+ This version refactors all of the mutation functions for all providers. The mutation functions are now standardized to take `GitPullRequest` or `Issue` objects as arguments, which differs from the lack of standardization present in earlier verisons.
21
+
22
+ Examples of how to call the new functions:
23
+
24
+ ```ts
25
+ const pullRequest: GitPullRequest = { /* ... some PR object from your app's state ... */ };
26
+
27
+ // pre-v0.18.0 way of merging a pull request for gitlab
28
+ await gitlab.mergePullRequest({
29
+ repo: {
30
+ namespace: pullRequest.repository.owner.login!,
31
+ name: pullRequest.repository.name,
32
+ },
33
+ pullRequestId: pullRequest.number, // other providers might use the `graphQLId` or `id` fields
34
+ expectedSourceSha: pullRequest.headRef.oid!, // other providers might not need this at all
35
+ mergeStrategy: GitMergeStrategy.Squash, // or `undefined` to use the repo's default merge strategy
36
+ });
37
+
38
+ // v0.18.0 way of merging a pull request for gitlab
39
+ await gitlab.mergePullRequest({
40
+ pullRequest,
41
+ mergeStrategy: GitMergeStrategy.Squash, // or `undefined` to use the repo's default merge strategy
42
+ });
43
+ ```
44
+
45
+ ```ts
46
+ const issue: Issue = { /* ... some issue object from your app's state ... */ };
47
+ const labels: GitLabel[] = [{ /* ... some label objects from your app's state ... */ }];
48
+
49
+ // pre-v0.18.0 way of setting issue labels for gitlab
50
+ await gitlab.setIssueLabels({
51
+ repo: {
52
+ namespace: issue.repository.owner.login!,
53
+ name: issue.repository.name,
54
+ },
55
+ issueId: issue.number, // other providers might use the `graphQLId` or `id` fields
56
+ labelGraphQLIds: labels.map((label) => label.graphQLId),
57
+ });
58
+
59
+ // v0.18.0 way of setting issue labels
60
+ await gitlab.setIssueLabels({
61
+ issue,
62
+ labels,
63
+ });
64
+ ```
65
+
66
+ The new functions take various `Set*Input` interfaces as arguments.
67
+
68
+ ```ts
69
+ interface GitProvider {
70
+ // ...
71
+ setPullRequestMilestone?(
72
+ input: {
73
+ pullRequest: SetPullRequestInput;
74
+ milestone: SetMilestoneInput | null;
75
+ },
76
+ options: Options
77
+ ): Promise<void>;
78
+ // ...
79
+ }
80
+ ```
81
+
82
+ The `Set*Input` interfaces are designed to take their corresponding provider library object. `SetPullRequestInput` is designed to take a `GitPullRequest` object. `SetMilestoneInput` is designed to take a `GitMilestone` object. Here's a quick reference of the various `Set*Input` interfaces and the objects that they are designed to take:
83
+
84
+ |`Set*Input` interface|Provider library object |
85
+ |---------------------|-------------------------------------------|
86
+ |SetPullRequestInput |GitPullRequest |
87
+ |SetIssueInput |Issue |
88
+ |SetMilestoneInput |GitMilestone |
89
+ |SetAccountInput |Account |
90
+ |SetLabelInput |GitLabel |
91
+ |SetStatusInput |IssueTransition, TrelloBoard, WorkItemState|
92
+
93
+ Now, wih all of that explained, here's the list of updated mutation functions:
94
+
95
+ Azure Dev Ops:
96
+ - closePullRequest
97
+ - mergePullRequest
98
+ - addPullRequestLabel
99
+ - removePullRequestLabel
100
+ - setPullRequestAsDraft
101
+ - addPullRequestReviewer
102
+ - removePullRequestReviewer
103
+ - setIssueStatus
104
+ - setIssueAssignee
105
+ - setIssueLabels
106
+
107
+ - setPullRequestReviewers **(new)**
108
+ - setPullRequestLabels **(new)**
109
+
110
+ Bitbucket:
111
+ - closePullRequest
112
+ - mergePullRequest
113
+ - setPullRequestReviewers
114
+
115
+ Bitbucket Server:
116
+ - closePullRequest
117
+ - mergePullRequest
118
+ - setPullRequestReviewers
119
+
120
+ GitHub/GitHub Enterprise:
121
+ - closePullRequest
122
+ - mergePullRequest
123
+ - setPullRequestMilestone
124
+ - setPullRequestAsDraft
125
+ - setPullRequestReviewers
126
+ - setPullRequestAssignees
127
+ - setPullRequestLabels
128
+ - setIssueLabels
129
+ - setIssueMilestone
130
+ - setIssueAssignees
131
+
132
+ - reOpenIssue **(new)**
133
+ - closeIssue **(new)**
134
+ - closeIssueWithReason **(new)**
135
+ - reRequestPullRequestReviews **(new)**
136
+
137
+ - setIssueStatus was **removed**
138
+
139
+ GitLab/GitLab Self-Managed:
140
+ - closePullRequest
141
+ - mergePullRequest
142
+ - setPullRequestMilestone
143
+ - setPullRequestAsDraft
144
+ - setPullRequestReviewers
145
+ - setPullRequestAssignees
146
+ - setPullRequestLabels
147
+ - setIssueLabels
148
+ - setIssueMilestone
149
+ - setIssueAssignees
150
+
151
+ - closeIssue **(new)**
152
+ - reOpenIssue **(new)**
153
+ - reRequestPullRequestReview **(new)**
154
+ - reRequestPullRequestReviews **(new)**
155
+
156
+ - setIssueStatus was **removed**
157
+
158
+ Jira:
159
+ - setIssueStatus
160
+ - setIssueAssignee
161
+ - setIssueComponents
162
+ - setIssueLabels
163
+
164
+ Jira Server:
165
+ - setIssueStatus
166
+ - setIssueComponents
167
+ - setIssueLabels
168
+
169
+ Trello:
170
+ - setIssueStatus
171
+ - setIssueAssignees
172
+ - setIssueLabels
173
+
174
+ - archiveIssue **(new)**
175
+ - unArchiveIssue **(new)**
176
+
177
+ - setIssueArchived was **removed**
178
+
3
179
  ## 0.17.5
4
180
 
5
181
  - added `getIssue` (Jira Cloud and Jira Server)