Skip to content

Add a Parking Lot (Drafts) #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions media/commitfest/js/commitfest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ function verify_next() {
'Are you sure you want to move this patch to the next commitfest?\n\nThis means the patch will be marked as closed in this commitfest, but will automatically be moved to the next one. If no further work is expected on this patch, it should be closed with "Rejected" or "Returned with Feedback" instead.\n\nSo - are you sure?',
);
}
function verify_draft() {
return confirm(
'Are you sure you want to move this patch to Drafts?\n\nThis means the patch will be marked as closed in this commitfest. Its status will be reset to Waiting on Author, and it will remain in Drafts until it is closed or moved to the next open commitfest.\n\nSo - are you sure?',
);
}
function findLatestThreads() {
$("#attachThreadListWrap").addClass("loading");
$("#attachThreadSearchButton").addClass("disabled");
Expand Down
7 changes: 1 addition & 6 deletions pgcommitfest/commitfest/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ def item_description(self, item):
)

def item_link(self, item):
if self.cfid:
return "https://commitfest.postgresql.org/{0}/{1}/".format(
self.cfid, item["patchid"]
)
else:
return "https://commitfest.postgresql.org/{cfid}/{patchid}/".format(**item)
return "https://commitfest.postgresql.org/patch/{0}/".format(item["patchid"])

def item_pubdate(self, item):
return item["date"]
2 changes: 1 addition & 1 deletion pgcommitfest/commitfest/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, data, *args, **kwargs):

self.fields["sortkey"].widget = forms.HiddenInput()

c = [(-1, "* All")] + list(PatchOnCommitFest._STATUS_CHOICES)
c = [(-1, "* All"), (-2, "* Open")] + list(PatchOnCommitFest._STATUS_CHOICES)
self.fields["status"] = forms.ChoiceField(choices=c, required=False)

userchoices = [(-1, "* All"), (-2, "* None"), (-3, "* Yourself")]
Expand Down
46 changes: 46 additions & 0 deletions pgcommitfest/commitfest/migrations/0011_patch_status_draft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generated by Django 4.2.19 on 2025-03-07 23:55

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("commitfest", "0010_add_failing_since_column"),
]

operations = [
migrations.AlterField(
model_name="patchoncommitfest",
name="status",
field=models.IntegerField(
choices=[
(1, "Needs review"),
(2, "Waiting on Author"),
(3, "Ready for Committer"),
(4, "Committed"),
(5, "Moved to next CF"),
(6, "Rejected"),
(7, "Returned with feedback"),
(8, "Withdrawn"),
(9, "Moved to Drafts"),
],
default=1,
),
),
migrations.RunSQL("""
INSERT INTO commitfest_patchstatus (status, statusstring, sortkey) VALUES
(1,'Needs review',10),
(2,'Waiting on Author',15),
(3,'Ready for Committer',20),
(4,'Committed',25),
(5,'Moved to next CF',30),
(6,'Rejected',50),
(7,'Returned with Feedback',50),
(8,'Withdrawn', 50),
(9,'Moved to Drafts', 30)
ON CONFLICT (status) DO UPDATE SET statusstring=excluded.statusstring, sortkey=excluded.sortkey;
"""),
migrations.RunSQL(
"DELETE FROM commitfest_patchstatus WHERE status < 1 OR status > 9"
),
]
26 changes: 26 additions & 0 deletions pgcommitfest/commitfest/migrations/0012_commitfest_status_draft.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.2.19 on 2025-03-08 03:56

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("commitfest", "0011_patch_status_draft"),
]

operations = [
migrations.AlterField(
model_name="commitfest",
name="status",
field=models.IntegerField(
choices=[
(1, "Future"),
(2, "Open"),
(3, "In Progress"),
(4, "Closed"),
(5, "Drafts"),
],
default=1,
),
),
]
16 changes: 16 additions & 0 deletions pgcommitfest/commitfest/migrations/0013_add_drafts_cf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.19 on 2025-03-10 16:28

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("commitfest", "0012_commitfest_status_draft"),
]

