Skip to content

Team 1 HW3 - Slack Chatbot Submission - #10

Open
AbdullahSuri wants to merge 6 commits into
nyuoss:mainfrom
Nightshade14:slackchatbot
Open

Team 1 HW3 - Slack Chatbot Submission#10
AbdullahSuri wants to merge 6 commits into
nyuoss:mainfrom
Nightshade14:slackchatbot

Conversation

@AbdullahSuri

Copy link
Copy Markdown

This pull request introduces enhancements to the Slack chatbot, improving message handling and integration. It addresses the initial setup requirements and lays the groundwork for future feature expansions.

Comment thread .DS_Store

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Generally might want to ignore this (put in gitignore)

Comment thread .gitignore

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did you mean to delete most of the .gitignore? I think it's generally quite helpful

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is bad practice to push secrets to the repository

Comment thread SlackChatbot/slack_bot.py
import re

# Initialize Slack and Trello clients
client = WebClient(token='xoxb-7855184757495-7855216149575-KI6lOoBXKSoudrc9pzugoW0x')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is bad practice to hard-code your tokens. You should consider using os.getenv() as you have done below

Comment thread SlackChatbot/slack_bot.py
"""Send a message to a Slack channel."""
try:
response = client.chat_postMessage(channel=channel, text=message)
print("Message sent successfully:", response["message"]["text"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can consider using the logger library instead of print statements

Comment thread src/TrelloManager.py
}
response = requests.post(url, params=query, timeout=10)

if response.status_code == HTTP_OK:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You may want to log failures as well

Comment thread src/TrelloManager.py

return ""

def create_a_list(self, list_name: str, id_board: str) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is create_list() taken? Generally articles are not included in function names.

Comment thread src/hello.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can probably remove the dummy files we created in setup

Comment thread tests/__init__.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is "refernciable" supposed to mean?

Comment thread tests/test_hello.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can probably remove these tests and replace them with ones that test your code's functionality

@Alex-Ying Alex-Ying left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by:
Alex Ying - aty2009@nyu.edu
Mridul Mittal - mm13171@nyu.edu

@kyotov kyotov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are issues here, but mainly what I notice at first glance:

  • How is each file in your PR connected to the task at hand?
    • You should not have files that are irrelevant to the task.
  • Make sure files that should be .gitignore are in .gitignore
    • E.g. .DS_Store
  • Make sure secrets are not checked in!
  • Make sure there is a clear and separated API!

You should fix these before I look again.

Also Alex' comments are good -- make sure you take his feedback into account

Comment thread .circleci/config.yml
@@ -0,0 +1,54 @@
version: 2.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how is this conneced to the chatbot?

@mittalmridul

Copy link
Copy Markdown

The changes we have suggested in the earlier review havent been introduced

@AbdullahSuri

Copy link
Copy Markdown
Author

The changes we have suggested in the earlier review havent been introduced

@mittalmridul here is the link for the new PR to be reviewed, it was also in excel sheet: #14

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants