Skip to content

Commit fdfc23b

Browse files
committed
tests: add cases for local+default branch filter
Test config is updated to include new prefix rules w/ local branch filters, as well as a global default filter. [push.branch_filter_local] checks precedence of local filter. The first two commits match the rule for #backend1, whose empty local branch filter overrides the global one, so include the distinct commit only. The last two commits match the rule for #backend2, whose local branch filter includes the pushed branch ref, so include both commits. [push.branch_filter_default] checks fallback to default filter. The first commit matches rules for #backend1 (by local empty filter) and #all-push-events (by global filter), of which the former is chosen by prefix length. Likewise for the second, except it's not distinct, so only global filter applies. The last two commits disqualify for the #backend2 filter so also use the global filter. [push.branch_filter_nomatch] checks when no filter matched. This push is on a feature branch not matched by any local/global filter, so it's sent to the default channel.
1 parent 1f0cd3f commit fdfc23b

File tree

5 files changed

+823
-0
lines changed

5 files changed

+823
-0
lines changed
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
{
2+
"ref": "refs/heads/master",
3+
"before": "fb245e2a6d52d10025c8bd4f36f6e3134d85ae18",
4+
"after": "e2173f38ae43865433a182c1fc1b5442d9763b54",
5+
"created": false,
6+
"deleted": false,
7+
"forced": false,
8+
"base_ref": null,
9+
"compare": "https://github.com/octocat/test-repo/compare/fb245e2a6d52...e2173f38ae43",
10+
"commits": [
11+
{
12+
"id": "80452f696a8988e7234063d47720a62e902f2afc",
13+
"tree_id": "bf7530bb0b13d0b9f471ff5d1951c59488b5704c",
14+
"distinct": true,
15+
"message": "Update readme",
16+
"timestamp": "2019-07-06T11:47:56+01:00",
17+
"url": "https://github.com/octocat/test-repo/commit/80452f696a8988e7234063d47720a62e902f2afc",
18+
"author": {
19+
"name": "octocat",
20+
"email": "[email protected]",
21+
"username": "octocat"
22+
},
23+
"committer": {
24+
"name": "octocat",
25+
"email": "[email protected]",
26+
"username": "octocat"
27+
},
28+
"added": [],
29+
"removed": [],
30+
"modified": [
31+
"backend/branch-filter1/README.md"
32+
]
33+
},
34+
{
35+
"id": "e2173f38ae43865433a182c1fc1b5442d9763b54",
36+
"tree_id": "6dc065fdfacfc72cd7b1f5e7a9391c238e4fb74e",
37+
"distinct": false,
38+
"message": "Add TESTING.md",
39+
"timestamp": "2019-07-06T11:48:38+01:00",
40+
"url": "https://github.com/octocat/test-repo/commit/e2173f38ae43865433a182c1fc1b5442d9763b54",
41+
"author": {
42+
"name": "octocat",
43+
"email": "[email protected]",
44+
"username": "octocat"
45+
},
46+
"committer": {
47+
"name": "octocat",
48+
"email": "[email protected]",
49+
"username": "octocat"
50+
},
51+
"added": [
52+
"backend/branch-filter1/TESTING.md",
53+
"backend/branch-filter1/test.ml"
54+
],
55+
"removed": [],
56+
"modified": []
57+
},
58+
{
59+
"id": "90452f696a8988e7234063d47720a62e902f2afc",
60+
"tree_id": "bf7530bb0b13d0b9f471ff5d1951c59488b5704c",
61+
"distinct": true,
62+
"message": "Update readme 2",
63+
"timestamp": "2019-07-06T11:47:56+01:00",
64+
"url": "https://github.com/octocat/test-repo/commit/80452f696a8988e7234063d47720a62e902f2afc",
65+
"author": {
66+
"name": "octocat",
67+
"email": "[email protected]",
68+
"username": "octocat"
69+
},
70+
"committer": {
71+
"name": "octocat",
72+
"email": "[email protected]",
73+
"username": "octocat"
74+
},
75+
"added": [],
76+
"removed": [],
77+
"modified": [
78+
"backend/branch-filter2/README.md"
79+
]
80+
},
81+
{
82+
"id": "f2173f38ae43865433a182c1fc1b5442d9763b54",
83+
"tree_id": "6dc065fdfacfc72cd7b1f5e7a9391c238e4fb74e",
84+
"distinct": false,
85+
"message": "Add TESTING.md 2",
86+
"timestamp": "2019-07-06T11:48:38+01:00",
87+
"url": "https://github.com/octocat/test-repo/commit/e2173f38ae43865433a182c1fc1b5442d9763b54",
88+
"author": {
89+
"name": "octocat",
90+
"email": "[email protected]",
91+
"username": "octocat"
92+
},
93+
"committer": {
94+
"name": "octocat",
95+
"email": "[email protected]",
96+
"username": "octocat"
97+
},
98+
"added": [
99+
"backend/branch-filter2/TESTING.md",
100+
"backend/branch-filter2/test.ml"
101+
],
102+
"removed": [],
103+
"modified": []
104+
}
105+
],
106+
"head_commit": {
107+
"id": "e2173f38ae43865433a182c1fc1b5442d9763b54",
108+
"tree_id": "6dc065fdfacfc72cd7b1f5e7a9391c238e4fb74e",
109+
"distinct": true,
110+
"message": "Add TESTING.md",
111+
"timestamp": "2019-07-06T11:48:38+01:00",
112+
"url": "https://github.com/octocat/test-repo/commit/e2173f38ae43865433a182c1fc1b5442d9763b54",
113+
"author": {
114+
"name": "octocat",
115+
"email": "[email protected]",
116+
"username": "octocat"
117+
},
118+
"committer": {
119+
"name": "octocat",
120+
"email": "[email protected]",
121+
"username": "octocat"
122+
},
123+
"added": [
124+
"backend/branch-filter1/TESTING.md"
125+
],
126+
"removed": [],
127+
"modified": []
128+
},
129+
"repository": {
130+
"id": 0,
131+
"node_id": "MDEwOlJlcG9zaXRvcnkxOTU1MjgwNjU=",
132+
"name": "test-repo",
133+
"full_name": "octocat/test-repo",
134+
"private": true,
135+
"owner": {
136+
"name": "octocat",
137+
"email": "[email protected]",
138+
"login": "octocat",
139+
"id": 0,
140+
"node_id": "MDQ6VXNlcjg3NTUyMDU=",
141+
"avatar_url": "https://avatars1.githubusercontent.com/u/0?v=4",
142+
"gravatar_id": "",
143+
"url": "https://api.github.com/users/octocat",
144+
"html_url": "https://github.com/octocat",
145+
"followers_url": "https://api.github.com/users/octocat/followers",
146+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
147+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
148+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
149+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
150+
"organizations_url": "https://api.github.com/users/octocat/orgs",
151+
"repos_url": "https://api.github.com/users/octocat/repos",
152+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
153+
"received_events_url": "https://api.github.com/users/octocat/received_events",
154+
"type": "User",
155+
"site_admin": false
156+
},
157+
"html_url": "https://github.com/octocat/test-repo",
158+
"description": null,
159+
"fork": false,
160+
"url": "https://github.com/octocat/test-repo",
161+
"forks_url": "https://api.github.com/repos/octocat/test-repo/forks",
162+
"keys_url": "https://api.github.com/repos/octocat/test-repo/keys{/key_id}",
163+
"collaborators_url": "https://api.github.com/repos/octocat/test-repo/collaborators{/collaborator}",
164+
"teams_url": "https://api.github.com/repos/octocat/test-repo/teams",
165+
"hooks_url": "https://api.github.com/repos/octocat/test-repo/hooks",
166+
"issue_events_url": "https://api.github.com/repos/octocat/test-repo/issues/events{/number}",
167+
"events_url": "https://api.github.com/repos/octocat/test-repo/events",
168+
"assignees_url": "https://api.github.com/repos/octocat/test-repo/assignees{/user}",
169+
"branches_url": "https://api.github.com/repos/octocat/test-repo/branches{/branch}",
170+
"tags_url": "https://api.github.com/repos/octocat/test-repo/tags",
171+
"blobs_url": "https://api.github.com/repos/octocat/test-repo/git/blobs{/sha}",
172+
"git_tags_url": "https://api.github.com/repos/octocat/test-repo/git/tags{/sha}",
173+
"git_refs_url": "https://api.github.com/repos/octocat/test-repo/git/refs{/sha}",
174+
"trees_url": "https://api.github.com/repos/octocat/test-repo/git/trees{/sha}",
175+
"statuses_url": "https://api.github.com/repos/octocat/test-repo/statuses/{sha}",
176+
"languages_url": "https://api.github.com/repos/octocat/test-repo/languages",
177+
"stargazers_url": "https://api.github.com/repos/octocat/test-repo/stargazers",
178+
"contributors_url": "https://api.github.com/repos/octocat/test-repo/contributors",
179+
"subscribers_url": "https://api.github.com/repos/octocat/test-repo/subscribers",
180+
"subscription_url": "https://api.github.com/repos/octocat/test-repo/subscription",
181+
"commits_url": "https://api.github.com/repos/octocat/test-repo/commits{/sha}",
182+
"git_commits_url": "https://api.github.com/repos/octocat/test-repo/git/commits{/sha}",
183+
"comments_url": "https://api.github.com/repos/octocat/test-repo/comments{/number}",
184+
"issue_comment_url": "https://api.github.com/repos/octocat/test-repo/issues/comments{/number}",
185+
"contents_url": "https://api.github.com/repos/octocat/test-repo/contents/{+path}",
186+
"compare_url": "https://api.github.com/repos/octocat/test-repo/compare/{base}...{head}",
187+
"merges_url": "https://api.github.com/repos/octocat/test-repo/merges",
188+
"archive_url": "https://api.github.com/repos/octocat/test-repo/{archive_format}{/ref}",
189+
"downloads_url": "https://api.github.com/repos/octocat/test-repo/downloads",
190+
"issues_url": "https://api.github.com/repos/octocat/test-repo/issues{/number}",
191+
"pulls_url": "https://api.github.com/repos/octocat/test-repo/pulls{/number}",
192+
"milestones_url": "https://api.github.com/repos/octocat/test-repo/milestones{/number}",
193+
"notifications_url": "https://api.github.com/repos/octocat/test-repo/notifications{?since,all,participating}",
194+
"labels_url": "https://api.github.com/repos/octocat/test-repo/labels{/name}",
195+
"releases_url": "https://api.github.com/repos/octocat/test-repo/releases{/id}",
196+
"deployments_url": "https://api.github.com/repos/octocat/test-repo/deployments",
197+
"created_at": 1562409695,
198+
"updated_at": "2019-07-06T10:42:28Z",
199+
"pushed_at": 1562410128,
200+
"git_url": "git://github.com/octocat/test-repo.git",
201+
"ssh_url": "[email protected]:octocat/test-repo.git",
202+
"clone_url": "https://github.com/octocat/test-repo.git",
203+
"svn_url": "https://github.com/octocat/test-repo",
204+
"homepage": null,
205+
"size": 0,
206+
"stargazers_count": 0,
207+
"watchers_count": 0,
208+
"language": null,
209+
"has_issues": true,
210+
"has_projects": true,
211+
"has_downloads": true,
212+
"has_wiki": true,
213+
"has_pages": false,
214+
"forks_count": 0,
215+
"mirror_url": null,
216+
"archived": false,
217+
"disabled": false,
218+
"open_issues_count": 0,
219+
"license": null,
220+
"forks": 0,
221+
"open_issues": 0,
222+
"watchers": 0,
223+
"default_branch": "master",
224+
"stargazers": 0,
225+
"master_branch": "master"
226+
},
227+
"pusher": {
228+
"name": "octocat",
229+
"email": "[email protected]"
230+
},
231+
"sender": {
232+
"login": "octocat",
233+
"id": 0,
234+
"node_id": "MDQ6VXNlcjg3NTUyMDU=",
235+
"avatar_url": "https://avatars1.githubusercontent.com/u/0?v=4",
236+
"gravatar_id": "",
237+
"url": "https://api.github.com/users/octocat",
238+
"html_url": "https://github.com/octocat",
239+
"followers_url": "https://api.github.com/users/octocat/followers",
240+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
241+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
242+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
243+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
244+
"organizations_url": "https://api.github.com/users/octocat/orgs",
245+
"repos_url": "https://api.github.com/users/octocat/repos",
246+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
247+
"received_events_url": "https://api.github.com/users/octocat/received_events",
248+
"type": "User",
249+
"site_admin": false
250+
}
251+
}

0 commit comments

Comments
 (0)