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

Hw3 submission #11

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

isiddharthsingh
Copy link

-> How is each file in your PR connected to the task at hand?

  • Refactored the codes in folder src and follow the concept of api to have central communication.
  • Created tests for all the connections from slack, gmail, calendar, trello.
  • Updated check for ruff
  • Have a centralized app.py file that run the application and communication with the bot.
  • Updated circleCi file to use uv instead of pip.
  • Python versions have been updated to use 3.12

-> You should not have files that are irrelevant to the task.

  • No irrelevant files are there as of now.

-> Make sure files that should be .gitignore are inin .gitignore
E.g. .DS_Store*

  • All local/environment files are in .gitignore

-> Make sure secrets are not checked in!

  • We have ensured that no secrets are checked in

-> Make sure there is a clear and separated API!

  • We have clearly separated our APIs and follow the src/api directory structure

-> If your change is big and changes many files a description of the change overall is in order
-> How should it be reviewed?

  • I refactored all the codes to be in src/ files and now everything is separate like slack, gmail, calendar, trello.
  • Tests have been added and all the test are now passed.

-> What should the reviewer look at in what order?

  • All codes are in src folder.
  • All tests are in tests folder.
    -> What is the main idea?
  • When the app is run, the user can open slack and ask to add stuff to trello list, remove it, delete the whole list, remove specific cards from list, it also fetches emails and commands like fetch emails, fetch 10 emails are there. User also has functionality to add deadlines to trello and that deadline is also synced with google calendar. if it is deleted from trello then the task is also deleted from calendar.
  • Many more functions like summarizing mails and adding to trello are in progress.

trello integration with show mw toto and add todo comands on slack

Add .DS_Store to .gitignore

Add correct python version and uv

Add correct python version

Add correct python version and checks

fix: correct python version and enbled all ruff checks

Update Readme.md

Update CircleCi with uv package manager

Added uv.lock

Update README with uv dependency installation instructions

Added .DS_Store to ignored files

trello integration with show mw toto and add todo comands on slack

Add .DS_Store to .gitignore

Add correct python version

Add correct python version and checks

fix: correct python version and enbled all ruff checks

Update Readme.md

Update CircleCi with uv package manager
@Sidhved
Copy link

Sidhved commented Dec 16, 2024

1. Change Granularity
Observation: Too many features in a single PR. This team focuses on Trello management, so the Slackbot and Gmail modules are irrelevant features and should not be contained in this PR. We suggest creating new PRs for those features respectively instead of including them in this PR.

2. Code Functionality
The module achieves its goal of enabling interaction with the Trello API. It is well segmented and documented with appropriate docstrings for descriptions.
We suggest adding files like .python-version in .gitignore file.

3. Readability & Structure

  • Naming Conventions: Function names are descriptive and follow snake_case, which is Pythonic.
  • Some suggestions for variable names are pointed in the corresponding locations in the code wherever needed.
  • Modularity: trello_bot.py directly depends on trello_api.py without any intermediate abstraction, making it tightly coupled. This coupling could lead to maintenance issues if the API functions are modified or extended. Encapsulating bot logic in a class and separating mapping-related logic into its own module would enhance modularity and scalability.

4. Standards Compatibility

  • Linting: The code largely follows PEP 8 guidelines, but there are minor inconsistencies:
    Line spacing is inconsistent in some parts. Comments should be preceded by a single blank line to enhance readability.
  • API Exposure: API Exposure: API keys and other sensitive information are handled securely, which is good. Using environment variables is a good practice, and the code seems to follow this approach.

5. Testing

  • Coverage: Test coverage is good. However, you also should not contain the test files for other features such as Slackbot and Gmail in this PR.
  • Readability: The test cases are easy to read and follow. Adding some comments would be better for understanding the purpose and input/output.

Reviewers: Sidhved Warik (sw6071), Yaxin Ke (yk2991)

An open-ended question on the choice of using a separate requirements.txt for dependencies when project. toml made by uv already exists? And can the Operating System related dependencies be mentioned separately?

"""
# Fetch all lists (both open and closed if include_archived is True)
filter_value = 'all' if include_archived else 'open'
url_all_lists = f"https://api.trello.com/1/boards/{TRELLO_BOARD_ID}/lists"

Choose a reason for hiding this comment

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

Trello API base URLs (https://api.trello.com) are repeated multiple times. This could lead to errors if the API version changes. Consider defining a constant like TRELLO_API_BASE = "https://api.trello.com/1".

Copy link
Author

Choose a reason for hiding this comment

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

This has been fixed in the new version.

return True
else:
raise Exception(f"Failed to archive the list '{list_name}': {response.status_code}, {response.text}")

Choose a reason for hiding this comment

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

A consistent number of blank lines should be used.

Copy link
Author

Choose a reason for hiding this comment

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

This has been fixed in the new version.

# Fetch all lists (both open and closed if include_archived is True)
filter_value = 'all' if include_archived else 'open'
url_all_lists = f"https://api.trello.com/1/boards/{TRELLO_BOARD_ID}/lists"
query_params = {

Choose a reason for hiding this comment

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

query and query_params are inconsistently used. Standardize the naming for clarity.

Copy link
Author

Choose a reason for hiding this comment

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

This has been fixed in the new version.

# List does not exist, so create it
list_id = create_trello_list(list_name)

url = f"https://api.trello.com/1/cards"

Choose a reason for hiding this comment

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

Use more specific names for url in each function, such as create_card_url

Copy link
Author

Choose a reason for hiding this comment

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

This has been fixed in the new version.

@isiddharthsingh
Copy link
Author

image

All the tests have been passed.

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.

3 participants