Skip to content

Derrickp/dev 281 verify comments against historical comments#300

Open
derrickpersson wants to merge 16 commits into
developmentfrom
derrickp/dev-281-verify-comments-against-historical-comments
Open

Derrickp/dev 281 verify comments against historical comments#300
derrickpersson wants to merge 16 commits into
developmentfrom
derrickp/dev-281-verify-comments-against-historical-comments

Conversation

@derrickpersson

@derrickpersson derrickpersson commented Nov 8, 2024

Copy link
Copy Markdown
Contributor

Pull request summary created by Squire AI

Summary

This pull request introduces significant enhancements to comment management and synchronization with GitHub within the codebase. It replaces the existing comment filtering and reaction synchronization functionalities with new services, namely FilterCommentsService and SyncFeedbackService. The database schema was updated to include new foreign key constraints and a boolean column for tracking changes, along with the addition of CommentRepository for better comment retrieval. Additionally, new utilities for parsing file contents into abstract syntax trees (AST) were introduced alongside corresponding tests to ensure robust handling of comments and code changes.

74b9fda...bfe58a3

File Summary

File Changes:

  • .pre-commit-config.yaml: Added exclusion for tests/test_has_applied_change.py to the trailing-whitespace hook.
  • workflow.py: Replaced filter_top_comment function with FilterCommentsService. Removed the old implementation of filter_top_comment.
  • di.py: Added CommentRepository to the repository bindings with a provider method.
  • comment.py: Added ForeignKey constraints to pull_request_id and review_id. Introduced has_made_changes boolean column to track user changes.
  • pull_request.py: Added ForeignKey constraint to repository_id column.
  • __init__.py: Imported and added CommentRepository to the repository list.
  • pull_request_manager.py: Renamed SyncCommentReactions to SyncCommentFeedback in multiple instances.
  • clear.py: Replaced SyncReactionsService with SyncFeedbackService in Clear command.
  • sync_comment_reactions.py: Renamed file and class from SyncCommentReactions to SyncCommentFeedback. Updated service to SyncFeedbackService.
  • transform_to_github_comments.py: Added AST parsing for file comments and included code_vector in CommentModel. Adjusted method to accommodate additional parameter.
  • test_transform_to_github_comments.py: Added patching for file content reading in tests. Adjusted test methods to mock file contents.

New Files:

  • filter_comments_service.py: Introduced FilterCommentsService class to filter and select top comments based on confidence and severity metrics.
  • comment_repository.py: Added CommentRepository class with method to find relevant comments based on organization and code vector.
  • sync_feedback_service.py: Implemented SyncFeedbackService class to synchronize GitHub review comments and applied changes with the database.
  • ast_to_string.py: Added functions to read file contents and parse them into abstract syntax trees (AST) based on file language.
  • test_ast_to_string.py: Added tests for parse_file_contents_to_ast function covering various programming languages and edge cases.
  • test_has_applied_change.py: Added tests to verify the detection of applied changes in code hunks with different scenarios.

Deleted Files:

  • sync_reactions_service.py

74b9fda...bfe58a3

@linear

linear Bot commented Nov 8, 2024

Copy link
Copy Markdown

@derrickpersson derrickpersson marked this pull request as ready for review November 9, 2024 01:19
@derrickpersson

Copy link
Copy Markdown
Contributor Author

/squire update-description

Comment thread squire/database/postgres/repositories/comment_repository.py
Comment thread squire/agents/comment_generation/workflow.py Outdated
Comment thread squire/datasource/github/stages/commands/clear.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants