-
Notifications
You must be signed in to change notification settings - Fork 32
Update resources available on V2 #42
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
WalkthroughThe changes update several resource classes in the Pipedrive integration to explicitly declare support for API version 2 by adding or modifying the class method 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)
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
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
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 returningtrue - 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 |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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.rbCHANGELOG.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.1looks correct, but please double-check that:
pipedrive-connect.gemspec(or equivalent packaging file) now references2.1.1.- Any CI/publish workflows that push tags or build Docker images pick up the same version.
- A corresponding Git tag will be created so
bundle installretrieves 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>
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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)
| ### Changed | ||
| - Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**. |
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.
🧹 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.
| ### 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.
Follow the list of API V2 resources available - https://pipedrive.readme.io/docs/pipedrive-api-v2#api-v2-availability
Summary by CodeRabbit
New Features
Tests