operations = [
migrations.RunSQL("""
INSERT INTO commitfest_commitfest (id, name, status)
VALUES (0, 'Drafts', 5);
"""),
]
8 changes: 7 additions & 1 deletion pgcommitfest/commitfest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,20 @@ class CommitFest(models.Model):
STATUS_OPEN = 2
STATUS_INPROGRESS = 3
STATUS_CLOSED = 4
STATUS_DRAFT = 5
_STATUS_CHOICES = (
(STATUS_FUTURE, "Future"),
(STATUS_OPEN, "Open"),
(STATUS_INPROGRESS, "In Progress"),
(STATUS_CLOSED, "Closed"),
(STATUS_DRAFT, "Drafts"),
)
_STATUS_LABELS = (
(STATUS_FUTURE, "default"),
(STATUS_OPEN, "info"),
(STATUS_INPROGRESS, "success"),
(STATUS_CLOSED, "danger"),
(STATUS_DRAFT, "info"),
)
name = models.CharField(max_length=100, blank=False, null=False, unique=True)
status = models.IntegerField(
Expand Down Expand Up @@ -159,7 +162,7 @@ class Patch(models.Model, DiffableModel):
}

def current_commitfest(self):
return self.commitfests.order_by("-startdate").first()
return self.commitfests.order_by("-patchoncommitfest__enterdate").first()

def current_patch_on_commitfest(self):
cf = self.current_commitfest()
Expand Down Expand Up @@ -228,6 +231,7 @@ class PatchOnCommitFest(models.Model):
STATUS_REJECTED = 6
STATUS_RETURNED = 7
STATUS_WITHDRAWN = 8
STATUS_DRAFT = 9
_STATUS_CHOICES = (
(STATUS_REVIEW, "Needs review"),
(STATUS_AUTHOR, "Waiting on Author"),
Expand All @@ -237,6 +241,7 @@ class PatchOnCommitFest(models.Model):
(STATUS_REJECTED, "Rejected"),
(STATUS_RETURNED, "Returned with feedback"),
(STATUS_WITHDRAWN, "Withdrawn"),
(STATUS_DRAFT, "Moved to Drafts"),
)
_STATUS_LABELS = (
(STATUS_REVIEW, "default"),
Expand All @@ -247,6 +252,7 @@ class PatchOnCommitFest(models.Model):
(STATUS_REJECTED, "danger"),
(STATUS_RETURNED, "danger"),
(STATUS_WITHDRAWN, "danger"),
(STATUS_DRAFT, "warning"),
)
OPEN_STATUSES = [STATUS_REVIEW, STATUS_AUTHOR, STATUS_COMMITTER]

Expand Down
2 changes: 1 addition & 1 deletion pgcommitfest/commitfest/templates/activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<tr>
<td style="white-space: nowrap;">{{a.date}}</td>
<td>{{a.by}}</td>
<td><a href="/{%if commitfest%}{{commitfest.id}}{%else%}{{a.cfid}}{%endif%}/{{a.patchid}}/">{{a.name}}</a></td>
<td><a href="/patch/{{a.patchid}}/">{{a.name}}</a></td>
<td>{{a.what}}</td>
</tr>
{%endfor%}
Expand Down
1 change: 1 addition & 0 deletions pgcommitfest/commitfest/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h3>Commands</h3>
</form>
<h3>List of commitfests</h3>
<ul>
<li><a href="/0/">Drafts</a></li>
{%for c in commitfests%}
<li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}}{%if c.startdate%} - {{c.periodstring}}{%endif%})</li>
{%endfor%}
Expand Down
1 change: 1 addition & 0 deletions pgcommitfest/commitfest/templates/patch_commands.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<li role="presentation"><a href="close/withdrawn/" onclick="return verify_withdrawn()">Withdrawn</a></li>
<li role="presentation"><a href="close/feedback/" onclick="return verify_returned()">Returned with feedback</a></li>
<li role="presentation"><a href="close/next/?cfid={{cf.id}}" onclick="return verify_next()">Move to next CF</a></li>
<li role="presentation"><a href="close/draft/" onclick="return verify_draft()">Move to Drafts</a></li>
<li role="presentation"><a href="close/committed/" onclick="return flagCommitted({%if patch.committer%}'{{patch.committer}}'{%elif is_committer%}'{{user.username}}'{%else%}null{%endif%})">Committed</a></li>
</ul>
</div>
Expand Down
Loading