Assign integration labels in issue based on "Integration causing the issue" field#352
Open
iMicknl wants to merge 4 commits intohome-assistant:mainfrom
Open
Assign integration labels in issue based on "Integration causing the issue" field#352iMicknl wants to merge 4 commits intohome-assistant:mainfrom
iMicknl wants to merge 4 commits intohome-assistant:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the GitHub webhook bot’s ability to automatically apply integration: ... labels on newly opened issues by extracting the integration name from the “Integration causing the issue” template field when a documentation link is missing.
Changes:
- Added
extractIntegrationFromBodyandnormalizeIntegrationNameutilities to parse and normalize integration names from issue bodies. - Updated
SetIntegrationhandler to prefer documentation-link extraction first, then fall back to the body field. - Expanded/refined unit tests for the new parsing + fallback behavior and corrected typos in test names.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
services/bots/src/github-webhook/utils/text_parser.ts |
Adds extraction + normalization helpers for integration names. |
services/bots/src/github-webhook/handlers/set_integration.ts |
Uses the new helpers as a fallback when no integration doc link is present. |
tests/services/bots/github-webhook/utils/text_parser.spec.ts |
Adds coverage for the new helpers. |
tests/services/bots/github-webhook/handlers/set_integration.spec.ts |
Adds coverage for link-priority and body-field fallback behavior; fixes typos. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add extractIntegrationFromBody and normalizeIntegrationName functions to text_parser. - Update SetIntegration handler to utilize new functions for improved integration label extraction. - Refactor tests for SetIntegration and text_parser to cover new functionality and fix typos in test descriptions.
…and assert call index
1f958f3 to
285cfb0
Compare
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.
Currently, I often need to label pull requests where contributors skip the "link to integration documentation" field but do fill in "integration causing the issue."
This PR introduces automatic matching based on that text field, saving contributors the time and effort of manual labeling. It’s an initial implementation that performs simple pattern-based matching for common cases, but it can be easily extended as we identify more patterns.
Changes