-
Notifications
You must be signed in to change notification settings - Fork 1
refactor(basecamp): move HTTP plumbing to Connections::Rest #12
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
• adapters/basecamp/connection.rb now includes Connections::Rest – uses `init_rest` for Faraday build/retry headers – leverages shared error coercion; keeps Basecamp-specific messages
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
This PR refactors the HTTP plumbing by moving shared connection logic into the new Connections module, streamlining REST and GraphQL communication across different adapters.
- Introduces reusable Connection modules (Rest, Pagination, Base, and GraphQl) that consolidate HTTP client functionality.
- Updates adapter-specific connection implementations (Trello, Jira, Basecamp) to use the new REST connection logic, and removes redundant adapter pagination code.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/active_project/connections/rest.rb | Adds the reusable REST connection module for normal APIs. |
| lib/active_project/connections/pagination.rb | Provides pagination helpers for both REST and GraphQL APIs. |
| lib/active_project/connections/http_client.rb | Refactors HTTP client logic with updated connection building and error handling. |
| lib/active_project/connections/graph_ql.rb | Adds GraphQL connection logic using the new connection framework. |
| lib/active_project/connections/base.rb | Centralizes shared connection helpers and link-header parsing. |
| lib/active_project/adapters/trello/connection.rb | Updates to use the new Connections::Rest for Trello API connectivity. |
| lib/active_project/adapters/jira/connection.rb | Migrates Jira connection logic to use Connections::Rest and updates error checking. |
| lib/active_project/adapters/basecamp/connection.rb | Refactors Basecamp adapter to utilize the new REST connection module. |
| lib/active_project/adapters/pagination.rb (deleted) | Removed redundant pagination logic now handled by the Connections module. |
Comments suppressed due to low confidence (2)
lib/active_project/connections/http_client.rb:61
- [nitpick] Consider revising or removing the humorous reference to 'George Santos' in the error comment to maintain a professional tone and clarity.
when 401, 403 then ActiveProject::AuthenticationError.new(msg) # Your credentials are like George Santos, fake and sad.
lib/active_project/connections/base.rb:50
- [nitpick] Consider removing or toning down the humorous commentary in the error message comment to ensure that error messages remain clear and professional for production use.
when 404
ActiveProject::NotFoundError.new(msg) # Sacral chakra disturbance. The thing you desire does not exist. Embrace the void.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Added support got Github Issues for a Repo as a Project * Add tests for Github ORM Interface and ActiveProject * Add Github Examples to README * refactor: HTTP logic to use centralized HttpClient module Centralized HTTP request handling into a reusable HttpClient module, simplifying and standardizing logic across adapters. Updated adapters (Trello, Basecamp, and Jira) to use the new module, reducing duplication and improving maintainability. * feat(core): introduce Async I/O pathway • add async, async-http & async-http-faraday to gemspec • HttpClient now selects adapter via AP_DEFAULT_ADAPTER (defaults to :net_http) • Pagination mix-in with each_page / each_page_async helpers • ActiveProject::Async.run wrapper for easy task spawning • Trello::Connection: map 400 "invalid id" → NotFoundError (kept in same file) • CI matrix entry with AP_DEFAULT_ADAPTER=async_http * feat(rails): auto-install Async::Scheduler via Railtie • lib/active_project/railtie.rb sets Fiber scheduler before Zeitwerk • config flag config.active_project.use_async_scheduler (default true) • env-var opt-out AP_NO_ASYNC_SCHEDULER=1 • main file requires railtie only when Rails::Railtie is defined • adds AS::Notifications event "active_project.async_scheduler_set" * chore(master): release active_project 0.3.0 * refactor(basecamp): move HTTP plumbing to Connections::Rest (#12) * feat: GithubProjects adapter. (#13) * feat: Github project adapter. * feat(github): implement webhook processing for GitHub Projects V2 * Update lib/active_project/adapters/base.rb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: rename adapter to GithubRepo --------- Co-authored-by: Abdelkader Boudih <terminale@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
=