Skip to content

Commit 5c63292

Browse files
authored
Merge pull request #1102 from makeplane/stage-release
promote: stage-release to master
2 parents 563bb12 + 7c90351 commit 5c63292

File tree

325 files changed

+17570
-7557
lines changed

Some content is hidden

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

325 files changed

+17570
-7557
lines changed

apps/app/.env.example renamed to .env.example

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Replace with your instance Public IP
2-
# NEXT_PUBLIC_API_BASE_URL = "http://localhost"
32
NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS=
43
NEXT_PUBLIC_GOOGLE_CLIENTID=""
54
NEXT_PUBLIC_GITHUB_APP_NAME=""
@@ -10,3 +9,12 @@ NEXT_PUBLIC_ENABLE_SENTRY=0
109
NEXT_PUBLIC_ENABLE_SESSION_RECORDER=0
1110
NEXT_PUBLIC_TRACK_EVENTS=0
1211
NEXT_PUBLIC_SLACK_CLIENT_ID=""
12+
EMAIL_HOST=""
13+
EMAIL_HOST_USER=""
14+
EMAIL_HOST_PASSWORD=""
15+
AWS_REGION=""
16+
AWS_ACCESS_KEY_ID=""
17+
AWS_SECRET_ACCESS_KEY=""
18+
AWS_S3_BUCKET_NAME=""
19+
OPENAI_API_KEY=""
20+
GPT_ENGINE=""
Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Api Server Docker Image
1+
name: Build and Push Backend Docker Image
22

33
on:
44
push:
@@ -10,11 +10,8 @@ on:
1010

1111
jobs:
1212
build_push_backend:
13-
name: Build Api Server Docker Image
13+
name: Build and Push Api Server Docker Image
1414
runs-on: ubuntu-20.04
15-
permissions:
16-
contents: read
17-
packages: write
1815

1916
steps:
2017
- name: Check out the repo
@@ -28,20 +25,45 @@ jobs:
2825
- name: Set up Docker Buildx
2926
uses: docker/[email protected]
3027

31-
- name: Login to Github Container Registry
28+
- name: Login to GitHub Container Registry
3229
uses: docker/[email protected]
3330
with:
3431
registry: "ghcr.io"
3532
username: ${{ github.actor }}
3633
password: ${{ secrets.GITHUB_TOKEN }}
3734

38-
- name: Extract metadata (tags, labels) for Docker
39-
id: meta
35+
- name: Login to Docker Hub
36+
uses: docker/[email protected]
37+
with:
38+
registry: "registry.hub.docker.com"
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
41+
42+
- name: Extract metadata (tags, labels) for Docker (Docker Hub)
43+
id: ghmeta
44+
uses: docker/[email protected]
45+
with:
46+
images: makeplane/plane-backend
47+
48+
- name: Extract metadata (tags, labels) for Docker (Github)
49+
id: dkrmeta
4050
uses: docker/[email protected]
4151
with:
4252
images: ghcr.io/${{ github.repository }}-backend
4353

44-
- name: Build Api Server
54+
- name: Build and Push to GitHub Container Registry
55+
uses: docker/[email protected]
56+
with:
57+
context: ./apiserver
58+
file: ./apiserver/Dockerfile.api
59+
platforms: linux/arm64,linux/amd64
60+
push: true
61+
cache-from: type=gha
62+
cache-to: type=gha
63+
tags: ${{ steps.ghmeta.outputs.tags }}
64+
labels: ${{ steps.ghmeta.outputs.labels }}
65+
66+
- name: Build and Push to Docker Hub
4567
uses: docker/[email protected]
4668
with:
4769
context: ./apiserver
@@ -50,5 +72,6 @@ jobs:
5072
push: true
5173
cache-from: type=gha
5274
cache-to: type=gha
53-
tags: ${{ steps.meta.outputs.tags }}
54-
labels: ${{ steps.meta.outputs.labels }}
75+
tags: ${{ steps.dkrmeta.outputs.tags }}
76+
labels: ${{ steps.dkrmeta.outputs.labels }}
77+

.github/workflows/push-image-frontend.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Frontend Docker Image
1+
name: Build and Push Frontend Docker Image
22

33
on:
44
push:
@@ -12,9 +12,6 @@ jobs:
1212
build_push_frontend:
1313
name: Build Frontend Docker Image
1414
runs-on: ubuntu-20.04
15-
permissions:
16-
contents: read
17-
packages: write
1815

1916
steps:
2017
- name: Check out the repo
@@ -35,13 +32,38 @@ jobs:
3532
username: ${{ github.actor }}
3633
password: ${{ secrets.GITHUB_TOKEN }}
3734

