Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request index: filter by source/target project #17408

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

ncounter
Copy link
Contributor

@ncounter ncounter commented Feb 20, 2025

request-filter-project

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Feb 20, 2025
@ncounter ncounter force-pushed the request-index-filter-project branch 2 times, most recently from 2c7306c to 778103d Compare February 20, 2025 12:03
@ncounter ncounter marked this pull request as ready for review February 20, 2025 12:03
@ncounter ncounter force-pushed the request-index-filter-project branch 3 times, most recently from 6539300 to 84d54fb Compare February 20, 2025 13:44
@krauselukas krauselukas added the review-app Apply this label if you want a review app started label Feb 20, 2025
@obs-bot
Copy link
Collaborator

obs-bot commented Feb 20, 2025

@ncounter ncounter force-pushed the request-index-filter-project branch from 84d54fb to d6ecd90 Compare February 20, 2025 15:16
@ncounter ncounter force-pushed the request-index-filter-project branch from d6ecd90 to 7c2a744 Compare February 20, 2025 15:18
@ncounter ncounter merged commit 70fe64c into openSUSE:master Feb 21, 2025
21 checks passed
Comment on lines +41 to +42
scope :from_project_names, ->(project_names) { where(bs_request_actions: { source_project: project_names }) }
scope :to_project_names, ->(project_names) { where(bs_request_actions: { target_project: project_names }) }
Copy link
Member

Choose a reason for hiding this comment

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

What's the difference to the scope above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ones above take a single string and they query for a single partial match aka 'LIKE %project%'. The new ones take an array of complete project names and they query for perfect matches aka 'IN [project1, project2]'.
Combining both is possible but feels like overcomplicating them because it should always consider both matching criteria.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app review-app Apply this label if you want a review app started
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants