Draft
Conversation
Signed-off-by: Victor Palade <victor@cloudflavor.io>
Signed-off-by: Victor Palade <victor@cloudflavor.io>
Signed-off-by: Victor Palade <victor@cloudflavor.io>
Member
Author
|
/retitle Add support for managing labels |
Member
Author
|
/restart-workflow |
Contributor
|
Restarted worflow: "Deploy to Cloudflare Workers" |
Member
Author
|
/restart-workflow |
Contributor
|
Restarted worflow: "Deploy to Cloudflare Workers" |
There was a problem hiding this comment.
Pull Request Overview
Adds support for managing labels across GitHub issue and PR events, refactors command handlers, and improves configuration parsing and logging.
- Introduce
addLabelshelper and extendConfigwithlabels - Swap out default export for
newApp, enrich webhook event handling, and update command registry - Add
pinologging and simplify source detection infetch, remove GitLab/Gitea support, adjust tests
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/index.spec.ts | Removed legacy tests for unsupported GitLab/Gitea webhooks |
| src/index.ts | Added pino logger, simplified header logic, dropped GitLab/Gitea |
| src/github/httpHandler.ts | Renamed imports and variables, improved error responses |
| src/github/githubEvents.ts | Replaced default with newApp, added new webhook handlers & addLabels |
| src/common.ts | Extended Config and Label, enhanced parseTomlConfig |
| src/commands/github.ts | Updated command prefixes, passed config to handlers, use addLabels |
| README.md | Clarified project status, added /label-remove documentation |
Comments suppressed due to low confidence (5)
test/index.spec.ts:36
- Removed tests for unsupported GitLab/Gitea webhooks; consider re-adding coverage for those cases to ensure the 400 and 501 responses remain correct.
it('should fail with Unsupported webhook', async () => {
src/commands/github.ts:50
- [nitpick] The
/testcommand is ambiguous for restarting workflows; consider renaming it back to/restart-workflowfor clarity and consistency with user expectations.
commandRegistry.registerCommand('/test', handleRestartWorkflowCommand);
src/index.ts:33
- Mixing
console.logwith the newly addedpinologger can lead to inconsistent output; consider usinglogger.infoorlogger.debuginstead ofconsole.log.
console.log('Request is from GitHub');
src/common.ts:32
- The
checkLabelssignature expects a singleLabelbut implementations and usages deal with arrays; update the type toLabel[]or adjust the implementation accordingly.
checkLabels(labels: Label): boolean;
src/common.ts:50
- Accessing
parsedToml.Labelsassumes an uppercase key; verify that the TOML file uses the same casing or adjust toparsedToml.labelsto avoid missing data at runtime.
const tomlLabels = parsedToml.Labels;
Comment on lines
+81
to
+84
| const checkLabels = (labels: Label[], tomlLabels: string[]) => { | ||
| return labels.some(label => labels.includes(label)); | ||
| }; | ||
|
|
There was a problem hiding this comment.
This standalone checkLabels function is never used and duplicates logic in Config.checkLabels; consider removing it to reduce dead code and confusion.
Suggested change
| const checkLabels = (labels: Label[], tomlLabels: string[]) => { | |
| return labels.some(label => labels.includes(label)); | |
| }; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
/draft
/triage
/assign
/label enhancement