-
Notifications
You must be signed in to change notification settings - Fork 0
Added MailThreads entity. Branch name validation gh action. Minor update docs #1
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 14 comments.
Comments suppressed due to low confidence (1)
pypipedrive/models/mail_threads.py:181
- Class methods or methods of a type deriving from type should have 'cls', rather than 'self', as their first parameter.
def mail_messages(self) -> List[Dict]:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pypipedrive/models/mail_threads.py
Outdated
| """ | ||
| assert folder in ["inbox", "drafts", "sent", "archive"], \ | ||
| "folder must be one of: inbox, drafts, sent, archive" | ||
| uri = f"{cls._get_meta('entity_name')}/mailThreads" |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URI construction duplicates "mailThreads" in the path. The entity_name is already "mailbox/mailThreads", so appending "/mailThreads" results in "mailbox/mailThreads/mailThreads". The line should just use cls._get_meta('entity_name') without the additional path segment.
| uri = f"{cls._get_meta('entity_name')}/mailThreads" | |
| uri = cls._get_meta('entity_name') |
|
|
||
| @warn_endpoint_legacy | ||
| @classmethod | ||
| def mail_message(cls, message_id: int, params: Dict = {}) -> Optional[Dict]: |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type annotation Optional[Dict] is incorrect. The method actually returns a MailThreads instance (line 177: return cls(**response.data)), not a dictionary. The return type should be Self or MailThreads instead.
| def mail_message(cls, message_id: int, params: Dict = {}) -> Optional[Dict]: | |
| def mail_message(cls, message_id: int, params: Dict = {}) -> Self: |
pypipedrive/orm/types.py
Outdated
|
|
||
| class PartyDict(pydantic.BaseModel): | ||
| """ | ||
| Represents the parties party of a MailThread (to, from, cc, bcc) |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring has a typo: "parties party" should be "individual party" or just "party". The phrase "parties party" is redundant.
| Represents the parties party of a MailThread (to, from, cc, bcc) | |
| Represents a party of a MailThread (to, from, cc, bcc) |
| LabelValuePrimaryDict, | ||
| MonetaryDict, | ||
| ParticipantDict, | ||
| PartiesDict, |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import of PartiesDict is duplicated on lines 24 and 41. Remove one of the duplicate imports to clean up the code.
| PartiesDict, |
pypipedrive/models/mail_threads.py
Outdated
| The Mailbox represents the threads. Therefore, querying Mailbox.get will | ||
| return a specific mail thread whereas Mailbox.all will return a list of |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class docstring references "Mailbox.get" and "Mailbox.all" but the actual class name is "MailThreads". Update these references to "MailThreads.get" and "MailThreads.all" to correctly reference the class methods.
| The Mailbox represents the threads. Therefore, querying Mailbox.get will | |
| return a specific mail thread whereas Mailbox.all will return a list of | |
| The Mailbox represents the threads. Therefore, querying MailThreads.get will | |
| return a specific mail thread whereas MailThreads.all will return a list of |
pypipedrive/orm/fields.py
Outdated
| Accepts a `dict` with schema `PartiesDict` (Mailbox/MailThreads to, from, | ||
| bcc and cc). | ||
| """ | ||
|
|
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo in the docstring: "Mailbox/MailThreads" should consistently use "MailThreads" to match the class name. Consider updating to "MailThreads to, from, bcc and cc" for clarity.
| Accepts a `dict` with schema `PartiesDict` (Mailbox/MailThreads to, from, | |
| bcc and cc). | |
| """ | |
| Accepts a `dict` with schema `PartiesDict` (MailThreads to, from, bcc and cc). | |
| """ |
docs/source/contributing.rst
Outdated
| **Examples:** | ||
|
|
||
| - ``feature/add-entity-mailbox`` — New mailbox entity | ||
| - ``bugfix/fix-entity-mailbox-attributes`` — Contact update issue |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example description "Contact update issue" doesn't match the example branch name bugfix/fix-entity-mailbox-attributes. Consider updating the description to something more relevant like "Mailbox attribute fix" or similar to match the actual branch name.
| - ``bugfix/fix-entity-mailbox-attributes`` — Contact update issue | |
| - ``bugfix/fix-entity-mailbox-attributes`` — Mailbox attribute fix |
| def mail_messages(self) -> List[Dict]: | ||
| """ | ||
| Returns all the mail messages inside a specified mail thread. | ||
| Returns: | ||
| A list of mail messages. | ||
| """ | ||
| uri = f"{self._get_meta('entity_name')}/{self.id}/mailMessages" | ||
| return self.get_api(version=V1).get(uri).data No newline at end of file |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method signature is missing the params parameter that is documented in the docstring and used in similar methods throughout the codebase (e.g., Deals.mail_messages, Organizations.mail_messages). Add params: Dict = {} as a parameter to maintain API consistency.
| def mail_messages(self) -> List[Dict]: | |
| """ | |
| Returns all the mail messages inside a specified mail thread. | |
| Returns: | |
| A list of mail messages. | |
| """ | |
| uri = f"{self._get_meta('entity_name')}/{self.id}/mailMessages" | |
| return self.get_api(version=V1).get(uri).data | |
| def mail_messages(self, params: Dict = {}) -> List[Dict]: | |
| """ | |
| Returns all the mail messages inside a specified mail thread. | |
| Args: | |
| params: Optional dictionary of query parameters to include in the request. | |
| Returns: | |
| A list of mail messages. | |
| """ | |
| uri = f"{self._get_meta('entity_name')}/{self.id}/mailMessages" | |
| return self.get_api(version=V1).get(uri, params=params).data |
| assert folder in ["inbox", "drafts", "sent", "archive"], \ | ||
| "folder must be one of: inbox, drafts, sent, archive" | ||
| uri = f"{cls._get_meta('entity_name')}/mailThreads" | ||
| params.update({"folder": folder}) |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This expression mutates a default value.
requirements-dev.txt
Outdated
| python-dotenv==1.2.1 | ||
| requests==2.32.3 | ||
| revitron_sphinx_theme @ https://github.com/revitron/revitron-sphinx-theme/archive/master.zip | ||
| revitron-sphinx-theme @ git+https://github.com/mesozoic/revitron-sphinx-theme.git |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency revitron-sphinx-theme @ git+https://github.com/mesozoic/revitron-sphinx-theme.git pulls code directly from the tip of a Git branch, which is a mutable reference and can change at any time. If that upstream repository is ever compromised or force-pushed, installing dev requirements or running docs builds in CI can execute attacker-controlled code with access to your CI secrets or build artifacts. To reduce supply chain risk, pin this VCS dependency to an immutable commit hash or a verified release artifact instead of an unpinned branch URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 69 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pypipedrive/orm/fields.py
Outdated
| Union, | ||
| ) | ||
| from .types import ( | ||
| PartiesDict, |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import PartiesDict is duplicated. It appears on line 24 and again on line 41. Remove one of the duplicate imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 69 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/branch_name.yml
Outdated
| - name: Check branch name | ||
| run: | | ||
| BRANCH=${{ github.head_ref }} | ||
| if ! echo "$BRANCH" | grep -E '^(feature|bugfix|docs|chore|hotfix|refactor|test)/' && [ "$BRANCH" != "develop" ] && [ "$BRANCH" != "main" ]; then |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branch name validation logic has incorrect parentheses. The condition [ "$BRANCH" != "develop" ] && [ "$BRANCH" != "main" ] is not properly grouped with the grep check. This means branches named "develop" or "main" could incorrectly fail validation. The logic should be: if the branch doesn't match the pattern AND is not develop/main, then fail.
| if ! echo "$BRANCH" | grep -E '^(feature|bugfix|docs|chore|hotfix|refactor|test)/' && [ "$BRANCH" != "develop" ] && [ "$BRANCH" != "main" ]; then | |
| if ! ( echo "$BRANCH" | grep -Eq '^(feature|bugfix|docs|chore|hotfix|refactor|test)/' || [ "$BRANCH" = "develop" ] || [ "$BRANCH" = "main" ] ); then |
Added MailThreads entity. Branch name validation gh action. Minor update docs (#1) * Added branch name validation gh action. Minor update docs * Added jquery, google analytics and sphinx ext to enhance docs * Changed Mailbox to MailThreads for better semantics * Added copilot review suggestions * Removed duplicated PartiesDict * Updated CI branch name check
No description provided.