Skip to content

Conversation

@j4rs
Copy link
Member

@j4rs j4rs commented Aug 6, 2025

Follow the list of API V2 resources available - https://pipedrive.readme.io/docs/pipedrive-api-v2#api-v2-availability

Summary by CodeRabbit

  • New Features

    • Enhanced support for API version 2 across Deal, Organization, Person, Pipeline, Product, Stage, and User resources.
    • Clarified that certain resource fields are only available in API version 1.
  • Tests

    • Removed outdated tests related to API versioning for the Deal resource.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Walkthrough

The changes update several resource classes in the Pipedrive integration to explicitly declare support for API version 2 by adding or modifying the class method supports_v2_api? to return true. Additionally, for the Deal, Organization, Person, and Product resources, the code now specifies that their fields functionality uses API version 1 by adding the use_fields_version :v1 directive. The test for Deal's v2 API version handling was removed, reflecting the updated support. No other logic or control flow changes are introduced.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ResourceClass

    Client->>ResourceClass: Call supports_v2_api?
    ResourceClass-->>Client: Return true

    Client->>ResourceClass: Request fields version
    ResourceClass-->>Client: Return :v1 (if applicable)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-v2-to-new-resources

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@j4rs j4rs requested review from Copilot and shesho August 6, 2025 19:46
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

Updates Pipedrive API resource classes to support V2 API endpoints according to the official API V2 availability documentation. The changes enable several resources to use the newer V2 API while maintaining compatibility with V1 for specific field operations.

Key changes:

  • Updated multiple resource classes to support V2 API by adding supports_v2_api? method returning true
  • Added explicit V1 version constraints for fields operations where V2 doesn't support them
  • Removed obsolete test code that was checking V1 fallback behavior for deals

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/lib/pipedrive/deal_spec.rb Removes test verifying Deal continues using V1 endpoint when V2 is enabled
lib/pipedrive/resources/user.rb Adds V2 API support for User resource
lib/pipedrive/resources/stage.rb Adds V2 API support for Stage resource
lib/pipedrive/resources/product.rb Enables V2 API support while constraining fields to V1
lib/pipedrive/resources/pipeline.rb Adds V2 API support for Pipeline resource
lib/pipedrive/resources/person.rb Enables V2 API support while constraining fields to V1
lib/pipedrive/resources/organization.rb Enables V2 API support while constraining fields to V1
lib/pipedrive/resources/deal.rb Enables V2 API support while constraining fields to V1

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8321e3b and d4547b2.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • lib/pipedrive/version.rb (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: foomip
PR: getonbrd/pipedrive-connect#37
File: lib/pipedrive/api_operations/request.rb:11-13
Timestamp: 2025-04-01T14:03:34.481Z
Learning: For the Pipedrive Connect library, API version management should be implemented on a per-resource basis (by overriding the `api_version` method in individual resource classes) rather than using global configuration, to maintain consistency and ensure proper testing of each resource with newer API versions.
📚 Learning: for the pipedrive connect library, api version management should be implemented on a per-resource ba...
Learnt from: foomip
PR: getonbrd/pipedrive-connect#37
File: lib/pipedrive/api_operations/request.rb:11-13
Timestamp: 2025-04-01T14:03:34.481Z
Learning: For the Pipedrive Connect library, API version management should be implemented on a per-resource basis (by overriding the `api_version` method in individual resource classes) rather than using global configuration, to maintain consistency and ensure proper testing of each resource with newer API versions.

Applied to files:

  • lib/pipedrive/version.rb
  • CHANGELOG.md
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md

8-8: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


9-9: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🔇 Additional comments (1)
lib/pipedrive/version.rb (1)

4-4: Confirm ancillary version bump artifacts (gemspec / tag / CI).

The patch-level bump to 2.1.1 looks correct, but please double-check that:

  1. pipedrive-connect.gemspec (or equivalent packaging file) now references 2.1.1.
  2. Any CI/publish workflows that push tags or build Docker images pick up the same version.
  3. A corresponding Git tag will be created so bundle install retrieves the right artefact.

This prevents the gem registry from ending up with mismatched versions.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4547b2 and 63685fb.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: foomip
PR: getonbrd/pipedrive-connect#37
File: lib/pipedrive/api_operations/request.rb:11-13
Timestamp: 2025-04-01T14:03:34.481Z
Learning: For the Pipedrive Connect library, API version management should be implemented on a per-resource basis (by overriding the `api_version` method in individual resource classes) rather than using global configuration, to maintain consistency and ensure proper testing of each resource with newer API versions.
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md

12-12: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63685fb and 4d22ea7.

📒 Files selected for processing (1)
  • CHANGELOG.md (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: foomip
PR: getonbrd/pipedrive-connect#37
File: lib/pipedrive/api_operations/request.rb:11-13
Timestamp: 2025-04-01T14:03:34.481Z
Learning: For the Pipedrive Connect library, API version management should be implemented on a per-resource basis (by overriding the `api_version` method in individual resource classes) rather than using global configuration, to maintain consistency and ensure proper testing of each resource with newer API versions.
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md

10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


11-11: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Comment on lines +10 to +11
### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Insert blank line after the sub-heading to satisfy MD022 / MD032

markdownlint still flags the “### Changed” heading because it isn’t followed by a blank line before the list. Add one empty line to keep the changelog style consistent and lint-clean.

 ### Changed
+
 - Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


11-11: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In CHANGELOG.md around lines 10 to 11, the sub-heading "### Changed" is not
followed by a blank line, causing markdownlint errors MD022 and MD032. Insert a
single blank line immediately after the "### Changed" heading to separate it
from the list below, ensuring consistent style and passing the lint check.

@j4rs j4rs merged commit b1f3142 into master Aug 7, 2025
3 checks passed
@j4rs j4rs deleted the add-v2-to-new-resources branch August 7, 2025 13:51
@coderabbitai coderabbitai bot mentioned this pull request Aug 12, 2025
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