integrations/ClickUp: Add ClickUp integration script.#824
integrations/ClickUp: Add ClickUp integration script.#824PieterCK wants to merge 1 commit intozulip:mainfrom
Conversation
48020ab to
2e94184
Compare
fd31255 to
070853e
Compare
|
@zulipbot add "buddy review" |
|
ERROR: Label "buddy review" does not exist and was thus not added to this pull request. |
|
@kennethnrk I think you can also take a look at this one, thank you! |
sbansal1999
left a comment
There was a problem hiding this comment.
@PieterCK I did a review on the main script file, and have left some comments on that.
I will review the test file as well as the documentation soon.
sbansal1999
left a comment
There was a problem hiding this comment.
@PieterCK I have left some comments for the remaining files as well.
Let me know if there are any questions that you have.
|
@zulipbot add "mentor review" |
|
ERROR: Label "mentor review" does not exist and was thus not added to this pull request. |
086d6e7 to
3e848b1
Compare
|
Pushed some updates to address review. Will continue to update the PR in the coming days |
4eefee5 to
2fa6bd7
Compare
|
@sbansal1999 Thanks for the review! I've updated the PR to address your feedback. Most of the changes are self-explanatory and don't require much explanation. For the ones that do, I've pointed them out in the comments where the review is.The two failing tests is a known issue with no solid fix yet. #826 has a couple of commits that can plug off that issue temporarily once merged |
zulip/integrations/clickup/README.md
Outdated
| $ python zulip_clickup.py --clickup-team-id <clickup_team_id> \ | ||
| --clickup-client-id <clickup_client_id> \ | ||
| --clickup-client-secret <clickup_client_secret> \ | ||
| --zulip-webhook-url "GENERATED_WEBHOOK_URL" |
There was a problem hiding this comment.
Change the "GENERATED_WEBHOOK_URL" to match the existing format.
| --zulip-webhook-url "GENERATED_WEBHOOK_URL" | |
| --zulip-webhook-url <zulip_webhook_url> |
2db6547 to
cb86d35
Compare
|
@sbansal1999 hey I've updated the PR as per what we've discussed. please do check them out again, thanks |
| $ python zulip_clickup.py --clickup-team-id <clickup_team_id> \ | ||
| --clickup-client-id <clickup_client_id> \ | ||
| --clickup-client-secret <clickup_client_secret> \ | ||
| --zulip-webhook-url "<zulip_webhook_url>" |
There was a problem hiding this comment.
Quotes can be removed here.
| --zulip-webhook-url "<zulip_webhook_url>" | |
| --zulip-webhook-url <zulip_webhook_url> |
There was a problem hiding this comment.
For the webhook URL, we have to use quotes so it's registered as a string. Without them, the command will run in the background due to the ampersand (&) in the URL. This is also the case for the Trello integration script.
I totally had a great time debugging that the first time around 😃 😃
There was a problem hiding this comment.
Ahh the ampersand will mess things up, thanks for the clarification.
Updated the PR! Thank you Diff: Details+++ b/zulip/integrations/clickup/zulip_clickup.py
@@ -14,11 +14,11 @@ from urllib.parse import parse_qs, urlencode, urljoin, urlparse, urlunparse
from urllib.request import Request, urlopen
EVENT_CHOICES: Dict[str, Tuple[str, Tuple[str, ...]]] = {
- "1": ("task", ("taskCreated", "taskUpdated", "taskDeleted")),
- "2": ("list", ("listCreated", "listUpdated", "listDeleted")),
- "3": ("folder", ("folderCreated", "folderUpdated", "folderDeleted")),
- "4": ("space", ("spaceCreated", "spaceUpdated", "spaceDeleted")),
- "5": ("goal", ("goalCreated", "goalUpdated", "goalDeleted")),
+ "task": ("taskCreated", "taskUpdated", "taskDeleted"),
+ "list": ("listCreated", "listUpdated", "listDeleted"),
+ "folder": ("folderCreated", "folderUpdated", "folderDeleted"),
+ "space": ("spaceCreated", "spaceUpdated", "spaceDeleted"),
+ "goal": ("goalCreated", "goalUpdated", "goalDeleted"),
}
@@ -42,9 +42,8 @@ def process_url(input_url: str, base_url: str) -> str:
def get_event_choices_string() -> str:
choices_string = ""
- for key, value in EVENT_CHOICES.items():
- event, _ = value
- choices_string += f" {key} = {event}\n"
+ for index, key in enumerate(EVENT_CHOICES):
+ choices_string += f" {index+1} = {key}\n"
return choices_string
@@ -207,6 +206,7 @@ related to task, list and folder: 1,2,3
)
querying_user_input: bool = True
selected_events: List[str] = []
+ code_to_event_dict = {i + 1: key for i, key in enumerate(EVENT_CHOICES)}
while querying_user_input:
input_codes_list: str = input("EVENT CODE(s): ")
@@ -215,12 +215,13 @@ related to task, list and folder: 1,2,3
input_is_valid: bool = len(user_input) > 0
exhausted_options: List[str] = []
if "*" in input_codes_list:
- all_events = [event for _, events in EVENT_CHOICES.values() for event in events]
+ all_events = [event for events in EVENT_CHOICES.values() for event in events]
return all_events
for event_code in user_input:
- if event_code in EVENT_CHOICES and event_code not in exhausted_options:
- _, events = EVENT_CHOICES[event_code]
+ event = code_to_event_dict.get(int(event_code))
+ if event in EVENT_CHOICES and event_code not in exhausted_options:
+ events = EVENT_CHOICES[event]
selected_events += events
exhausted_options.append(event_code)
else:
|
Add a python script to help integrate Zulip with Clickup. Urlopen is used instead of the usual requests library inorder to make the script standalone. Fixes zulip#26529
cb86d35 to
cce823e
Compare
|
LGTM. Thanks for working on this one. |
This script is required for the integration of ClickUp with Zulip. It is intended to be downloaded and run locally on user terminal
What the script does:
Fixes: Issue
Main ClickUp integration: PR
CZO: thread
zulip_clickup.pywalkthrough:Screencast.from.08-19-2024.10.34.01.AM.webm
Note: