-
Notifications
You must be signed in to change notification settings - Fork 32
Rollback Deal to version 1 #43
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
Walkthrough
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant DealResource
participant APIv2
participant APIv1
Note over DealResource: Before (supports_v2_api? => true)
Client->>DealResource: perform_operation()
DealResource->>DealResource: supports_v2_api? == true
DealResource->>APIv2: request
APIv2-->>DealResource: response
DealResource-->>Client: result
sequenceDiagram
autonumber
participant Client
participant DealResource
participant APIv1
Note over DealResource: After (supports_v2_api? => false)
Client->>DealResource: perform_operation()
DealResource->>DealResource: supports_v2_api? == false
DealResource->>APIv1: request
APIv1-->>DealResource: response
DealResource-->>Client: result
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes Possibly related PRs
✨ 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/Issue comments)Type 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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
CHANGELOG.md(1 hunks)lib/pipedrive/resources/deal.rb(1 hunks)lib/pipedrive/version.rb(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-01T14:03:34.481Z
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
🪛 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)
🔇 Additional comments (2)
lib/pipedrive/version.rb (1)
4-4: VERSION bump aligned with changelog; LGTMMatches CHANGELOG 2.1.2. No further action needed.
lib/pipedrive/resources/deal.rb (1)
15-17: Rollback to v1 implemented; aligns with per-resource versioningSetting
supports_v2_api?tofalsecorrectly disables v2 for Deal and matches the PR intent. This is consistent with the team's per-resource versioning approach.
| ## [2.1.2] - 2025-08-12 | ||
|
|
||
| ### Fixes | ||
| - Rollback Deal to be back to version **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.
🧹 Nitpick (assertive)
Fix markdownlint violations (MD022/MD032) and tighten wording
Add a blank line after the "### Fixes" heading to satisfy MD022/MD032 and clarify the bullet’s wording.
Apply this diff:
## [2.1.2] - 2025-08-12
-### Fixes
-- Rollback Deal to be back to version **v1**
+### Fixes
+
+- Roll back Deal resource to API **v1** (disable v2 for Deal)📝 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.
| ## [2.1.2] - 2025-08-12 | |
| ### Fixes | |
| - Rollback Deal to be back to version **v1** | |
| ## [2.1.2] - 2025-08-12 | |
| ### Fixes | |
| - Roll back Deal resource to API **v1** (disable v2 for Deal) |
🧰 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 8 to 12, there is no blank line after the "###
Fixes" heading and the bullet wording is loose; add a single blank line
immediately after "### Fixes" to satisfy MD022/MD032 and change the bullet to a
tighter phrasing such as "Rollback Deal to version v1" (ensure no extra trailing
spaces and preserve list formatting).
| def self.supports_v2_api? | ||
| true | ||
| false | ||
| end |
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)
Prefer DSL-based version pinning for clarity (use_version :v1)
Given the presence of use_fields_version :v1 and the library’s DSL, consider explicitly pinning general operations with use_version :v1 for consistency and readability, instead of relying on supports_v2_api?.
Apply this diff:
- def self.supports_v2_api?
- false
- end
+ # Pin general operations to v1 (fields remain on v1 via use_fields_version above)
+ use_version :v1📝 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.
| def self.supports_v2_api? | |
| true | |
| false | |
| end | |
| # Pin general operations to v1 (fields remain on v1 via use_fields_version above) | |
| use_version :v1 |
🤖 Prompt for AI Agents
In lib/pipedrive/resources/deal.rb around lines 15 to 17, replace the explicit
supports_v2_api? method with the DSL version pinning for clarity: remove the def
self.supports_v2_api? / false / end block and add a top-level DSL call
use_version :v1 (keeping existing use_fields_version :v1) so general operations
are explicitly pinned to v1; ensure placement follows other DSL calls in the
class and delete the now-unnecessary method.
Summary by CodeRabbit