fix: refactored the query to filter out duplicate integration rows - #806
Merged
Saup21 merged 7 commits intoMay 13, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the query in the Integration model to filter out duplicate integration rows while extending the test coverage in the integration spec.
- Refactored the Integration#filter_by_pacticipant method to first retrieve matching pacticipant IDs and then filter integrations using an OR condition.
- Expanded the integration_spec with new consumer/provider creation chains and added a context to verify matching integrations for a query that applies to both consumer and provider.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spec/lib/pact_broker/integrations/integration_spec.rb | Added additional integration creations and a new context to validate filtering behavior. |
| lib/pact_broker/integrations/integration.rb | Updated the filtering logic to retrieve matching pacticipant IDs and apply the predicate via an OR condition. |
Comments suppressed due to low confidence (2)
spec/lib/pact_broker/integrations/integration_spec.rb:53
- Consider adding test cases where the query string matches only a consumer or only a provider to ensure the filtering behavior is comprehensive.
context "with a filter matching both consumer and provider of the same integration" do
lib/pact_broker/integrations/integration.rb:92
- [nitpick] Consider using '.map(&:id)' instead of '.all.collect(&:id)' for brevity and clarity.
matching_pacticipant_ids = PactBroker::Domain::Pacticipant.filter(:name, query_string).select(:id).all.collect(&:id)
…nts and added more tests
pahnin
approved these changes
May 13, 2025
…red-integrations-showing-duplicates' into fix/PACT-4071-filtered-integrations-showing-duplicates
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.
No description provided.