GitHub Integration Extension for Kiket - Sync pull requests, mirror issues, track CI/CD status, and automate workflows between GitHub and Kiket.
- Repository Management: Register and manage GitHub repositories with Kiket projects
- Pull Request Sync: Automatic synchronization of PR status, reviews, and checks
- Issue Mirroring: Bidirectional sync between GitHub issues and Kiket issues
- Webhook Handling: Process GitHub webhooks for real-time updates
- CI/CD Status Tracking: Monitor check runs and check suites
- Commit Linking: Auto-link commits to Kiket issues via commit messages
- Branch/Tag Tracking: Monitor branches, tags, and releases
- Analytics Integration: dbt models for PR metrics and repository insights
- Sync Jobs: Trigger full or incremental repository synchronization
- CSV Export: Export PR data for analysis
- Ruby 3.4+
- Bundler
- GitHub App with appropriate permissions
- Access to Kiket custom_data module
cd extensions/github
bundle installCreate a .env file:
RACK_ENV=development
PORT=9393
# GitHub App Configuration
GITHUB_APP_ID=your_app_id
GITHUB_APP_PRIVATE_KEY=your_private_key_pem
GITHUB_WEBHOOK_SECRET=your_webhook_secret
GITHUB_INSTALLATION_ID=your_installation_id- Create a GitHub App in your organization settings
- Set permissions:
- Repository contents: Read
- Issues: Read & write
- Pull requests: Read & write
- Checks: Read
- Metadata: Read
- Subscribe to webhook events (see manifest.yaml)
- Generate and save private key
- Install the app in your repositories
bundle exec puma -C puma.rbThe extension will be available at http://localhost:9393.
GET /health
Returns extension health status.
POST /repositories/register
Register a GitHub repository with Kiket.
Request:
{
"owner": "kiket-dev",
"name": "kiket",
"installation_id": 12345,
"kiket_project_id": "proj-123",
"sync_enabled": true,
"sync_issues": true,
"sync_prs": true,
"auto_link": true,
"default_branch": "main"
}GET /repositories
List registered repositories. Supports filtering by kiket_project_id.
GET /repositories/:owner/:name
Get details for a specific repository.
DELETE /repositories/:owner/:name
Unregister a repository and clean up associated data.
POST /pull_requests/sync
Manually sync a pull request.
Request:
{
"repository": "kiket-dev/kiket",
"pr_number": 42,
"title": "Add new feature",
"state": "open",
"html_url": "https://github.com/kiket-dev/kiket/pull/42",
"author": "john",
"base_branch": "main",
"head_branch": "feature/new-feature",
"mergeable": true,
"merged": false,
"draft": false,
"reviews_count": 2,
"approved_reviews": 1,
"changes_requested": 0,
"checks_status": "success",
"created_at": "2025-11-10T10:00:00Z",
"updated_at": "2025-11-10T14:00:00Z",
"kiket_issue_id": "ISSUE-123"
}GET /pull_requests
List pull requests. Supports filtering by:
repository: Filter by repository full namestate: Filter by PR state (open, closed)
GET /pull_requests/:owner/:name/:number
Get details for a specific pull request.
POST /issues/mirror
Create a bidirectional mapping between GitHub and Kiket issues.
Request:
{
"repository": "kiket-dev/kiket",
"github_issue_number": 10,
"kiket_issue_id": "ISSUE-123",
"direction": "github_to_kiket",
"sync_comments": true,
"sync_status": true,
"sync_assignees": true,
"sync_labels": true
}GET /issues/mappings
List issue mappings. Supports filtering by:
repository: Repository full namekiket_issue_id: Kiket issue IDgithub_issue_number: GitHub issue number
DELETE /issues/mappings/:id
Remove an issue mapping.
POST /webhooks/github
Receives GitHub webhooks. Supported events:
pull_request: PR opened, closed, merged, synchronizedpull_request_review: Reviews submittedcheck_suite,check_run: CI/CD status updatesissues: Issue created, edited, closedissue_comment: Comments on issues/PRspush: Commits pushed (for auto-linking)create,delete: Branch/tag eventsrelease: Release published
Requires headers:
X-GitHub-Event: Event typeX-GitHub-Delivery: Delivery IDX-Hub-Signature-256: Webhook signature (verified in production)
GET /webhooks/deliveries
List recent webhook deliveries with processing status.
Query parameters:
limit: Max deliveries to return (default: 50, max: 100)offset: Pagination offset
POST /sync/trigger
Trigger a repository sync job.
Request:
{
"repository": "kiket-dev/kiket",
"sync_type": "full"
}Sync types:
full: Complete sync of issues and PRsissues: Issues onlyprs: Pull requests onlyincremental: Only recent changes
GET /sync/jobs
List sync jobs. Supports filtering by:
repository: Repository full namestatus: Job status (queued, running, completed, failed)limit: Max jobs to return
GET /sync/jobs/:id
Get details for a specific sync job.
GET /repositories/:owner/:name/branches
List branches for a repository.
GET /repositories/:owner/:name/tags
List tags for a repository.
GET /reports/pr_metrics
Generate PR metrics report.
Query parameters:
repository: Filter by repositorystart_date: Filter PRs created after date (ISO 8601)end_date: Filter PRs created before date (ISO 8601)
Response:
{
"total_prs": 150,
"merged_prs": 120,
"open_prs": 15,
"closed_prs": 15,
"draft_prs": 5,
"merge_rate": 80.0,
"avg_merge_time_hours": 48.5
}GET /reports/issue_metrics
Generate issue mirroring metrics.
GET /export/pull_requests/csv
Export pull requests as CSV.
Query parameters: Same as /pull_requests
The extension uses five custom data tables:
Stores registered GitHub repositories.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| owner | string | Repository owner |
| name | string | Repository name |
| full_name | string | Full name (owner/repo) |
| installation_id | bigint | GitHub App installation ID |
| kiket_project_id | string | Associated Kiket project |
| sync_enabled | boolean | Whether sync is enabled |
| sync_issues | boolean | Sync issues |
| sync_prs | boolean | Sync pull requests |
| auto_link | boolean | Auto-link commits to issues |
| default_branch | string | Default branch name |
| registered_at | timestamp | Registration timestamp |
| last_synced_at | timestamp | Last successful sync |
Stores synchronized pull requests.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| repository_id | bigint | Foreign key to repositories |
| pr_number | integer | GitHub PR number |
| title | text | PR title |
| state | string | PR state (open, closed) |
| author | string | PR author username |
| base_branch | string | Target branch |
| head_branch | string | Source branch |
| merged | boolean | Whether PR was merged |
| draft | boolean | Draft status |
| reviews_count | integer | Total reviews |
| approved_reviews | integer | Approved reviews |
| changes_requested | integer | Reviews requesting changes |
| checks_status | string | CI/CD checks status |
| kiket_issue_id | string | Linked Kiket issue |
Stores GitHub-Kiket issue mappings.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| repository_id | bigint | Foreign key to repositories |
| github_issue_number | integer | GitHub issue number |
| kiket_issue_id | string | Kiket issue ID |
| direction | string | Sync direction |
| sync_comments | boolean | Sync comments |
| sync_status | boolean | Sync status changes |
| sync_assignees | boolean | Sync assignees |
| sync_labels | boolean | Sync labels |
Logs GitHub webhook deliveries.
| Column | Type | Description |
|---|---|---|
| id | string | Delivery ID from GitHub |
| event_type | string | GitHub event type |
| repository_id | bigint | Related repository |
| received_at | timestamp | Receipt timestamp |
| processed | boolean | Processing status |
| error | text | Error message if failed |
Tracks repository sync jobs.
| Column | Type | Description |
|---|---|---|
| id | bigint | Primary key |
| repository_id | bigint | Repository being synced |
| sync_type | string | Type of sync |
| status | string | Job status |
| items_processed | integer | Items processed |
| items_total | integer | Total items |
| started_at | timestamp | Job start time |
| completed_at | timestamp | Job completion time |
The extension provides three dbt models for analytics:
Incremental model aggregating daily PR metrics.
Metrics:
- PRs opened, merged, closed
- Draft PRs
- Average time to merge
- Average reviews and approvals
- CI/CD check success rate
- Merge rate percentage
Summary statistics per repository.
Metrics:
- Total PRs (all-time)
- Merged vs open PRs
- Unique contributors
- Mapped issues count
- Average merge time
- Merge rate percentage
- Last sync timestamps
Webhook delivery success rates by event type.
Metrics:
- Total deliveries per day/event type
- Successful vs failed deliveries
- Deliveries with errors
- Success rate percentage
The github_overview dashboard provides:
- Summary metrics (repos, open PRs, mapped issues, avg merge time)
- Daily PR activity trends (opened, merged, closed)
- Top repositories by PR volume and merge rate
- Webhook reliability table
- Active PRs awaiting review
The extension contributes the following commands to Kiket's command palette (⌘K / Ctrl+K):
- Sync GitHub Repository: Trigger full repository sync
- Link Pull Request: Link a GitHub PR to current issue
- Create GitHub Issue: Create GitHub issue from Kiket issue
- View Linked PRs: View PRs linked to current issue
- Export PR Metrics: Export PR metrics as CSV
- Go to your GitHub repository settings → Webhooks
- Add webhook with URL:
https://your-kiket-extension.com/webhooks/github - Content type:
application/json - Secret: Use your
GITHUB_WEBHOOK_SECRET - Events: Select individual events or "Send me everything"
- Pull requests
- Pull request reviews
- Check suites
- Check runs
- Issues
- Issue comments
- Pushes
- Branch/tag creation/deletion
- Releases
curl -X POST http://localhost:9393/repositories/register \
-H "Content-Type: application/json" \
-d '{
"owner": "kiket-dev",
"name": "kiket",
"kiket_project_id": "proj-123",
"installation_id": 12345
}'curl -X POST http://localhost:9393/sync/trigger \
-H "Content-Type: application/json" \
-d '{
"repository": "kiket-dev/kiket",
"sync_type": "full"
}'curl -X POST http://localhost:9393/issues/mirror \
-H "Content-Type: application/json" \
-d '{
"repository": "kiket-dev/kiket",
"github_issue_number": 42,
"kiket_issue_id": "ISSUE-123",
"direction": "github_to_kiket"
}'curl "http://localhost:9393/reports/pr_metrics?repository=kiket-dev/kiket&start_date=2025-11-01&end_date=2025-11-30"curl "http://localhost:9393/export/pull_requests/csv?repository=kiket-dev/kiket&state=merged" \
-o github_prs.csvbundle exec rspecTest coverage includes:
- Repository registration and management
- PR synchronization
- Issue mirroring
- Webhook event processing
- Sync job management
- Metrics and reporting
- CSV export
- Error handling
bundle exec rubocopAuto-fix:
bundle exec rubocop -aBuild:
docker build -t kiket-ext-github .Run:
docker run -p 9393:9393 \
-e RACK_ENV=production \
-e GITHUB_APP_ID=your_id \
-e GITHUB_APP_PRIVATE_KEY="$(cat private-key.pem)" \
-e GITHUB_WEBHOOK_SECRET=your_secret \
kiket-ext-github- Verify webhook secret matches
GITHUB_WEBHOOK_SECRET - Check webhook delivery logs in GitHub settings
- Review
/webhooks/deliveriesendpoint for errors - Ensure extension is publicly accessible
- Verify repository is registered via
/repositories - Check
sync_prsis enabled for repository - Review sync job status via
/sync/jobs - Verify GitHub App has PR permissions
- Ensure
sync_issuesis enabled for repository - Verify GitHub App has issues permissions
- Check issue numbers are correct
- Review error in webhook deliveries
- Verify GitHub App ID and private key
- Ensure installation ID is correct
- Check App permissions include required scopes
- Verify App is installed in repository
In production, webhook signatures are verified using HMAC-SHA256:
def verify_webhook_signature(payload, signature)
computed = "sha256=" + OpenSSL::HMAC.hexdigest(
OpenSSL::Digest.new("sha256"),
ENV["GITHUB_WEBHOOK_SECRET"],
payload
)
Rack::Utils.secure_compare(computed, signature)
end- Store GitHub App private key in encrypted secrets
- Use environment variables for sensitive configuration
- Rotate webhook secrets periodically
- Limit GitHub App permissions to minimum required
The extension uses role-based access control:
- user: Can view repositories, PRs, and mappings for accessible projects
- manager: Can register repositories, create mappings, trigger syncs
- admin: Full access including deletion and webhook management
For issues and questions, please refer to the main Kiket documentation or open an issue in the repository.
Part of the Kiket platform.