Skip to content

Commit c470992

Browse files
authored
Merge pull request #1 from philrenaud/clubhouse-updated-to-shortcut
Clubhouse updated to shortcut
2 parents a379af6 + 3fd8e7c commit c470992

File tree

5 files changed

+9360
-13641
lines changed

5 files changed

+9360
-13641
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ _before_ the pull request is created.
4747

4848
This Action will specifically check for branch names that follow the naming
4949
convention for this built-in integration. Any branch name that contains
50-
`ch####` will be ignored by this Action, on the assumption that a Clubhouse
51-
story already exists for the pull request. The `ch####` must be separated
50+
`sc-####` will be ignored by this Action, on the assumption that a Clubhouse
51+
story already exists for the pull request. The `sc-####` must be separated
5252
from leading or following text with either a `/` or a `-`. So, branches
53-
named `ch1`, `prefix/ch23`, `prefix-ch123`, `ch3456/suffix`, `ch3456-suffux`,
54-
`prefix/ch987/suffix` would match, but `xch123` and `ch987end` would not.
53+
named `sc-1`, `prefix/sc-23`, `prefix-sc-123`, `sc-3456/suffix`, `sc-3456-suffux`,
54+
`prefix/sc-987/suffix` would match, but `xsc-123` and `sc-987end` would not.
5555

5656
## Customizing the Pull Request Comment
5757

@@ -180,7 +180,7 @@ Multiple users should be separated by commas.
180180
## Iteration Support
181181

182182
Clubhouse supports the concept of [iterations](https://help.clubhouse.io/hc/en-us/articles/360028953452-Iterations-Overview)
183-
-- time-boxed periods of development for stories. You can configure this Action
183+
-- time-boxed periods of development for stories. You can configure this Action
184184
to automatically assign the Clubhouse stories it creates to Clubhouse iterations,
185185
using GitHub labels and Clubhouse groups to identify the correct iteration to use.
186186

@@ -189,7 +189,7 @@ the way you use Clubhouse and GitHub:
189189

190190
- We assume that each team has an associated [Clubhouse group](https://help.clubhouse.io/hc/en-us/articles/360039328751-Groups-Group-Management),
191191
and that Clubhouse iterations are associated with this group.
192-
- We assume that the correct iteration to use is the *most recent*
192+
- We assume that the correct iteration to use is the _most recent_
193193
in-progress iteration for the group, as determined by the "last updated" time.
194194
(However, you may exclude specific iterations by name.)
195195
- We assume that each team has an associated [GitHub label](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/managing-labels),
@@ -198,7 +198,7 @@ the way you use Clubhouse and GitHub:
198198
[Labeler Action](https://github.com/actions/labeler).)
199199

200200
If you want to use this feature, and you have a different workflow that
201-
does *not* match these assumptions, open a GitHub Issue on this repo
201+
does _not_ match these assumptions, open a GitHub Issue on this repo
202202
and let's talk about it! Maybe we can find a way to make this Action
203203
support other workflows, as well.
204204

__tests__/util.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,21 @@ describe("createClubhouseStory", () => {
199199
});
200200

201201
test.each([
202-
["ch1", "1"],
203-
["ch89/something", "89"],
204-
["ch99-something", "99"],
205-
["prefix-1/ch123", "123"],
206-
["prefix-1-ch321", "321"],
207-
["prefix/ch5678/suffix", "5678"],
208-
["prefix-ch6789/suffix-more", "6789"],
209-
["prefix/ch7890-suffix", "7890"],
210-
["prefix-ch0987-suffix-extra", "0987"],
202+
["sc-1", "1"],
203+
["sc-89/something", "89"],
204+
["sc-99-something", "99"],
205+
["prefix-1/sc-123", "123"],
206+
["prefix-1-sc-321", "321"],
207+
["prefix/sc-5678/suffix", "5678"],
208+
["prefix-sc-6789/suffix-more", "6789"],
209+
["prefix/sc-7890-suffix", "7890"],
210+
["prefix-sc-0987-suffix-extra", "0987"],
211211
])("getClubhouseStoryIdFromBranchName matches %s", (branch, expected) => {
212212
const id = util.getClubhouseStoryIdFromBranchName(branch);
213213
expect(id).toEqual(expected);
214214
});
215215

216-
test.each(["prefix/ch8765+suffix", "ch554X", "ach8765", "this_ch1234"])(
216+
test.each(["prefix/sc-8765+suffix", "sc-554X", "asc-8765", "this_sc-1234"])(
217217
"getClubhouseStoryIdFromBranchName does not match %s",
218218
(branch) => {
219219
const id = util.getClubhouseStoryIdFromBranchName(branch);
@@ -248,7 +248,7 @@ test("getClubhouseURLFromPullRequest", async () => {
248248
test("getClubhouseURLFromPullRequest desc", async () => {
249249
const payload = {
250250
pull_request: {
251-
body: "Clubhouse story: https://app.clubhouse.io/org/story/12345",
251+
body: "Clubhouse story: https://app.shortcut.com/org/story/12345",
252252
number: 123,
253253
},
254254
repository: {
@@ -260,7 +260,7 @@ test("getClubhouseURLFromPullRequest desc", async () => {
260260
};
261261

262262
const url = await util.getClubhouseURLFromPullRequest(payload as any);
263-
expect(url).toEqual("https://app.clubhouse.io/org/story/12345");
263+
expect(url).toEqual("https://app.shortcut.com/org/story/12345");
264264
});
265265

266266
test("getClubhouseURLFromPullRequest comment", async () => {
@@ -281,11 +281,11 @@ test("getClubhouseURLFromPullRequest comment", async () => {
281281
.get("/repos/octocat/example/issues/123/comments")
282282
.reply(200, [
283283
{ body: "no url here, either!" },
284-
{ body: "Clubhouse story: https://app.clubhouse.io/org/story/12345" },
284+
{ body: "Clubhouse story: https://app.shortcut.com/org/story/12345" },
285285
]);
286286

287287
const url = await util.getClubhouseURLFromPullRequest(payload as any);
288-
expect(url).toEqual("https://app.clubhouse.io/org/story/12345");
288+
expect(url).toEqual("https://app.shortcut.com/org/story/12345");
289289

290290
scope.done();
291291
});

0 commit comments

Comments
 (0)