-
Notifications
You must be signed in to change notification settings - Fork 1
Task manager #511
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
Merged
Merged
Task manager #511
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b5e7e42
Add Task Manager worker for auto GitHub issue creation
neSpecc 17a073b
Integrate GitHub issue creation and Copilot assignment
neSpecc 3bfe039
Merge branch 'master' into task-manager
neSpecc c6dbb7b
Refactor GitHub key handling and improve Copilot assignment
neSpecc af446e4
use pat
neSpecc 637f162
Add delegated user OAuth support and token refresh for GitHub integra…
neSpecc 3f0fac3
Refactor GitHub issue creation and Copilot assignment
neSpecc 81014a1
Update GithubService.ts
neSpecc 441cd63
update
neSpecc 335eb8a
lint code
neSpecc 67fd150
lint and tests
neSpecc 51fa5ca
Fix task manager env parsing and event timestamp filter
neSpecc 6124f0d
Update package.json
neSpecc 33dac8e
update issue format
neSpecc 99a8319
lint
neSpecc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Maximum number of auto-created tasks per project per day | ||
| # Default: 10 | ||
| MAX_AUTO_TASKS_PER_DAY=10 | ||
|
|
||
| # Number of tasks handling simultaneously | ||
| # Default: 1 | ||
| SIMULTANEOUS_TASKS=1 | ||
|
|
||
| # GitHub App configuration | ||
| GITHUB_APP_ID=your_github_app_id | ||
| GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" | ||
| # Client ID of GitHub app | ||
| GITHUB_APP_CLIENT_ID=Iv23li65HEIkWZXsm6qO | ||
| # Generated in GitHub app settings | ||
| GITHUB_APP_CLIENT_SECRET=0663e20d484234e17b0871c1f070581739c14e04 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Task Manager Worker | ||
|
|
||
| Worker for automatically creating GitHub issues for errors that meet the threshold. | ||
|
|
||
| ## Description | ||
|
|
||
| This worker processes tasks to automatically create GitHub issues for events that: | ||
| - Have `totalCount >= taskThresholdTotalCount` | ||
| - Don't have a `taskManagerItem` (not yet processed) | ||
| - Occurred after `taskManager.connectedAt` | ||
|
|
||
| ## Rate Limiting | ||
|
|
||
| The worker implements daily rate limiting: | ||
| - Maximum `MAX_AUTO_TASKS_PER_DAY` (default: 10) tasks per project per day | ||
| - Uses atomic increment to prevent race conditions | ||
| - Resets daily budget at the start of each UTC day | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| - `MAX_AUTO_TASKS_PER_DAY` - Maximum auto tasks per day (default: 10) | ||
| - `GITHUB_APP_ID` - GitHub App ID | ||
| - `GITHUB_PRIVATE_KEY` - GitHub App private key (PEM format) | ||
|
|
||
| ## Usage | ||
|
|
||
| The worker is triggered by cron tasks with routing key `cron-tasks/task-manager` and payload: | ||
| ```json | ||
| { | ||
| "type": "auto-task-creation" | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "hawk-worker-task-manager", | ||
| "version": "1.0.0", | ||
| "main": "src/index.ts", | ||
| "license": "MIT", | ||
| "workerType": "cron-tasks/task-manager", | ||
| "dependencies": { | ||
| "@octokit/oauth-methods": "^4.0.0", | ||
| "@octokit/rest": "^22.0.1", | ||
| "@octokit/types": "^16.0.0", | ||
| "jsonwebtoken": "^9.0.3" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/jsonwebtoken": "^8.3.5" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.