Skip to content

feat(ai): Leverage Repository Labels for Enhanced AI Generation#71

Merged
thomas-vilte merged 1 commit intomasterfrom
dev
Jan 4, 2026
Merged

feat(ai): Leverage Repository Labels for Enhanced AI Generation#71
thomas-vilte merged 1 commit intomasterfrom
dev

Conversation

@thomas-vilte
Copy link
Owner

@thomas-vilte thomas-vilte commented Jan 4, 2026

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 CleanLabels helper 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.Schema for structured output, simplifying the prompt and ensuring robust JSON parsing.

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

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, and pull_request_service_test.go to 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.

  • Unit tests
  • Integration tests
  • Manual test: (describe below)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

🧪 Test Plan & Evidence

Suggested Manual Verification

  • API/Backend: Attach JSON response or logs as evidence of correct behavior
  • Performance: Ensure no significant latency increase
  • Unit Tests: Run go test ./... and ensure all tests pass
  • No Regressions: Verify that related features still work as expected

@thomas-vilte thomas-vilte changed the title feat(ai): leverage repository labels for enhanced generation feat(ai): Leverage Repository Labels for Enhanced AI Generation Jan 4, 2026
@thomas-vilte thomas-vilte added the feature New features label Jan 4, 2026
@thomas-vilte thomas-vilte merged commit 084fdb4 into master Jan 4, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant