Skip to content

Commit cc63f67

Browse files
Merge pull request #2143 from makeplane/stage-release
promote: stage-release to master
2 parents 80bcca7 + b8dd9ca commit cc63f67

File tree

147 files changed

+4752
-1203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+4752
-1203
lines changed

.github/workflows/Update_Docker_Images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Docker Images for Plane on Release
22

33
on:
44
release:
5-
types: [released]
5+
types: [released, prereleased]
66

77
jobs:
88
build_push_backend:

apiserver/plane/api/views/gpt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ def post(self, request, slug, project_id):
4141
final_text = task + "\n" + prompt
4242

4343
openai.api_key = settings.OPENAI_API_KEY
44-
response = openai.Completion.create(
44+
response = openai.ChatCompletion.create(
4545
model=settings.GPT_ENGINE,
46-
prompt=final_text,
46+
messages=[{"role": "user", "content": final_text}],
4747
temperature=0.7,
4848
max_tokens=1024,
4949
)
5050

5151
workspace = Workspace.objects.get(slug=slug)
5252
project = Project.objects.get(pk=project_id)
5353

54-
text = response.choices[0].text.strip()
54+
text = response.choices[0].message.content.strip()
5555
text_html = text.replace("\n", "<br/>")
5656
return Response(
5757
{

apiserver/plane/api/views/issue.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ def get_queryset(self):
15751575
)
15761576
)
15771577
.distinct()
1578-
)
1578+
).order_by("created_at")
15791579
else:
15801580
return IssueComment.objects.none()
15811581
except ProjectDeployBoard.DoesNotExist:
@@ -2100,6 +2100,12 @@ def get(self, request, slug, project_id):
21002100
queryset=IssueReaction.objects.select_related("actor"),
21012101
)
21022102
)
2103+
.prefetch_related(
2104+
Prefetch(
2105+
"votes",
2106+
queryset=IssueVote.objects.select_related("actor"),
2107+
)
2108+
)
21032109
.filter(**filters)
21042110
.annotate(cycle_id=F("issue_cycle__cycle_id"))
21052111
.annotate(module_id=F("issue_module__module_id"))
@@ -2189,6 +2195,7 @@ def get(self, request, slug, project_id):
21892195

