Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

integrations/ClickUp: Add ClickUp integration script.#824

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
PieterCK wants to merge1 commit intozulip:main
base:main
Choose a base branch
Loading
fromPieterCK:issue-26529-clickup-integration

Conversation

PieterCK
Copy link
Collaborator

@PieterCKPieterCK commentedApr 1, 2024
edited
Loading

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:

  • Request ClickUp's API KEY,
  • Register new webhooks through their API endpoint.
  • Enables the user to choose which event to be received.
  • Deletes old Zulip related ClickUp webhooks when running the script multiple times.
  • Appends ClickUp API KEY and team ID to the registered Zulip webhook URL to be used for callbacks.

Fixes:Issue
Main ClickUp integration:PR
CZO:thread

  • zulip_clickup.py walkthrough:
# execute zulip_clickup.py command:python3 zulip_clickup.py --clickup-team-id 25567147 --clickup-client-id V0COEU8DRNOM1J5KG6SDGIC2CQQFQOLP --clickup-client-secret GLTEHI5VC8IO83FTBV8OOQHLC836RYTWLGECLDONOR03YZB4EDIW54MYF6G9PEVH --zulip-webhook-url "https://chat.zulip.org"
Screencast.from.08-19-2024.10.34.01.AM.webm

Note:

@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch 2 times, most recently from48020ab to2e94184CompareApril 3, 2024 12:17
@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch 5 times, most recently fromfd31255 to070853eCompareApril 13, 2024 15:34
@PieterCK
Copy link
CollaboratorAuthor

@zulipbot add "buddy review"

@zulipbot
Copy link
Member

ERROR: Label "buddy review" does not exist and was thus not added to this pull request.

@PieterCK
Copy link
CollaboratorAuthor

@kennethnrk I think you can also take a look at this one, thank you!

Copy link

@sbansal1999sbansal1999 left a comment

Choose a reason for hiding this comment

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

@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.

Copy link

@sbansal1999sbansal1999 left a comment

Choose a reason for hiding this comment

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

@PieterCK I have left some comments for the remaining files as well.

Let me know if there are any questions that you have.

@PieterCK
Copy link
CollaboratorAuthor

@zulipbot add "mentor review"

@zulipbot
Copy link
Member

ERROR: Label "mentor review" does not exist and was thus not added to this pull request.

@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch 2 times, most recently from086d6e7 to3e848b1CompareAugust 9, 2024 14:30
@PieterCK
Copy link
CollaboratorAuthor

Pushed some updates to address review. Will continue to update the PR in the coming days

@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch 3 times, most recently from4eefee5 to2fa6bd7CompareAugust 10, 2024 13:25
@PieterCK
Copy link
CollaboratorAuthor

PieterCK commentedAug 10, 2024
edited
Loading

@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 knownissue with no solid fix yet.#826 has a couple of commits that can plug off that issue temporarily once merged

$ 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"

Choose a reason for hiding this comment

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

Change the"GENERATED_WEBHOOK_URL" to match the existing format.

Suggested change
--zulip-webhook-url"GENERATED_WEBHOOK_URL"
--zulip-webhook-url<zulip_webhook_url>

@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch 2 times, most recently from2db6547 tocb86d35CompareAugust 19, 2024 03:38
@PieterCK
Copy link
CollaboratorAuthor

@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>"

Choose a reason for hiding this comment

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

Quotes can be removed here.

Suggested change
--zulip-webhook-url"<zulip_webhook_url>"
--zulip-webhook-url <zulip_webhook_url>

Copy link
CollaboratorAuthor

@PieterCKPieterCKSep 10, 2024
edited
Loading

Choose a reason for hiding this comment

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

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 😃 😃

https://phoenixnap.com/kb/linux-run-command-background

Choose a reason for hiding this comment

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

Ahh the ampersand will mess things up, thanks for the clarification.

@sbansal1999
Copy link

@PieterCK Please take a look atthis comment, after that is resolved I feel we can move this PR to the next stage.

Thanks!

@PieterCK
Copy link
CollaboratorAuthor

PieterCK commentedSep 10, 2024
edited
Loading

@PieterCK Please take a look atthis comment, after that is resolved I feel we can move this PR to the next stage.

Thanks!

Updated the PR! Thank you

Diff:

+++ 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 Zulipwith Clickup.Urlopen is used instead of the usual requestslibrary inorder to make the script standalone.Fixes zulip#26529
@PieterCKPieterCKforce-pushed theissue-26529-clickup-integration branch fromcb86d35 tocce823eCompareSeptember 11, 2024 06:42
@sbansal1999
Copy link

LGTM. Thanks for working on this one.

PieterCK reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sbansal1999sbansal1999sbansal1999 left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

ClickUp integration
3 participants
@PieterCK@zulipbot@sbansal1999

[8]ページ先頭

©2009-2025 Movatter.jp