38-
- name: Extract metadata (tags, labels) for Docker
35+
- name: Login to Docker Hub
36+
uses: docker/[email protected]
37+
with:
38+
registry: "registry.hub.docker.com"
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
41+
42+
- name: Extract metadata (tags, labels) for Docker (Docker Hub)
43+
id: ghmeta
44+
uses: docker/[email protected]
45+
with:
46+
images: makeplane/plane-frontend
47+
48+
- name: Extract metadata (tags, labels) for Docker (Github)
3949
id: meta
4050
uses: docker/[email protected]
4151
with:
4252
images: ghcr.io/${{ github.repository }}-frontend
4353

44-
- name: Build Frontend Server
54+
- name: Build and Push to GitHub Container Registry
55+
uses: docker/[email protected]
56+
with:
57+
context: .
58+
file: ./apps/app/Dockerfile.web
59+
platforms: linux/arm64,linux/amd64
60+
push: true
61+
cache-from: type=gha
62+
cache-to: type=gha
63+
tags: ${{ steps.ghmeta.outputs.tags }}
64+
labels: ${{ steps.ghmeta.outputs.labels }}
65+
66+
- name: Build and Push to Docker Container Registry
4567
uses: docker/[email protected]
4668
with:
4769
context: .
@@ -50,5 +72,6 @@ jobs:
5072
push: true
5173
cache-from: type=gha
5274
cache-to: type=gha
53-
tags: ${{ steps.meta.outputs.tags }}
54-
labels: ${{ steps.meta.outputs.labels }}
75+
tags: ${{ steps.dkrmeta.outputs.tags }}
76+
labels: ${{ steps.dkrmeta.outputs.labels }}
77+

Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ RUN apk add --no-cache libc6-compat
33
RUN apk update
44
# Set working directory
55
WORKDIR /app
6+
ENV NEXT_PUBLIC_API_BASE_URL=http://NEXT_PUBLIC_API_BASE_URL_PLACEHOLDER
67

78
RUN yarn global add turbo
89
COPY . .
@@ -16,7 +17,7 @@ FROM node:18-alpine AS installer
1617
RUN apk add --no-cache libc6-compat
1718
RUN apk update
1819
WORKDIR /app
19-
20+
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
2021
# First install the dependencies (as they change less often)
2122
COPY .gitignore .gitignore
2223
COPY --from=builder /app/out/json/ .
@@ -26,9 +27,16 @@ RUN yarn install
2627
# Build the project
2728
COPY --from=builder /app/out/full/ .
2829
COPY turbo.json turbo.json
30+
COPY replace-env-vars.sh /usr/local/bin/
31+
USER root
32+
RUN chmod +x /usr/local/bin/replace-env-vars.sh
2933

3034
RUN yarn turbo run build --filter=app
3135

36+
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \
37+
BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
38+
39+
RUN /usr/local/bin/replace-env-vars.sh http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER ${NEXT_PUBLIC_API_BASE_URL}
3240

3341
FROM python:3.11.1-alpine3.17 AS backend
3442

@@ -108,6 +116,16 @@ COPY nginx/nginx-single-docker-image.conf /etc/nginx/http.d/default.conf
108116

109117
COPY nginx/supervisor.conf /code/supervisor.conf
110118

119+
ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
120+
ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \
121+
BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL
122+
123+
USER root
124+
COPY replace-env-vars.sh /usr/local/bin/
125+
COPY start.sh /usr/local/bin/
126+
RUN chmod +x /usr/local/bin/replace-env-vars.sh
127+
RUN chmod +x /usr/local/bin/start.sh
128+
111129

112130
CMD ["supervisord","-c","/code/supervisor.conf"]
113131

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</a>
2727
</p>
2828

