-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement EventManager with parallel event execution #79
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
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
10a8f72
feat: implement EventManager with parallel event execution, new event…
theodorDiaconu 1aace33
feat: add parallel event execution support and related tests
theodorDiaconu 53ec266
refactor: simplify event listener checks and enhance parallel executi…
theodorDiaconu 8912b7d
refactor: improve code formatting and consistency in EventManagerPara…
theodorDiaconu 82df6fe
feat: add code reviewer chat mode configuration and define AI behavio…
theodorDiaconu cd22de3
feat: enhance parallel execution handling and error aggregation in Ev…
theodorDiaconu 6e934bb
feat: add HTTP client factory and direct client creation sections to …
theodorDiaconu f0683b1
feat: add event builder tests for payload schema, meta, and parallel …
theodorDiaconu e2a7ec4
refactor: simplify annotateError function syntax in EventManager
theodorDiaconu edd1b21
refactor: restructure EventManager and related components for improve…
theodorDiaconu 3e1fff4
feat: enhance check-large-files script to include token estimation an…
theodorDiaconu 4b717e2
Refactor error handling in HTTP clients and enhance tests
theodorDiaconu 833ce85
refactor: improve code formatting and readability in test files
theodorDiaconu 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| description: "This chat mode is designed to assist users in reviewing code by providing constructive feedback, identifying potential issues, and suggesting improvements." | ||
| tools: | ||
| [ | ||
| "edit", | ||
| "runNotebooks", | ||
| "search", | ||
| "new", | ||
| "runCommands", | ||
| "runTasks", | ||
| "usages", | ||
| "vscodeAPI", | ||
| "problems", | ||
| "changes", | ||
| "testFailure", | ||
| "openSimpleBrowser", | ||
| "fetch", | ||
| "githubRepo", | ||
| "github.vscode-pull-request-github/copilotCodingAgent", | ||
| "github.vscode-pull-request-github/activePullRequest", | ||
| "github.vscode-pull-request-github/openPullRequest", | ||
| "extensions", | ||
| "todos", | ||
| ] | ||
| --- | ||
|
|
||
| Define the purpose of this chat mode and how AI should behave: response style, available tools, focus areas, and any mode-specific instructions or constraints: | ||
|
|
||
| This chat mode is designed to assist users in reviewing code by providing constructive feedback, identifying potential issues, and suggesting improvements. The AI should adopt a professional and analytical response style, focusing on clarity and precision. | ||
|
|
||
| Focus Areas: | ||
|
|
||
| 1. Code Quality: Evaluate the overall quality of the code, including readability, maintainability, | ||
| and adherence to best practices. | ||
| 2. Performance: Assess the code's performance characteristics, such as efficiency, scalability, and resource usage. | ||
| 3. Security: Identify potential security vulnerabilities, such as injection attacks, cross-site scripting (XSS), and insecure data handling. | ||
| 4. Error Handling: Review the code's error handling mechanisms, including exception handling, logging, and recovery strategies. | ||
| 5. Documentation: Evaluate the code's documentation, including comments, inline documentation, and external documentation. | ||
| 6. Testing: Assess the code's test coverage, including unit tests, integration tests, and end-to-end tests. | ||
| 7. Code Review Best Practices: Provide guidance on code review best practices, such as providing constructive feedback, being open to feedback, and maintaining a respectful and collaborative tone. | ||
| 8. Code Style and Formatting: Evaluate the code's style and formatting, including indentation, naming conventions, and line length. | ||
| 9. Code Duplication: Identify and address code duplication, which can lead to maintenance issues and inconsistencies. | ||
| 10. Code Complexity: Assess the code's complexity, including cyclomatic complexity, nesting levels, and function length. | ||
|
|
||
| Mode-Specific Instructions: | ||
|
|
||
| - When reviewing code, provide specific examples and references to relevant best practices or standards. | ||
| - Offer actionable suggestions for improvement, rather than just pointing out issues. | ||
| - Maintain a respectful and constructive tone, focusing on collaboration and learning. | ||
| - When applicable, provide code snippets to illustrate suggested improvements or corrections. | ||
| - Encourage users to ask follow-up questions or seek clarification on any feedback provided. | ||
|
|
||
| Mode-Specific Constraints: | ||
|
|
||
| - Do not provide feedback on code that is not provided by the user. | ||
| - Do not engage in discussions unrelated to code review. | ||
| - Do not provide feedback on code that is not in a programming language that you are familiar with. | ||
| - Do not provide feedback on code that is not in a format that you can understand. |
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
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,59 @@ | ||
|
|
||
| import { EventManager } from "../../models/EventManager"; | ||
| import { defineEvent } from "../../define"; | ||
| import { IEvent } from "../../defs"; | ||
|
|
||
| describe("EventManager Parallel Failure Behavior", () => { | ||
| let eventManager: EventManager; | ||
| let parallelEvent: IEvent<string>; | ||
|
|
||
| beforeEach(() => { | ||
| eventManager = new EventManager({ runtimeCycleDetection: true }); | ||
| parallelEvent = defineEvent<string>({ id: "parallelEvent", parallel: true }); | ||
| }); | ||
|
|
||
| it("should execute all listeners in a batch even if one fails, but stop before next batch", async () => { | ||
| const results: string[] = []; | ||
| const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); | ||
|
|
||
| // Batch 0: Listener 1 (Throws immediately) | ||
| eventManager.addListener( | ||
| parallelEvent, | ||
| async () => { | ||
| throw new Error("Fail immediately"); | ||
| }, | ||
| { order: 0 } | ||
| ); | ||
|
|
||
| // Batch 0: Listener 2 (Succeeds after delay) | ||
| eventManager.addListener( | ||
| parallelEvent, | ||
| async () => { | ||
| await delay(50); | ||
| results.push("batch0-slow-success"); | ||
| }, | ||
| { order: 0 } | ||
| ); | ||
|
|
||
| // Batch 1: Listener 3 (Should not run) | ||
| eventManager.addListener( | ||
| parallelEvent, | ||
| async () => { | ||
| results.push("batch1-should-not-run"); | ||
| }, | ||
| { order: 1 } | ||
| ); | ||
|
|
||
| // Expect the emit to throw | ||
| await expect(eventManager.emit(parallelEvent, "data", "test")).rejects.toThrow("Fail immediately"); | ||
|
|
||
| // Wait a bit to ensure the slow listener had time to finish (if it was running) | ||
| await delay(100); | ||
|
|
||
| // Verify behavior | ||
| // 1. "batch0-slow-success" SHOULD be in results (it started running) | ||
| // 2. "batch1-should-not-run" SHOULD NOT be in results (stopped at group level) | ||
| expect(results).toContain("batch0-slow-success"); | ||
| expect(results).not.toContain("batch1-should-not-run"); | ||
| }); | ||
| }); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Prettier ignoreList configuration option prettier.config.js documentation 2024 2025💡 Result:
Short answer: Prettier does not support an ignoreList (or similar) option inside prettier.config.js as of 2024–2025. Use .prettierignore or the CLI/--ignore-path behavior instead.
Sources:
References:
[1] https://prettier.io/docs/next/ignore/
[2] https://prettier.io/docs/configuration/ and https://prettier.io/docs/next/cli/
[3] prettier/prettier#4708
ignoreListis not a valid Prettier configuration option.Prettier does not support
ignoreListin prettier.config.js. Use a.prettierignorefile in the project root to ignore files instead.Create a
.prettierignorefile with:Or remove the invalid option from prettier.config.js:
module.exports = { trailingComma: "all", tabWidth: 2, singleQuote: false, - ignoreList: [".github/**/*.md"], overrides: [📝 Committable suggestion
🤖 Prompt for AI Agents