feat(ai): Leverage Repository Labels for Enhanced AI Generation#71
Merged
thomas-vilte merged 1 commit intomasterfrom Jan 4, 2026
Merged
feat(ai): Leverage Repository Labels for Enhanced AI Generation#71thomas-vilte merged 1 commit intomasterfrom
thomas-vilte merged 1 commit intomasterfrom
Conversation
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.
Description
I implemented a significant enhancement to the AI content generation capabilities (for both issues and PR summaries) by integrating the repository's available labels. Previously, the AI would suggest labels based on a fixed, internal list. This change allows the AI to receive the actual labels configured in the target repository, leading to more accurate and usable label suggestions.
This feature introduces a new
CleanLabelshelper function to centralize label cleaning and validation, using either repository-specific labels fetched from the VCS client or a sensible default fallback if no repository labels are provided. It also refactors the AI prompt generation to explicitly include available labels as context, improving the AI's ability to select relevant labels.Additionally, the issue generation now leverages
genai.Schemafor structured output, simplifying the prompt and ensuring robust JSON parsing.Fixes # (issue)
Type of Change
How Has This Been Tested?
Extensive unit tests were added and updated for
issue_content_generator_test.go,pull_requests_summarizer_service_test.go,issue_generator_service_test.go, andpull_request_service_test.goto cover the new logic for handling available labels and schema-based generation. These tests verify that labels are correctly cleaned and passed to the AI, and that the AI services correctly integrate with the VCS client to fetch labels.Checklist
🧪 Test Plan & Evidence
Suggested Manual Verification
go test ./...and ensure all tests pass