29-
Meet Plane. An open-source software development tool to manage issues, sprints, and product roadmaps with peace of mind 🧘‍♀️.
29+
Meet [Plane](https://plane.so). An open-source software development tool to manage issues, sprints, and product roadmaps with peace of mind 🧘‍♀️.
3030

3131

3232
> Plane is still in its early days, not everything will be perfect yet, and hiccups may happen. Please let us know of any suggestions, ideas, or bugs that you encounter on our [Discord](https://discord.com/invite/A92xrEGCge) or GitHub issues, and we will use your feedback to improve on our upcoming releases.
@@ -58,11 +58,18 @@ cd plane
5858

5959
> If running in a cloud env replace localhost with public facing IP address of the VM
6060
61+
- Export Environment Variables
62+
63+
```bash
64+
set -a
65+
source .env
66+
set +a
67+
```
6168

6269
- Run Docker compose up
6370

6471
```bash
65-
docker-compose up
72+
docker-compose -f docker-compose-hub.yml up
6673
```
6774

6875
<strong>You can use the default email and password for your first login `[email protected]` and `password123`.</strong>
@@ -128,7 +135,7 @@ To see how to Contribute, visit [here](https://github.com/makeplane/plane/blob/m
128135

129136
The Plane community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.
130137

131-
To chat with other community members you can join the [Plane Discord](https://discord.com/invite/q9HKAdau).
138+
To chat with other community members you can join the [Plane Discord](https://discord.com/invite/A92xrEGCge).
132139

133140
Our [Code of Conduct](https://github.com/makeplane/plane/blob/master/CODE_OF_CONDUCT.md) applies to all Plane community channels.
134141

apiserver/.env.example

Lines changed: 0 additions & 28 deletions
This file was deleted.

apiserver/back_migration.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,21 @@ def update_integration_verified():
204204
Integration.objects.bulk_update(
205205
updated_integrations, ["verified"], batch_size=10
206206
)
207-
print("Sucess")
207+
print("Success")
208+
except Exception as e:
209+
print(e)
210+
print("Failed")
211+
212+
213+
def update_start_date():
214+
try:
215+
issues = Issue.objects.filter(state__group__in=["started", "completed"])
216+
updated_issues = []
217+
for issue in issues:
218+
issue.start_date = issue.created_at.date()
219+
updated_issues.append(issue)
220+
Issue.objects.bulk_update(updated_issues, ["start_date"], batch_size=500)
221+
print("Success")
208222
except Exception as e:
209223
print(e)
210224
print("Failed")

apiserver/plane/api/serializers/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@
7070
from .page import PageSerializer, PageBlockSerializer, PageFavoriteSerializer
7171

7272
from .estimate import EstimateSerializer, EstimatePointSerializer, EstimateReadSerializer
73+
74+
from .analytic import AnalyticViewSerializer
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from .base import BaseSerializer
2+
from plane.db.models import AnalyticView
3+
from plane.utils.issue_filters import issue_filters
4+
5+
6+
class AnalyticViewSerializer(BaseSerializer):
7+
class Meta:
8+
model = AnalyticView
9+
fields = "__all__"
10+
read_only_fields = [
11+
"workspace",
12+
"query",
13+
]
14+
15+
def create(self, validated_data):
16+
query_params = validated_data.get("query_dict", {})
17+
if bool(query_params):
18+
validated_data["query"] = issue_filters(query_params, "POST")
19+
else:
20+
validated_data["query"] = dict()
21+
return AnalyticView.objects.create(**validated_data)
22+
23+
def update(self, instance, validated_data):
24+
query_params = validated_data.get("query_data", {})
25+
if bool(query_params):
26+
validated_data["query"] = issue_filters(query_params, "POST")
27+
else:
28+
validated_data["query"] = dict()
29+
validated_data["query"] = issue_filters(query_params, "PATCH")
30+
return super().update(instance, validated_data)

apiserver/plane/api/serializers/cycle.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,32 @@ class CycleSerializer(BaseSerializer):
1919
started_issues = serializers.IntegerField(read_only=True)
2020
unstarted_issues = serializers.IntegerField(read_only=True)
2121
backlog_issues = serializers.IntegerField(read_only=True)
22+
assignees = serializers.SerializerMethodField(read_only=True)
23+
total_estimates = serializers.IntegerField(read_only=True)
24+
completed_estimates = serializers.IntegerField(read_only=True)
25+
started_estimates = serializers.IntegerField(read_only=True)
2226

2327
workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace")
2428
project_detail = ProjectLiteSerializer(read_only=True, source="project")
2529

30+
def get_assignees(self, obj):
31+
members = [
32+
{
33+
"avatar": assignee.avatar,
34+
"first_name": assignee.first_name,
35+
"id": assignee.id,
36+
}
37+
for issue_cycle in obj.issue_cycle.all()
38+
for assignee in issue_cycle.issue.assignees.all()
39+
]
40+
# Use a set comprehension to return only the unique objects
41+
unique_objects = {frozenset(item.items()) for item in members}
42+
43+
# Convert the set back to a list of dictionaries
44+
unique_list = [dict(item) for item in unique_objects]
45+
46+
return unique_list
47+
2648
class Meta:
2749
model = Cycle
2850
fields = "__all__"

0 commit comments

Comments
 (0)