Skip to content

feat: Add filter-by-user functionality #65

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

Merged
merged 3 commits into from
May 1, 2025

Conversation

rbarker-dev
Copy link
Contributor

Adds new class: QueryFilter
Adds new functionality: Filter by user
Updates cli to remove nargs
Sets filters in version2query object
Defines filter mechanism in main

Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
Filter by teams

Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
@rbarker-dev rbarker-dev added the feature New Feature label May 1, 2025
@rbarker-dev rbarker-dev self-assigned this May 1, 2025
@rbarker-dev rbarker-dev linked an issue May 1, 2025 that may be closed by this pull request
@github-actions github-actions bot added the feat label May 1, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces functionality to filter queries by user alongside existing team filters while refactoring how filters are applied. Key changes include creating a new QueryFilter class to encapsulate filter logic, updating the Version2Query class to use these filters (and removing the explicit teams parameter), and modifying the CLI configuration to support the new user filter.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version2.py Added a filters dictionary and updated the process call to use filters.
src/version2query.py Integrated QueryFilter, added filter_items_by_user, and streamlined process.
src/version2config.py Removed nargs for include-user to align with the new CLI approach.
src/queryFilter.py Introduced the new QueryFilter class to manage various filter criteria.
current-implemented-CLI.md Updated CLI documentation to reflect the new include-user parameter.
Comments suppressed due to low confidence (1)

src/queryFilter.py:115

  • [nitpick] For consistency, consider renaming 'exclude_label' to 'exclude_labels' to match the plural naming pattern used for similar properties.
def exclude_label(self) -> list[str]:

print("[red]Processing failed.[/red]")
return
raise RunTimeError("Processing failed.")
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

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

Consider handling processing failures gracefully (for example, by exiting with an error code) rather than raising a RunTimeError, to maintain conventional CLI behavior.

Suggested change
raise RunTimeError("Processing failed.")
sys.exit(1)

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to raise here instead of exit.

@rbarker-dev rbarker-dev merged commit 7a82bb0 into main May 1, 2025
5 checks passed
@rbarker-dev rbarker-dev deleted the 50-add-filter-by-user-include-only branch May 1, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat feature New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add filter by user (include only)
2 participants