Skip to content

Conversation

@jmanprz
Copy link
Owner

@jmanprz jmanprz commented Dec 11, 2025

No description provided.

Copy link

Copilot AI left a 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.

@codecov
Copy link

codecov bot commented Dec 11, 2025

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 ☂️

@jmanprz jmanprz changed the title Added branch name validation gh action. Minor update docs Added MailThreads entity. Branch name validation gh action. Minor update docs Dec 12, 2025
@jmanprz jmanprz requested a review from Copilot December 12, 2025 11:50
@jmanprz jmanprz self-assigned this Dec 12, 2025
Copy link

Copilot AI left a 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.

"""
assert folder in ["inbox", "drafts", "sent", "archive"], \
"folder must be one of: inbox, drafts, sent, archive"
uri = f"{cls._get_meta('entity_name')}/mailThreads"
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
uri = f"{cls._get_meta('entity_name')}/mailThreads"
uri = cls._get_meta('entity_name')

Copilot uses AI. Check for mistakes.

@warn_endpoint_legacy
@classmethod
def mail_message(cls, message_id: int, params: Dict = {}) -> Optional[Dict]:
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
def mail_message(cls, message_id: int, params: Dict = {}) -> Optional[Dict]:
def mail_message(cls, message_id: int, params: Dict = {}) -> Self:

Copilot uses AI. Check for mistakes.

class PartyDict(pydantic.BaseModel):
"""
Represents the parties party of a MailThread (to, from, cc, bcc)
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
Represents the parties party of a MailThread (to, from, cc, bcc)
Represents a party of a MailThread (to, from, cc, bcc)

Copilot uses AI. Check for mistakes.
LabelValuePrimaryDict,
MonetaryDict,
ParticipantDict,
PartiesDict,
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
PartiesDict,

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 20
The Mailbox represents the threads. Therefore, querying Mailbox.get will
return a specific mail thread whereas Mailbox.all will return a list of
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines 594 to 597
Accepts a `dict` with schema `PartiesDict` (Mailbox/MailThreads to, from,
bcc and cc).
"""

Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
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).
"""

Copilot uses AI. Check for mistakes.
**Examples:**

- ``feature/add-entity-mailbox`` — New mailbox entity
- ``bugfix/fix-entity-mailbox-attributes`` — Contact update issue
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
- ``bugfix/fix-entity-mailbox-attributes`` — Contact update issue
- ``bugfix/fix-entity-mailbox-attributes`` — Mailbox attribute fix

Copilot uses AI. Check for mistakes.
Comment on lines +181 to +189
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
Copy link

Copilot AI Dec 12, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
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})
Copy link

Copilot AI Dec 12, 2025

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.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Dec 12, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a 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.

Union,
)
from .types import (
PartiesDict,
Copy link

Copilot AI Dec 16, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a 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.

- 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
Copy link

Copilot AI Dec 16, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@jmanprz jmanprz merged commit 72bb43d into develop Dec 16, 2025
3 checks passed
@jmanprz jmanprz mentioned this pull request Dec 16, 2025
jmanprz added a commit that referenced this pull request Dec 16, 2025
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
@jmanprz jmanprz deleted the feature/add-entity-mailbox branch December 16, 2025 14:11
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.

2 participants