Skip to content

Conversation

@j4rs
Copy link
Member

@j4rs j4rs commented Aug 12, 2025

Summary by CodeRabbit

  • Revert
    • Deal resource now uses the v1 API; v2 support has been disabled.
  • Documentation
    • Added changelog entry for version 2.1.2 outlining the Deal API rollback.
  • Chores
    • Bumped version to 2.1.2.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

Walkthrough

  • Updated lib/pipedrive/resources/deal.rb to return false from self.supports_v2_api?, disabling v2 API usage for Deal.
  • Bumped version constant in lib/pipedrive/version.rb from 2.1.1 to 2.1.2.
  • Added CHANGELOG entry for 2.1.2 documenting rollback of Deal to v1 API.
  • No changes to public API signatures.

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
Loading
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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch deal-is-still-on-version-1

🪧 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.
    • 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.
  • 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 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/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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 changed the title Rollack Deal to version 1 Rollback Deal to version 1 Aug 12, 2025
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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b1f3142 and 9637a29.

📒 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; LGTM

Matches CHANGELOG 2.1.2. No further action needed.

lib/pipedrive/resources/deal.rb (1)

15-17: Rollback to v1 implemented; aligns with per-resource versioning

Setting supports_v2_api? to false correctly disables v2 for Deal and matches the PR intent. This is consistent with the team's per-resource versioning approach.

Comment on lines +8 to +12
## [2.1.2] - 2025-08-12

### Fixes
- Rollback Deal to be back to version **v1**

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)

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.

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

Comment on lines 15 to 17
def self.supports_v2_api?
true
false
end
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)

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.

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

@j4rs j4rs merged commit 02feac0 into master Aug 12, 2025
3 checks passed
@j4rs j4rs deleted the deal-is-still-on-version-1 branch August 12, 2025 15:25
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