Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c56aacd
dev: create action to sync PR changes to the repo (#2333)
pablohashescobar Oct 2, 2023
7eba4a5
fix: ui package readme added (#2334)
sriramveeraghanta Oct 2, 2023
c969609
fix: variable name for token (#2336)
pablohashescobar Oct 2, 2023
de33e67
dev: update add permissions to the action (#2337)
pablohashescobar Oct 2, 2023
6d463de
dev: rename token variables (#2338)
pablohashescobar Oct 2, 2023
0d0cf30
fix: updated readme fixes (#2339)
sriramveeraghanta Oct 2, 2023
d9bd078
dev: update sync workflow to run only when the source repo is configu…
pablohashescobar Oct 3, 2023
cecdf89
fix: issue relation mutation and draft issue (#2340)
dakshesh14 Oct 4, 2023
db1bcdb
fix: sync workflow fixes (#2365)
sriramveeraghanta Oct 4, 2023
4017f6b
fix: sync job pr description escaped values fix (#2366)
sriramveeraghanta Oct 4, 2023
981e2aa
Update index.tsx (#2343)
luis-cruzt Oct 4, 2023
eacf543
dev: update apiserver configuration files (#2348)
pablohashescobar Oct 4, 2023
1e9149d
fix: themening validation in store init. (#2350)
gurusainath Oct 4, 2023
fb6f645
chore: member can change role (#2371)
NarayanBavisetti Oct 4, 2023
c2f0ae1
chore: removed the issue draft log from my profile (#2368)
NarayanBavisetti Oct 4, 2023
7a3b556
adding sync info in pr title (#2373)
sriramveeraghanta Oct 4, 2023
05920a7
chore: layout access validation and switch in plane deploy issues rou…
gurusainath Oct 4, 2023
7bdca9c
show current version in the help section dropdown (#2353)
aaryan610 Oct 4, 2023
d0a51d7
fix: table menu positioning (#2354)
aaryan610 Oct 4, 2023
48c65c9
fix: handle cross project issues in the sub-issues. (#2357)
gurusainath Oct 4, 2023
ea2c1e2
fix: login process validation based on api config (#2361)
sriramveeraghanta Oct 4, 2023
18bcf55
dev: configuration endpoint for frontend client (#2355)
pablohashescobar Oct 4, 2023
9482cc3
fix: 404 when redirecting user clicks on Sign In button (#2349)
dakshesh14 Oct 4, 2023
4ec2811
fix: project setting member role validation (#2369)
anmolsinghbhatia Oct 4, 2023
64af5e2
chore: project covers endpoint (#2370)
pablohashescobar Oct 4, 2023
77c1b90
feat: default project cover images tab on the change cover popover (#…
aaryan610 Oct 4, 2023
1c43d31
chore: remove unnecessary OAuth envs (#2378)
aaryan610 Oct 4, 2023
62035f3
fix: added user store variables in mobx store observable (#2380)
gurusainath Oct 5, 2023
85147db
fix: state group icons (#2381)
aaryan610 Oct 5, 2023
67922f9
fix: removed default theme setting in the index page (#2382)
gurusainath Oct 5, 2023
af61054
Merge pull request #2384 from makeplane/develop
sriramveeraghanta Oct 5, 2023
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
77 changes: 77 additions & 0 deletions .github/workflows/create-sync-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Create PR in Plane EE Repository to sync the changes

on:
pull_request:
types:
- closed

jobs:
create_pr:
# Only run the job when a PR is merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Check SOURCE_REPO
id: check_repo
env:
SOURCE_REPO: ${{ secrets.SOURCE_REPO_NAME }}
run: |
echo "::set-output name=is_correct_repo::$(if [[ "$SOURCE_REPO" == "makeplane/plane" ]]; then echo 'true'; else echo 'false'; fi)"

- name: Checkout Code
if: steps.check_repo.outputs.is_correct_repo == 'true'
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Branch Name
if: steps.check_repo.outputs.is_correct_repo == 'true'
run: |
echo "SOURCE_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV

- name: Setup GH CLI
if: steps.check_repo.outputs.is_correct_repo == 'true'
run: |
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y

- name: Create Pull Request
if: steps.check_repo.outputs.is_correct_repo == 'true'
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
TARGET_REPO="${{ secrets.TARGET_REPO_NAME }}"
TARGET_BRANCH="${{ secrets.TARGET_REPO_BRANCH }}"
SOURCE_BRANCH="${{ env.SOURCE_BRANCH_NAME }}"

git checkout $SOURCE_BRANCH
git remote add target "https://$GH_TOKEN@github.com/$TARGET_REPO.git"
git push target $SOURCE_BRANCH:$SOURCE_BRANCH

PR_TITLE="${{ github.event.pull_request.title }}"
PR_BODY="${{ github.event.pull_request.body }}"

# Remove double quotes
PR_TITLE_CLEANED="${PR_TITLE//\"/}"
PR_BODY_CLEANED="${PR_BODY//\"/}"

# Construct PR_BODY_CONTENT using a here-document
PR_BODY_CONTENT=$(cat <<EOF
$PR_BODY_CLEANED
EOF
)

gh pr create \
--base $TARGET_BRANCH \
--head $SOURCE_BRANCH \
--title "[SYNC] $PR_TITLE_CLEANED" \
--body "$PR_BODY_CONTENT" \
--repo $TARGET_REPO
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ chmod +x setup.sh
- Run setup.sh

```bash
./setup.sh http://localhost
./setup.sh
```

> If running in a cloud env replace localhost with public facing IP address of the VM
Expand Down
13 changes: 12 additions & 1 deletion apiserver/.env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Backend
# Debug value for api server use it as 0 for production use
DEBUG=0
DJANGO_SETTINGS_MODULE="plane.settings.selfhosted"
DJANGO_SETTINGS_MODULE="plane.settings.production"

# Error logs
SENTRY_DSN=""
Expand Down Expand Up @@ -59,3 +59,14 @@ DEFAULT_PASSWORD="password123"

# SignUps
ENABLE_SIGNUP="1"


# Enable Email/Password Signup
ENABLE_EMAIL_PASSWORD="1"

# Enable Magic link Login
ENABLE_MAGIC_LINK_LOGIN="0"

# Email redirections and minio domain settings
WEB_URL="http://localhost"

34 changes: 26 additions & 8 deletions apiserver/plane/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
ProjectIdentifierEndpoint,
ProjectFavoritesViewSet,
LeaveProjectEndpoint,
ProjectPublicCoverImagesEndpoint,
## End Projects
# Issues
IssueViewSet,
Expand Down Expand Up @@ -150,12 +151,11 @@
GlobalSearchEndpoint,
IssueSearchEndpoint,
## End Search
# Gpt
# External
GPTIntegrationEndpoint,
## End Gpt
# Release Notes
ReleaseNotesEndpoint,
## End Release Notes
UnsplashEndpoint,
## End External
# Inbox
InboxViewSet,
InboxIssueViewSet,
Expand Down Expand Up @@ -186,6 +186,9 @@
## Exporter
ExportIssuesEndpoint,
## End Exporter
# Configuration
ConfigurationEndpoint,
## End Configuration
)


Expand Down Expand Up @@ -573,6 +576,11 @@
LeaveProjectEndpoint.as_view(),
name="project",
),
path(
"project-covers/",
ProjectPublicCoverImagesEndpoint.as_view(),
name="project-covers",
),
# End Projects
# States
path(
Expand Down Expand Up @@ -1446,20 +1454,23 @@
name="project-issue-search",
),
## End Search
# Gpt
# External
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/ai-assistant/",
GPTIntegrationEndpoint.as_view(),
name="importer",
),
## End Gpt
# Release Notes
path(
"release-notes/",
ReleaseNotesEndpoint.as_view(),
name="release-notes",
),
## End Release Notes
path(
"unsplash/",
UnsplashEndpoint.as_view(),
name="release-notes",
),
## End External
# Inbox
path(
"workspaces/<str:slug>/projects/<uuid:project_id>/inboxes/",
Expand Down Expand Up @@ -1728,4 +1739,11 @@
name="workspace-project-boards",
),
## End Public Boards
# Configuration
path(
"configs/",
ConfigurationEndpoint.as_view(),
name="configuration",
),
## End Configuration
]
10 changes: 5 additions & 5 deletions apiserver/plane/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ProjectMemberEndpoint,
WorkspaceProjectDeployBoardEndpoint,
LeaveProjectEndpoint,
ProjectPublicCoverImagesEndpoint,
)
from .user import (
UserEndpoint,
Expand Down Expand Up @@ -147,16 +148,13 @@
from .search import GlobalSearchEndpoint, IssueSearchEndpoint


from .gpt import GPTIntegrationEndpoint
from .external import GPTIntegrationEndpoint, ReleaseNotesEndpoint, UnsplashEndpoint

from .estimate import (
ProjectEstimatePointEndpoint,
BulkEstimatePointEndpoint,
)


from .release import ReleaseNotesEndpoint

from .inbox import InboxViewSet, InboxIssueViewSet, InboxIssuePublicViewSet

from .analytic import (
Expand All @@ -169,4 +167,6 @@

from .notification import NotificationViewSet, UnreadNotificationEndpoint, MarkAllReadNotificationViewSet

from .exporter import ExportIssuesEndpoint
from .exporter import ExportIssuesEndpoint

from .config import ConfigurationEndpoint
40 changes: 40 additions & 0 deletions apiserver/plane/api/views/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Python imports
import os

# Django imports
from django.conf import settings

# Third party imports
from rest_framework.permissions import AllowAny
from rest_framework import status
from rest_framework.response import Response
from sentry_sdk import capture_exception

# Module imports
from .base import BaseAPIView


class ConfigurationEndpoint(BaseAPIView):
permission_classes = [
AllowAny,
]

def get(self, request):
try:
data = {}
data["google"] = os.environ.get("GOOGLE_CLIENT_ID", None)
data["github"] = os.environ.get("GITHUB_CLIENT_ID", None)
data["github_app_name"] = os.environ.get("GITHUB_APP_NAME", None)
data["magic_login"] = (
bool(settings.EMAIL_HOST_USER) and bool(settings.EMAIL_HOST_PASSWORD)
) and os.environ.get("ENABLE_MAGIC_LINK_LOGIN", "0") == "1"
data["email_password_login"] = (
os.environ.get("ENABLE_EMAIL_PASSWORD", "0") == "1"
)
return Response(data, status=status.HTTP_200_OK)
except Exception as e:
capture_exception(e)
return Response(
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import requests

# Third party imports
import openai
from rest_framework.response import Response
from rest_framework import status
import openai
from rest_framework.permissions import AllowAny
from sentry_sdk import capture_exception

# Django imports
Expand All @@ -15,6 +16,7 @@
from plane.api.permissions import ProjectEntityPermission
from plane.db.models import Workspace, Project
from plane.api.serializers import ProjectLiteSerializer, WorkspaceLiteSerializer
from plane.utils.integrations.github import get_release_notes


class GPTIntegrationEndpoint(BaseAPIView):
Expand Down Expand Up @@ -73,3 +75,44 @@ def post(self, request, slug, project_id):
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)


class ReleaseNotesEndpoint(BaseAPIView):
def get(self, request):
try:
release_notes = get_release_notes()
return Response(release_notes, status=status.HTTP_200_OK)
except Exception as e:
capture_exception(e)
return Response(
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)


class UnsplashEndpoint(BaseAPIView):

def get(self, request):
try:
query = request.GET.get("query", False)
page = request.GET.get("page", 1)
per_page = request.GET.get("per_page", 20)

url = (
f"https://api.unsplash.com/search/photos/?client_id={settings.UNSPLASH_ACCESS_KEY}&query={query}&page=${page}&per_page={per_page}"
if query
else f"https://api.unsplash.com/photos/?client_id={settings.UNSPLASH_ACCESS_KEY}&page={page}&per_page={per_page}"
)

headers = {
"Content-Type": "application/json",
}

resp = requests.get(url=url, headers=headers)
return Response(resp.json(), status=status.HTTP_200_OK)
except Exception as e:
capture_exception(e)
return Response(
{"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST,
)
Loading