Skip to content

Commit 7ae88ae

Browse files
committed
Add tags to patches in dummy data and fix tag display in history
1 parent d1bf0fd commit 7ae88ae

File tree

2 files changed

+151
-4
lines changed

2 files changed

+151
-4
lines changed

pgcommitfest/commitfest/fixtures/commitfest_data.json

Lines changed: 146 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,96 @@
9292
"version": "18"
9393
}
9494
},
95+
{
96+
"model": "commitfest.tag",
97+
"pk": 1,
98+
"fields": {
99+
"name": "bugfix",
100+
"color": "#a51d2d",
101+
"description": "Fixes a bug"
102+
}
103+
},
104+
{
105+
"model": "commitfest.tag",
106+
"pk": 2,
107+
"fields": {
108+
"name": "backport",
109+
"color": "#1a5fb4",
110+
"description": "Once merged should be backported to old branches"
111+
}
112+
},
113+
{
114+
"model": "commitfest.tag",
115+
"pk": 3,
116+
"fields": {
117+
"name": "missing-tests",
118+
"color": "#c66424",
119+
"description": "Author should add tests"
120+
}
121+
},
122+
{
123+
"model": "commitfest.tag",
124+
"pk": 4,
125+
"fields": {
126+
"name": "missing-docs",
127+
"color": "#c66424",
128+
"description": "Author should add documentation"
129+
}
130+
},
131+
{
132+
"model": "commitfest.tag",
133+
"pk": 5,
134+
"fields": {
135+
"name": "missing-benchmarks",
136+
"color": "#c66424",
137+
"description": "Author should do additional benchmarks"
138+
}
139+
},
140+
{
141+
"model": "commitfest.tag",
142+
"pk": 6,
143+
"fields": {
144+
"name": "help-user-testing",
145+
"color": "#07732e",
146+
"description": "Reviewers are requested to try out the patch and provide user feedback on behaviour UX/UI"
147+
}
148+
},
149+
{
150+
"model": "commitfest.tag",
151+
"pk": 7,
152+
"fields": {
153+
"name": "help-bikeshedding",
154+
"color": "#07732e",
155+
"description": "Reviewers are requested to propose or vote on stylistic changes like a user facing function name"
156+
}
157+
},
158+
{
159+
"model": "commitfest.tag",
160+
"pk": 8,
161+
"fields": {
162+
"name": "help-docs",
163+
"color": "#07732e",
164+
"description": "Reviewers are requested to help review or write documentation"
165+
}
166+
},
167+
{
168+
"model": "commitfest.tag",
169+
"pk": 9,
170+
"fields": {
171+
"name": "help-benchmarks",
172+
"color": "#07732e",
173+
"description": "Reviewers are requested to help discuss or do benchmarks and discuss performance impact"
174+
}
175+
},
176+
{
177+
"model": "commitfest.tag",
178+
"pk": 10,
179+
"fields": {
180+
"name": "good-first-review",
181+
"color": "#613583",
182+
"description": "An easy to review patch for a new reviewer"
183+
}
184+
},
95185
{
96186
"model": "commitfest.patch",
97187
"pk": 1,
@@ -103,8 +193,15 @@
103193
"targetversion": null,
104194
"committer": null,
105195
"created": "2025-01-26T10:48:31.579",
106-
"modified": "2025-01-26T10:53:20.498",
196+
"modified": "2025-06-15T21:26:10.549",
107197
"lastmail": "2025-01-20T06:53:39",
198+
"tags": [
199+
2,
200+
1,
201+
9,
202+
6,
203+
4
204+
],
108205
"authors": [
109206
1
110207
],
@@ -126,8 +223,13 @@
126223
"targetversion": null,
127224
"committer": null,
128225
"created": "2025-01-26T10:51:17.305",
129-
"modified": "2025-01-26T10:51:19.631",
226+
"modified": "2025-06-15T21:26:24.284",
130227
"lastmail": "2025-01-20T14:20:10",
228+
"tags": [
229+
10,
230+
7,
231+
6
232+
],
131233
"authors": [],
132234
"reviewers": [],
133235
"subscribers": [],
@@ -149,6 +251,7 @@
149251
"created": "2025-01-26T11:02:07.467",
150252
"modified": "2025-01-26T11:02:10.911",
151253
"lastmail": "2025-01-20T13:26:55",
254+
"tags": [],
152255
"authors": [],
153256
"reviewers": [],
154257
"subscribers": [],
@@ -168,8 +271,11 @@
168271
"targetversion": null,
169272
"committer": null,
170273
"created": "2025-01-31T13:30:19.744",
171-
"modified": "2025-01-31T13:30:21.305",
274+
"modified": "2025-06-15T21:27:56.667",
172275
"lastmail": "2025-01-20T12:44:40",
276+
"tags": [
277+
1
278+
],
173279
"authors": [],
174280
"reviewers": [],
175281
"subscribers": [],
@@ -191,6 +297,7 @@
191297
"created": "2025-02-16T21:59:04.131",
192298
"modified": "2025-02-16T22:03:24.902",
193299
"lastmail": "2025-01-20T14:01:53",
300+
"tags": [],
194301
"authors": [],
195302
"reviewers": [],
196303
"subscribers": [],
@@ -212,6 +319,7 @@
212319
"created": "2025-02-16T22:03:58.476",
213320
"modified": "2025-02-16T22:04:23.180",
214321
"lastmail": "2025-01-19T23:55:17",
322+
"tags": [],
215323
"authors": [],
216324
"reviewers": [],
217325
"subscribers": [],
@@ -233,6 +341,7 @@
233341
"created": "2025-03-01T22:27:53.214",
234342
"modified": "2025-03-01T22:27:53.221",
235343
"lastmail": "2025-01-18T07:14:02",
344+
"tags": [],
236345
"authors": [],
237346
"reviewers": [],
238347
"subscribers": [],
@@ -254,6 +363,7 @@
254363
"created": "2025-02-01T00:00:00",
255364
"modified": "2025-02-01T00:00:00",
256365
"lastmail": "2025-02-01T00:00:00",
366+
"tags": [],
257367
"authors": [
258368
3,
259369
6
@@ -576,6 +686,39 @@
576686
"what": "Attached mail thread example@message-31"
577687
}
578688
},
689+
{
690+
"model": "commitfest.patchhistory",
691+
"pk": 20,
692+
"fields": {
693+
"patch": 1,
694+
"date": "2025-06-15T21:26:10.546",
695+
"by": 1,
696+
"by_cfbot": false,
697+
"what": "Changed tags to backport, bugfix, help-benchmarks, help-user-testing, missing-docs"
698+
}
699+
},
700+
{
701+
"model": "commitfest.patchhistory",
702+
"pk": 21,
703+
"fields": {
704+
"patch": 2,
705+
"date": "2025-06-15T21:26:24.282",
706+
"by": 1,
707+
"by_cfbot": false,
708+
"what": "Changed tags to good-first-review, help-bikeshedding, help-user-testing"
709+
}
710+
},
711+
{
712+
"model": "commitfest.patchhistory",
713+
"pk": 22,
714+
"fields": {
715+
"patch": 4,
716+
"date": "2025-06-15T21:27:56.664",
717+
"by": 1,
718+
"by_cfbot": false,
719+
"what": "Changed tags to bugfix"
720+
}
721+
},
579722
{
580723
"model": "commitfest.mailthread",
581724
"pk": 1,

pgcommitfest/commitfest/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,14 @@ def patchform(request, patchid):
774774

775775
# Track all changes
776776
for field, values in r.diff.items():
777+
if field == "tags":
778+
value = ", ".join(v.name for v in values[1])
779+
else:
780+
value = values[1]
777781
PatchHistory(
778782
patch=patch,
779783
by=request.user,
780-
what="Changed %s to %s" % (field, values[1]),
784+
what="Changed %s to %s" % (field, value),
781785
).save_and_notify(
782786
prevcommitter=prevcommitter,
783787
prevreviewers=prevreviewers,

0 commit comments

Comments
 (0)