21902196
states = (
21912197
State.objects.filter(
2198+
~Q(name="Triage"),
21922199
workspace__slug=slug,
21932200
project_id=project_id,
21942201
)

apiserver/plane/api/views/project.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def create(self, request):
482482
# Delete joined project invites
483483
project_invitations.delete()
484484

485-
return Response(status=status.HTTP_200_OK)
485+
return Response(status=status.HTTP_204_NO_CONTENT)
486486
except Exception as e:
487487
capture_exception(e)
488488
return Response(
@@ -924,8 +924,7 @@ def post(self, request, slug, project_id):
924924

925925
project_member.save()
926926

927-
return Response(status=status.HTTP_200_OK)
928-
927+
return Response(status=status.HTTP_204_NO_CONTENT)
929928
except Project.DoesNotExist:
930929
return Response(
931930
{"error": "The requested resource does not exists"},

apiserver/plane/api/views/workspace.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_queryset(self):
116116
)
117117

118118
issue_count = (
119-
Issue.objects.filter(workspace=OuterRef("id"))
119+
Issue.issue_objects.filter(workspace=OuterRef("id"))
120120
.order_by()
121121
.annotate(count=Func(F("id"), function="Count"))
122122
.values("count")
@@ -203,7 +203,7 @@ def get(self, request):
203203
)
204204

205205
issue_count = (
206-
Issue.objects.filter(workspace=OuterRef("id"))
206+
Issue.issue_objects.filter(workspace=OuterRef("id"))
207207
.order_by()
208208
.annotate(count=Func(F("id"), function="Count"))
209209
.values("count")
@@ -532,7 +532,7 @@ def create(self, request):
532532
# Delete joined workspace invites
533533
workspace_invitations.delete()
534534

535-
return Response(status=status.HTTP_200_OK)
535+
return Response(status=status.HTTP_204_NO_CONTENT)
536536
except Exception as e:
537537
capture_exception(e)
538538
return Response(
@@ -846,7 +846,7 @@ def post(self, request, slug):
846846
workspace_member.view_props = request.data.get("view_props", {})
847847
workspace_member.save()
848848

849-
return Response(status=status.HTTP_200_OK)
849+
return Response(status=status.HTTP_204_NO_CONTENT)
850850
except WorkspaceMember.DoesNotExist:
851851
return Response(
852852
{"error": "User not a member of workspace"},
@@ -1075,7 +1075,7 @@ def get(self, request, slug, user_id):
10751075
priority_order = ["urgent", "high", "medium", "low", None]
10761076

10771077
priority_distribution = (
1078-
Issue.objects.filter(
1078+
Issue.issue_objects.filter(
10791079
workspace__slug=slug,
10801080
assignees__in=[user_id],
10811081
project__project_projectmember__member=request.user,

apiserver/plane/bgtasks/issue_automation_task.py

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def archive_old_issues():
3232
archive_in = project.archive_in
3333

3434
# Get all the issues whose updated_at in less that the archive_in month
35-
issues = Issue.objects.filter(
35+
issues = Issue.issue_objects.filter(
3636
Q(
3737
project=project_id,
3838
archived_at__isnull=True,
@@ -64,21 +64,22 @@ def archive_old_issues():
6464
issues_to_update.append(issue)
6565

6666
# Bulk Update the issues and log the activity
67-
updated_issues = Issue.objects.bulk_update(
68-
issues_to_update, ["archived_at"], batch_size=100
69-
)
70-
[
71-
issue_activity.delay(
72-
type="issue.activity.updated",
73-
requested_data=json.dumps({"archived_at": str(issue.archived_at)}),
74-
actor_id=str(project.created_by_id),
75-
issue_id=issue.id,
76-
project_id=project_id,
77-
current_instance=None,
78-
subscriber=False,
67+
if issues_to_update:
68+
updated_issues = Issue.objects.bulk_update(
69+
issues_to_update, ["archived_at"], batch_size=100
7970
)
80-
for issue in updated_issues
81-
]
71+
[
72+
issue_activity.delay(
73+
type="issue.activity.updated",
74+
requested_data=json.dumps({"archived_at": str(issue.archived_at)}),
75+
actor_id=str(project.created_by_id),
76+
issue_id=issue.id,
77+
project_id=project_id,
78+
current_instance=None,
79+
subscriber=False,
80+
)
81+
for issue in updated_issues
82+
]
8283
return
8384
except Exception as e:
8485
if settings.DEBUG:
@@ -99,7 +100,7 @@ def close_old_issues():
99100
close_in = project.close_in
100101

101102
# Get all the issues whose updated_at in less that the close_in month
102-
issues = Issue.objects.filter(
103+
issues = Issue.issue_objects.filter(
103104
Q(
104105
project=project_id,
105106
archived_at__isnull=True,
@@ -136,19 +137,20 @@ def close_old_issues():
136137
issues_to_update.append(issue)
137138

138139
# Bulk Update the issues and log the activity
139-
updated_issues = Issue.objects.bulk_update(issues_to_update, ["state"], batch_size=100)
140-
[
141-
issue_activity.delay(
142-
type="issue.activity.updated",
143-
requested_data=json.dumps({"closed_to": str(issue.state_id)}),
144-
actor_id=str(project.created_by_id),
145-
issue_id=issue.id,
146-
project_id=project_id,
147-
current_instance=None,
148-
subscriber=False,
149-
)
150-
for issue in updated_issues
151-
]
140+
if issues_to_update:
141+
updated_issues = Issue.objects.bulk_update(issues_to_update, ["state"], batch_size=100)
142+
[
143+
issue_activity.delay(
144+
type="issue.activity.updated",
145+
requested_data=json.dumps({"closed_to": str(issue.state_id)}),
146+
actor_id=str(project.created_by_id),
147+
issue_id=issue.id,
148+
project_id=project_id,
149+
current_instance=None,
150+
subscriber=False,
151+
)
152+
for issue in updated_issues
153+
]
152154
return
153155
except Exception as e:
154156
if settings.DEBUG:

apiserver/plane/utils/analytics_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None):
9696
chart_data = {str(date): 0 for date in date_range}
9797

9898
completed_issues_distribution = (
99-
Issue.objects.filter(
99+
Issue.issue_objects.filter(
100100
workspace__slug=slug,
101101
project_id=project_id,
102102
issue_cycle__cycle_id=cycle_id,
@@ -118,7 +118,7 @@ def burndown_plot(queryset, slug, project_id, cycle_id=None, module_id=None):
118118
chart_data = {str(date): 0 for date in date_range}
119119

120120
completed_issues_distribution = (
121-
Issue.objects.filter(
121+
Issue.issue_objects.filter(
122122
workspace__slug=slug,
123123
project_id=project_id,
124124
issue_module__module_id=module_id,

apiserver/requirements/base.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
# base requirements
22

3-
Django==4.2.3
3+
Django==4.2.5
44
django-braces==1.15.0
55
django-taggit==4.0.0
6-
psycopg==3.1.9
6+
psycopg==3.1.10
77
django-oauth-toolkit==2.3.0
88
mistune==3.0.1
99
djangorestframework==3.14.0
1010
redis==4.6.0
1111
django-nested-admin==4.0.2
12-
django-cors-headers==4.1.0
12+
django-cors-headers==4.2.0
1313
whitenoise==6.5.0
14-
django-allauth==0.54.0
14+
django-allauth==0.55.2
1515
faker==18.11.2
1616
django-filter==23.2
1717
jsonmodels==2.6.0
18-
djangorestframework-simplejwt==5.2.2
19-
sentry-sdk==1.27.0
18+
djangorestframework-simplejwt==5.3.0
19+
sentry-sdk==1.30.0
2020
django-s3-storage==0.14.0
2121
django-crum==0.7.9
2222
django-guardian==2.4.0
2323
dj_rest_auth==2.2.5
24-
google-auth==2.21.0
25-
google-api-python-client==2.92.0
24+
google-auth==2.22.0
25+
google-api-python-client==2.97.0
2626
django-redis==5.3.0
27-
uvicorn==0.22.0
27+
uvicorn==0.23.2
2828
channels==4.0.0
29-
openai==0.27.8
29+
openai==0.28.0
3030
slack-sdk==3.21.3
31-
celery==5.3.1
31+
celery==5.3.4
3232
django_celery_beat==2.5.0
33-
psycopg-binary==3.1.9
34-
psycopg-c==3.1.9
33+
psycopg-binary==3.1.10
34+
psycopg-c==3.1.10
3535
scout-apm==2.26.1
3636
openpyxl==3.1.2
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
-r base.txt
22

3-
dj-database-url==2.0.0
4-
gunicorn==20.1.0
3+
dj-database-url==2.1.0
4+
gunicorn==21.2.0
55
whitenoise==6.5.0
6-
django-storages==1.13.2
7-
boto3==1.27.0
8-
django-anymail==10.0
6+
django-storages==1.14
7+
boto3==1.28.40
8+
django-anymail==10.1
99
django-debug-toolbar==4.1.0
1010
gevent==23.7.0
1111
psycogreen==1.0.2

docker-compose-hub.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ services:
8585

8686
plane-worker:
8787
container_name: planebgworker
88-
image: makeplane/plane-worker:latest
88+
image: makeplane/plane-backend:latest
8989
restart: always
9090
command: ./bin/worker
9191
env_file:
@@ -99,7 +99,7 @@ services:
9999

100100
plane-beat-worker:
101101
container_name: planebeatworker
102-
image: makeplane/plane-worker:latest
102+
image: makeplane/plane-backend:latest
103103
restart: always
104104
command: ./bin/beat
105105
env_file:

0 commit comments

Comments
 (0)