Skip to content

Enable fixed comment on issues and refactor GitHub operations#4

Merged
xueyulinn merged 2 commits into
reviewfrom
feature/add-github-issue-comments
May 5, 2026
Merged

Enable fixed comment on issues and refactor GitHub operations#4
xueyulinn merged 2 commits into
reviewfrom
feature/add-github-issue-comments

Conversation

@xueyulinn
Copy link
Copy Markdown
Owner

Summary

This PR enables the backend service to post a fixed comment to a GitHub pull request issue thread and refactors the GitHub integration code into a clearer layered structure.

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Test
  • CI/CD
  • Chore

Changes Made

  • Added GitHub integration modules under codehawk/github/:
    • auth.py for GitHub App installation token creation
    • client.py for GitHub comment posting
    • constants.py for GitHub API constants
    • dto.py for pull request webhook DTOs
    • webhook.py for webhook payload parsing
  • Implemented the flow to post a fixed comment to a PR issue thread.
  • Updated pull_request_summary_service to orchestrate:
    • webhook parsing
    • installation token creation
    • GitHub client construction
    • issue comment posting
  • Updated github_handler to call the refactored PR summary flow.
  • Updated settings and JWT utility usage to support the GitHub App flow cleanly.

How to Test

pytest tests -q
ruff check .
mypy codehawk

Then run the backend and trigger a supported pull_request webhook event to verify that the service posts the fixed comment successfully.

Checklist

  • Code builds successfully
  • Tests added or updated
  • Existing tests pass
  • Documentation updated if needed
  • No secrets or sensitive data included
  • Breaking changes documented

Breaking Changes

None.

Additional Notes

Validation completed locally:

  • pytest tests -q -> 7 passed
  • ruff check . -> passed
  • mypy codehawk -> passed

There is still a non-blocking pytest cache permission warning in the local environment, but it does not affect test results.

@xueyulinn xueyulinn linked an issue May 5, 2026 that may be closed by this pull request
@xueyulinn xueyulinn merged commit 94f1f43 into review May 5, 2026
4 checks passed
@xueyulinn xueyulinn deleted the feature/add-github-issue-comments branch May 8, 2026 23:23
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.

[Feature]: Post Pull Request Summary as a GitHub Comment

1 participant