Skip to content
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

[Integration][Clickup] Add clickup integration #768

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
153 changes: 153 additions & 0 deletions integrations/clickup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
1 change: 1 addition & 0 deletions integrations/clickup/.port/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
137 changes: 137 additions & 0 deletions integrations/clickup/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
[
{
"identifier": "clickupTeam",
"description": "This blueprint represents a Clickup team",
"title": "Clickup Team",
"icon": "Clickup",
"schema": {
"properties": {
"url": {
"type": "string",
"title": "URL",
"format": "url"
},
"members": {
"type": "array",
"title": "Members",
"items": {
"type": "string",
"format": "user"
}
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
},
{
"identifier": "clickupProject",
"description": "This blueprint represents a ClickUp project",
"title": "ClickUp Project",
"icon": "Clickup",
"schema": {
"properties": {
"url": {
"title": "Project URL",
"type": "string",
"format": "url",
"description": "URL to the project in Clickup"
},
"startDate": {
"title": "Project start date",
"type": "string",
"format": "date-time",
"description": "The start date of this project"
},
"endDate": {
"title": "Project end date",
"type": "string",
"format": "date-time",
"description": "The end date of this project"
},
"totalIssues": {
"title": "Total Issues",
"type": "number",
"description": "The total number of issues in the project"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"team": {
"title": "Team",
"target": "clickupTeam",
"required": false,
"many": false
}
}
},
{
"identifier": "clickupIssue",
"title": "ClickUp Issue",
"icon": "Clickup",
"schema": {
"properties": {
"url": {
"title": "Issue URL",
"type": "string",
"format": "url",
"description": "URL to the issue in Clickup"
},
"status": {
"title": "Status",
"type": "string",
"description": "The status of the issue"
},
"assignee": {
"title": "Assignee",
"type": "string",
"format": "user",
"description": "The user assigned to the issue"
},
"creator": {
"title": "Creator",
"type": "string",
"description": "The user that created to the issue",
"format": "user"
},
"priority": {
"title": "Priority",
"type": "string",
"description": "The priority of the issue"
},
"created": {
"title": "Created At",
"type": "string",
"description": "The created datetime of the issue",
"format": "date-time"
},
"updated": {
"title": "Updated At",
"type": "string",
"description": "The updated datetime of the issue",
"format": "date-time"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"project": {
"title": "Project",
"description": "The Clickup project that manages this issue",
"target": "clickupProject",
"required": false,
"many": false
}
}
}
]
49 changes: 49 additions & 0 deletions integrations/clickup/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: team
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"clickupTeam"'
identifier: .id | tostring
title: .name
properties:
url: "\"https://app.clickup.com/\" + .id + \"/home\""
members: '[.members[].user.email]'
- kind: project
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"clickupProject"'
identifier: .id | tostring
title: .name
properties:
url: "\"https://app.clickup.com/\" + .team_id + \"/v/l/li/\" + .id"
startDate: .start_date | tonumber / 1000 | todate
endDate: .due_date | tonumber / 1000 | todate
totalIssues: .task_count
relations:
team: .__team_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too specific, should have added an option to see all the team object, this will allow extensibility in the future

- kind: issue
selector:
query: 'true'
port:
entity:
mappings:
blueprint: '"clickupIssue"'
identifier: .id | tostring
title: .name
properties:
url: .url
status: .status.status
assignee: .assignees | map(.email) | first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not all assignees? having all the list will allow seeing the distribution and spread work inside port between the different assignees, while only setting the first, might be misleading as it can be ordered alphabetically

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a pre-defined blueprint and was advised to not modify. I can adjust it to take in all assignees

creator: .creator.email
priority: .priority.priority
created: .date_created | tonumber / 1000 | todate
updated: .date_updated | tonumber / 1000 | todate
project: .list.id
20 changes: 20 additions & 0 deletions integrations/clickup/.port/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: Clickup integration for Port Ocean
icon: Clickup
docs: https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/clickup
features:
- type: exporter
section: Project management
resources:
- kind: team
- kind: project
- kind: issue
configurations:
- name: appHost
required: false
type: url
description: "The host of the Port Ocean app. Used to set up the integration endpoint as the target for Webhooks created in Clickup"
- name: clickupPersonalToken
required: true
type: string
description: "Clickup personal token used to query the Clickup API"
sensitive: true
14 changes: 14 additions & 0 deletions integrations/clickup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- towncrier release notes start -->
DeeStarks marked this conversation as resolved.
Show resolved Hide resolved

# Port_Ocean 0.1.0 (2024-07-03)

### Features

- Added Jira integration with support for projects and issues (0.1.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a clickup integration not Jira integration

15 changes: 15 additions & 0 deletions integrations/clickup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.11-slim-bookworm

ENV LIBRDKAFKA_VERSION 1.9.2

WORKDIR /app

RUN apt update && \
apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \
apt-get clean

COPY . /app

RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge

ENTRYPOINT ocean sail
Loading