Skip to content

Commit 3b68946

Browse files
committed
Add dummy cfbot data
1 parent ec377d2 commit 3b68946

File tree

2 files changed

+145
-0
lines changed

2 files changed

+145
-0
lines changed

pgcommitfest/commitfest/fixtures/commitfest_data.json

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,5 +369,145 @@
369369
"statusstring": "Withdrawn",
370370
"sortkey": 50
371371
}
372+
},
373+
{
374+
"model": "commitfest.cfbotbranch",
375+
"pk": 1,
376+
"fields": {
377+
"branch_id": 123,
378+
"branch_name": "cf/1",
379+
"commit_id": "abcdefg",
380+
"apply_url": "http://cfbot.cputube.org/patch_4573.log",
381+
"status": "finished",
382+
"needs_rebase_since": null,
383+
"created": "2025-01-26T22:06:02.980",
384+
"modified": "2025-01-26T22:06:02.980"
385+
}
386+
},
387+
{
388+
"model": "commitfest.cfbotbranch",
389+
"pk": 2,
390+
"fields": {
391+
"branch_id": 345,
392+
"branch_name": "cf/2",
393+
"commit_id": null,
394+
"apply_url": "http://cfbot.cputube.org/patch_4573.log",
395+
"status": "failed",
396+
"needs_rebase_since": null,
397+
"created": "2025-01-26T22:11:09.961",
398+
"modified": "2025-01-26T22:20:39.372"
399+
}
400+
},
401+
{
402+
"model": "commitfest.cfbotbranch",
403+
"pk": 3,
404+
"fields": {
405+
"branch_id": 567,
406+
"branch_name": "cf/3",
407+
"commit_id": "abc123",
408+
"apply_url": "http://cfbot.cputube.org/patch_4748.log",
409+
"status": "failed",
410+
"needs_rebase_since": null,
411+
"created": "2025-01-26T22:22:46.602",
412+
"modified": "2025-01-26T22:26:41.587"
413+
}
414+
},
415+
{
416+
"model": "commitfest.cfbottask",
417+
"pk": 1,
418+
"fields": {
419+
"task_id": "12345",
420+
"task_name": "Linux build",
421+
"patch": 1,
422+
"branch_id": 123,
423+
"position": 1,
424+
"status": "COMPLETED",
425+
"created": "2025-01-26T22:06:49.237",
426+
"modified": "2025-01-26T22:07:40.405"
427+
}
428+
},
429+
{
430+
"model": "commitfest.cfbottask",
431+
"pk": 2,
432+
"fields": {
433+
"task_id": "12346",
434+
"task_name": "MacOS Build",
435+
"patch": 1,
436+
"branch_id": 123,
437+
"position": 2,
438+
"status": "COMPLETED",
439+
"created": "2025-01-26T22:07:32.041",
440+
"modified": "2025-01-26T22:07:32.041"
441+
}
442+
},
443+
{
444+
"model": "commitfest.cfbottask",
445+
"pk": 3,
446+
"fields": {
447+
"task_id": "4561",
448+
"task_name": "Redhat",
449+
"patch": 3,
450+
"branch_id": 567,
451+
"position": 1,
452+
"status": "COMPLETED",
453+
"created": "2025-01-26T22:24:37.445",
454+
"modified": "2025-01-26T22:24:37.445"
455+
}
456+
},
457+
{
458+
"model": "commitfest.cfbottask",
459+
"pk": 4,
460+
"fields": {
461+
"task_id": "4562",
462+
"task_name": "MacOS build",
463+
"patch": 3,
464+
"branch_id": 567,
465+
"position": 2,
466+
"status": "EXECUTING",
467+
"created": "2025-01-26T22:25:15.283",
468+
"modified": "2025-01-26T22:27:09.055"
469+
}
470+
},
471+
{
472+
"model": "commitfest.cfbottask",
473+
"pk": 5,
474+
"fields": {
475+
"task_id": "4563",
476+
"task_name": "FreeBSD",
477+
"patch": 3,
478+
"branch_id": 567,
479+
"position": 3,
480+
"status": "FAILED",
481+
"created": "2025-01-26T22:25:48.021",
482+
"modified": "2025-01-26T22:25:48.021"
483+
}
484+
},
485+
{
486+
"model": "commitfest.cfbottask",
487+
"pk": 6,
488+
"fields": {
489+
"task_id": "4564",
490+
"task_name": "NetBSD",
491+
"patch": 3,
492+
"branch_id": 567,
493+
"position": 4,
494+
"status": "CREATED",
495+
"created": "2025-01-26T22:29:09.156",
496+
"modified": "2025-01-26T22:29:09.156"
497+
}
498+
},
499+
{
500+
"model": "commitfest.cfbottask",
501+
"pk": 7,
502+
"fields": {
503+
"task_id": "4565",
504+
"task_name": "Linux Valgrind",
505+
"patch": 3,
506+
"branch_id": 567,
507+
"position": 5,
508+
"status": "SCHEDULED",
509+
"created": "2025-01-26T22:30:03.199",
510+
"modified": "2025-01-26T22:30:03.199"
511+
}
372512
}
373513
]

pgcommitfest/commitfest/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ class CfbotBranch(models.Model):
382382
modified = models.DateTimeField(auto_now=True)
383383

384384
def save(self, *args, **kwargs):
385+
"""Only used by the admin panel to save empty commit id as NULL
386+
387+
The actual cfbot webhook doesn't use the django ORM to save the data.
388+
"""
389+
385390
if not self.commit_id:
386391
self.commit_id = None
387392
super(CfbotBranch, self).save(*args, **kwargs)

0 commit comments

Comments
 (0)