Skip to content

Assign integration labels in issue based on "Integration causing the issue" field#352

Open
iMicknl wants to merge 4 commits intohome-assistant:mainfrom
iMicknl:fuzzy-integration-label-matching
Open

Assign integration labels in issue based on "Integration causing the issue" field#352
iMicknl wants to merge 4 commits intohome-assistant:mainfrom
iMicknl:fuzzy-integration-label-matching

Conversation

@iMicknl
Copy link
Copy Markdown
Member

@iMicknl iMicknl commented Mar 25, 2026

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

  • 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.

Copilot AI review requested due to automatic review settings March 25, 2026 13:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extractIntegrationFromBody and normalizeIntegrationName utilities to parse and normalize integration names from issue bodies.
  • Updated SetIntegration handler 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.

Comment thread services/bots/src/github-webhook/utils/text_parser.ts
Comment thread tests/services/bots/github-webhook/handlers/set_integration.spec.ts
iMicknl added 4 commits April 10, 2026 12:07
- 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.
@iMicknl iMicknl force-pushed the fuzzy-integration-label-matching branch from 1f958f3 to 285cfb0 Compare April 10, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants