6
6
User = namedtuple ("User" , ["login" ])
7
7
Commit = namedtuple ("Commit" , ["author" , "commit" ])
8
8
CommitMessage = namedtuple ("CommitMessage" , ["message" ])
9
+ PullRequestBase = namedtuple ("PullRequestBase" , "ref" )
9
10
PullRequestTuple = namedtuple (
10
11
"PullRequest" ,
11
- ["title" , "number" , "state" , "merged" , "merged_at" , "user" , "commits" ],
12
+ ["title" , "number" , "state" , "base" , " merged" , "merged_at" , "user" , "commits" ],
12
13
)
13
14
14
15
@@ -41,6 +42,7 @@ def get_pulls(state="closed"):
41
42
number = 1 ,
42
43
state = "open" ,
43
44
merged = False ,
45
+ base = PullRequestBase ("main" ),
44
46
merged_at = datetime (2023 , 2 , 2 ),
45
47
user = User ("contributor_1" ),
46
48
commits = [
@@ -68,6 +70,7 @@ def get_pulls(state="closed"):
68
70
state = "closed" ,
69
71
merged = True ,
70
72
merged_at = datetime (2023 , 2 , 1 ),
73
+ base = PullRequestBase ("main" ),
71
74
user = User ("contributor_2" ),
72
75
commits = [
73
76
Commit (
@@ -106,6 +109,7 @@ def get_pulls(state="closed"):
106
109
state = "closed" ,
107
110
merged = True ,
108
111
merged_at = datetime (2023 , 2 , 2 ),
112
+ base = PullRequestBase ("main" ),
109
113
user = User ("contributor_3" ),
110
114
commits = [
111
115
Commit (
@@ -132,6 +136,7 @@ def get_pulls(state="closed"):
132
136
state = "closed" ,
133
137
merged = True ,
134
138
merged_at = datetime (2023 , 2 , 3 ),
139
+ base = PullRequestBase ("main" ),
135
140
user = User ("contributor_4" ),
136
141
commits = [
137
142
Commit (
@@ -158,6 +163,7 @@ def get_pulls(state="closed"):
158
163
state = "closed" ,
159
164
merged = False ,
160
165
merged_at = datetime (2023 , 2 , 4 ),
166
+ base = PullRequestBase ("main" ),
161
167
user = User ("contributor_3" ),
162
168
commits = [
163
169
Commit (
@@ -184,6 +190,7 @@ def get_pulls(state="closed"):
184
190
state = "closed" ,
185
191
merged = True ,
186
192
merged_at = datetime (2023 , 2 , 5 ),
193
+ base = PullRequestBase ("main" ),
187
194
user = User ("contributor_2" ),
188
195
commits = [
189
196
Commit (
@@ -210,6 +217,7 @@ def get_pulls(state="closed"):
210
217
state = "closed" ,
211
218
merged = True ,
212
219
merged_at = datetime (2023 , 5 , 2 ),
220
+ base = PullRequestBase ("main" ),
213
221
user = User ("new_contributor_2" ),
214
222
commits = [
215
223
Commit (
@@ -242,6 +250,7 @@ def get_pulls(state="closed"):
242
250
state = "closed" ,
243
251
merged = True ,
244
252
merged_at = datetime (2023 , 5 , 5 ),
253
+ base = PullRequestBase ("main" ),
245
254
user = User ("contributor_3" ),
246
255
commits = [
247
256
Commit (
@@ -274,6 +283,7 @@ def get_pulls(state="closed"):
274
283
state = "closed" ,
275
284
merged = True ,
276
285
merged_at = datetime (2023 , 5 , 1 ),
286
+ base = PullRequestBase ("main" ),
277
287
user = User ("new_contributor_1" ),
278
288
commits = [
279
289
Commit (
@@ -312,6 +322,7 @@ def get_pulls(state="closed"):
312
322
state = "closed" ,
313
323
merged = True ,
314
324
merged_at = datetime (2023 , 5 , 10 ),
325
+ base = PullRequestBase ("another_branch" ),
315
326
user = User ("new_contributor_1" ),
316
327
commits = [
317
328
Commit (
@@ -330,6 +341,7 @@ def get_pulls(state="closed"):
330
341
state = "closed" ,
331
342
merged = True ,
332
343
merged_at = datetime (2023 , 5 , 9 ),
344
+ base = PullRequestBase ("main" ),
333
345
user = User ("new_contributor_1" ),
334
346
commits = [
335
347
Commit (
@@ -359,8 +371,9 @@ def test_get_sorted_merged_pulls():
359
371
pull
360
372
for pull in pulls
361
373
if pull .merged
362
- and not pull .title .startswith ("chore: release" )
363
- and not pull .user .login .startswith ("github-actions" )
374
+ and pull .base .ref == "main"
375
+ and not pull .title .startswith ("chore: release" )
376
+ and not pull .user .login .startswith ("github-actions" )
364
377
],
365
378
key = lambda pull : pull .merged_at ,
366
379
)
@@ -428,7 +441,6 @@ def test_whats_changed_md():
428
441
"* Feature 8 by @new_contributor_1, @new_contributor_coauthor3 and @new_contributor_coauthor4 in https://github.com/ada-url/ada/pull/15" ,
429
442
"* Feature 9 by @new_contributor_2 and @new_contributor_coauthor1 in https://github.com/ada-url/ada/pull/13" ,
430
443
"* Feature 7 by @contributor_3 and @new_contributor_coauthor2 in https://github.com/ada-url/ada/pull/14" ,
431
- "* Feature 11 by @new_contributor_1 in https://github.com/ada-url/ada/pull/16" ,
432
444
]
433
445
434
446
@@ -479,7 +491,6 @@ def test_contruct_release_notes():
479
491
+ "* Feature 8 by @new_contributor_1, @new_contributor_coauthor3 and @new_contributor_coauthor4 in https://github.com/ada-url/ada/pull/15\n "
480
492
+ "* Feature 9 by @new_contributor_2 and @new_contributor_coauthor1 in https://github.com/ada-url/ada/pull/13\n "
481
493
+ "* Feature 7 by @contributor_3 and @new_contributor_coauthor2 in https://github.com/ada-url/ada/pull/14\n "
482
- + "* Feature 11 by @new_contributor_1 in https://github.com/ada-url/ada/pull/16\n "
483
494
+ "\n "
484
495
+ "## New Contributors\n "
485
496
+ "* @new_contributor_2 and @new_contributor_coauthor1 made their first contribution in https://github.com/ada-url/ada/pull/13\n "
0 commit comments