Skip to content

Conversation

@seuros
Copy link
Owner

@seuros seuros commented May 25, 2025

Not same as GithubRepo in #8

@seuros seuros requested a review from Copilot May 25, 2025 17:43
Copy link
Contributor

Copilot AI left a 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 adds support for GitHub Projects V2 via a new GithubProjectAdapter and enhances the core adapter base and existing adapters with unified error mapping, status normalization, and webhook support.

  • Introduces GithubProjectAdapter with GraphQL connection, project/item CRUD, comments, and webhook parsing.
  • Extends ActiveProject::Adapters::Base with status mapping, error rescue macros, and webhook capability checks.
  • Updates documentation and dependencies to include GitHub Projects and reorder Faraday gems.

Reviewed Changes

Copilot reviewed 67 out of 67 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/active_project/adapters/trello_adapter.rb Refactor error parsing in handle_faraday_error
lib/active_project/adapters/trello/connection.rb Update auth param names and broaden invalid-ID detection
lib/active_project/adapters/jira_adapter.rb Add AttributeNormalizer include and wrap create/update methods
lib/active_project/adapters/jira/connection.rb Refactor header check and remove frozen string literals
lib/active_project/adapters/jira/issues.rb Add argument validation to update_issue
lib/active_project/adapters/github_project_adapter.rb New adapter class for GitHub Projects V2
lib/active_project/adapters/github_project/*.rb New modules for connection, projects, issues, comments, helpers, webhooks
lib/active_project/adapters/base.rb Enhance base class with error mapping, status methods, webhooks
activeproject.gemspec Reorder and add Faraday retry dependency
README.md Document GitHub Projects adapter support and usage examples
Comments suppressed due to low confidence (6)

lib/active_project/adapters/github_project/projects.rb:131

  • [nitpick] In the GitHub Projects adapter, adapter_source is set to :github but elsewhere uses :github_project. Consider unifying on :github_project to match the adapter name.
adapter_source: :github,

lib/active_project/adapters/github_project/issues.rb:238

  • [nitpick] This adapter_source is set to :github, which is inconsistent with the GithubProjectAdapter namespace. Use :github_project for clarity.
adapter_source: :github,

lib/active_project/adapters/github_project/helpers.rb:71

  • [nitpick] The helper’s map_user uses adapter_source: :github, but the adapter is GithubProjectAdapter. Align this to :github_project.
adapter_source: :github,

lib/active_project/adapters/jira/attribute_normalizer.rb:1

  • Consider adding unit tests for AttributeNormalizer#normalize_issue_attrs to cover the title-to-summary conversion.
# frozen_string_literal: true

lib/active_project/adapters/github_project_adapter.rb:15

  • Add tests for get_current_user and connected? in the new GithubProjectAdapter to ensure GraphQL errors and missing data are handled as expected.
def get_current_user

lib/active_project/adapters/jira/connection.rb:57

  • The code references last_response, which isn’t defined in this context. You likely meant to check the res object returned by request_rest, e.g., if res.headers[...].include?(...).
if last_response&.headers&.[](SERAPH_HEADER)&.include?("AUTHENTICATED_FAILED")

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seuros seuros merged commit a3a7b02 into master May 25, 2025
1 of 2 checks passed
@seuros seuros deleted the github_project branch May 25, 2025 17:50
seuros added a commit that referenced this pull request May 25, 2025
* 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>
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.

1 participant