-
Notifications
You must be signed in to change notification settings - Fork 0
APP-9854 Allow Adding additional regexes to email reply parser library #1
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @achitJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the email-reply-parser library by adding support for custom regex patterns for identifying quote headers and signatures. This allows users to adapt the parser to handle various email formats not covered by the default patterns. The changes also include new methods for managing these custom regexes and a bug fix for regexes without capture groups. The README has been updated with documentation for the new features. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a valuable feature for adding custom regexes to the email parser, along with comprehensive tests. The implementation is mostly solid, but there are a few important issues to address. There's a critical issue with package versioning where a breaking change (package rename) is not reflected with a major version bump. Additionally, the tests lack isolation, which could lead to flaky results. I've also included some medium-severity suggestions to improve documentation accuracy, API consistency, and code quality. Overall, great work on adding this extensibility.
|
Test log: |
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.
1 issue found across 8 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="README.md">
<violation number="1" location="README.md:171">
P2: Creating additional `EmailReplyParser` instances does not isolate custom regexes—the RegexList is a singleton—so the README’s new guidance to “consider creating separate parser instances” is incorrect and will mislead users.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| .read(emailContent); | ||
| ``` | ||
|
|
||
| **Note:** Custom patterns are added globally and will affect all subsequent parsing operations. If you're using this library in a multi-tenant environment, consider creating separate parser instances or resetting patterns between operations. |
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.
P2: Creating additional EmailReplyParser instances does not isolate custom regexes—the RegexList is a singleton—so the README’s new guidance to “consider creating separate parser instances” is incorrect and will mislead users.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 171:
<comment>Creating additional `EmailReplyParser` instances does not isolate custom regexes—the RegexList is a singleton—so the README’s new guidance to “consider creating separate parser instances” is incorrect and will mislead users.</comment>
<file context>
@@ -91,6 +91,85 @@ console.log(parser.parseReply(emailContent));
+ .read(emailContent);
+```
+
+**Note:** Custom patterns are added globally and will affect all subsequent parsing operations. If you're using this library in a multi-tenant environment, consider creating separate parser instances or resetting patterns between operations.
+
## Contributing
</file context>
| **Note:** Custom patterns are added globally and will affect all subsequent parsing operations. If you're using this library in a multi-tenant environment, consider creating separate parser instances or resetting patterns between operations. | |
| **Note:** Custom patterns are added globally and will affect all subsequent parsing operations. In multi-tenant environments, reset the patterns between tenants or avoid registering tenant-specific patterns globally. |
Summary
Add runtime APIs to register and reset custom quote header and signature regex patterns to support more email formats (APP-9854). Fix handling of custom regexes without capture groups and rename the package to @clearfeed-ai/email-reply-parser.
New Features
Migration
Test Cases
All the tests ran successfully by running
npm run test