Skip to content

refactor(#751): GitHubIssueTask delegates to GitHubAbilities::createIssue()#753

Merged
chubes4 merged 2 commits intoExtra-Chill:mainfrom
saraichinwag:refactor/751-github-issue-task-use-abilities
Mar 9, 2026
Merged

refactor(#751): GitHubIssueTask delegates to GitHubAbilities::createIssue()#753
chubes4 merged 2 commits intoExtra-Chill:mainfrom
saraichinwag:refactor/751-github-issue-task-use-abilities

Conversation

@saraichinwag
Copy link
Contributor

Summary

Centralize GitHub issue creation in GitHubAbilities instead of having the task make its own raw API calls. This ensures consistent auth, error handling, and testability.

Changes

  • Add GitHubAbilities::createIssue() — new static method that handles POST to GitHub API with full param support (repo, title, body, labels, assignees)
  • Refactor GitHubIssueTask::execute() — now delegates to GitHubAbilities::createIssue() instead of duplicating API logic
  • Code reduction — 30 lines of raw API code → 15 lines calling the centralized method

Benefits

  • Single source of truth for GitHub issue creation
  • Consistent error handling and response formatting
  • Easier testing (mock GitHubAbilities::createIssue() instead of HTTP)
  • Future GitHub PAT changes only need to update GitHubAbilities

Related to #751 (extensible settings for github_pat)

…filter, support github_pat

Settings update ability now tracks which input keys were actually processed.
Unknown keys are reported as unhandled_keys in the response instead of being
silently ignored. Extensions can hook into the datamachine_update_settings
filter to handle their own keys.

- Add github_pat and github_default_repo to core settings handler + schema
- Add datamachine_update_settings filter for extension-owned keys
- CLI set command now errors when a key was not recognized
- Add 5 tests covering new behavior
…es::createIssue()

Centralize GitHub issue creation in GitHubAbilities instead of having
the task make its own raw API calls. This ensures consistent auth,
error handling, and testability.

- Add GitHubAbilities::createIssue() static method
- GitHubIssueTask::execute() now calls GitHubAbilities::createIssue()
- Remove duplicate API logic from task (30 lines → 15 lines)
- Supports same params: repo, title, body, labels, assignees
@chubes4 chubes4 merged commit 75e718e into Extra-Chill:main Mar 9, 2026
3 checks passed
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