Conversation
Co-authored-by: sonnyt <183387+sonnyt@users.noreply.github.com>
Co-authored-by: sonnyt <183387+sonnyt@users.noreply.github.com>
Co-authored-by: sonnyt <183387+sonnyt@users.noreply.github.com>
|
@copilot create Ruby sdk. Use ruby best practises |
I'd be happy to help create a Ruby SDK! However, this is the
Creating a Ruby SDK in this Python repository wouldn't follow best practices for language-specific SDK repositories. Please let me know where you'd like the Ruby SDK to be created. |
|
@copilot use the existing bundleup-sdk-ruby repo |
I cannot access the To create the Ruby SDK, please create an issue or PR in the |
|
@copilot use python best practicies. Implementation does not need to match JS identically. |
…sion pooling, and __repr__ methods Co-authored-by: sonnyt <183387+sonnyt@users.noreply.github.com>
Applied Python best practices in commit 42a7123: Custom Exception Hierarchy:
Context Manager Support: with BundleUp("api-key") as client:
connections = client.connections.list()
# Automatically closes sessionConnection Pooling:
Better Error Handling:
Python Idioms:
All 70 tests passing. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42a712307e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try: | ||
| error_body = response.text if hasattr(response, 'text') else None | ||
| except: | ||
| error_body = None | ||
| raise APIError( |
There was a problem hiding this comment.
Guard against missing response in Unify request errors
If the HTTP request fails before a response object is created (e.g., DNS failure, connection refused, or timeout), requests.get raises a RequestException and response is never assigned. The exception handler then dereferences response to read response.text, which raises UnboundLocalError and masks the original network failure, so callers never see the intended APIError. Initialize response = None before the try, or use getattr(e, "response", None) to avoid crashing on connection-level failures.
Useful? React with 👍 / 👎.
Created Python SDK for BundleUp with Python best practices. Package installable as
bundleup-sdkwith Python 3.8+ support.Core Components
BundleUp- Main client withapi_keyauthconnections,integrations,webhooksproxy(connection_id),unify(connection_id)requests.Sessionfor connection poolingBase- Abstract resource class with generic typeslist(),create(),retrieve(),update(),delete()https://api.bundleup.io/v1list()methodResources -
Connections,Integrations,WebhooksextendingBaseProxy- Direct API calls to connected serviceshttps://proxy.bundleup.ioget(),post(),put(),patch(),delete()BU-Connection-Idheader**kwargsfor flexibilityUnify- Standardized API with pagination supporthttps://unify.bundleup.ioChat.channels(),Git.repos/pulls/tags/releases(),PM.issues()limit,after,include_rawCustom Exception Hierarchy
BundleUpError- Base exceptionValidationError- Input validation errorsAPIError- General API errors with status code and response bodyAuthenticationError- 401 errorsNotFoundError- 404 errorsRateLimitError- 429 errorsUsage
Python Best Practices
requests.Session@abstractmethoddecorators for abstract properties__repr__methods for better debuggingrequestsfor HTTP,typing-extensionsfor compatibilityOriginal prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.