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

Make ‘required words’ that start with a '+' an absolute requirement #8791

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Tensai75
Copy link

@Tensai75 Tensai75 commented Sep 1, 2024

Proposed changes in this pull request:
This PR is based on my rejected PR #8786. However, this PR does not change the current behaviour of 'required words', but introduces the new possibility to add required words with a leading plus sign (+). Words with a leading plus sign are an absolute requirement and search results that do not contain all required words with a leading plus sign will be ignored. The log contains a message indicating the first required word which was missing if the result was ignored.

If no required word has a leading plus sign, the ‘required words’ function behaves as usual (at least one of the words must be present), and therefore this change is not disruptive. Rather, it extends the ‘required words’ functionality and makes it possible to define words that must always and cumulatively be present.

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read contribution guide

Summary by CodeRabbit

  • New Features

    • Updated user interface labels to clarify that words starting with a plus sign must always be included in search queries.
    • Enhanced search functionality with stricter checks for required words during filtering.
  • Bug Fixes

    • Improved the filtering process to ensure that specified required words are accurately validated.

Copy link
Contributor

coderabbitai bot commented Sep 1, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes involve updates to the user interface and functionality of the SickChill application. Specifically, modifications were made to Mako template files to clarify search requirements regarding words prefixed with a plus sign. Additionally, a new function was introduced in the Python code to validate the presence of required words in show names, enhancing the filtering process for releases.

Changes

Files Change Summary
sickchill/gui/slick/views/config_search.mako, sickchill/gui/slick/views/editShow.mako Updated labels to clarify that words starting with a plus sign must always be present in search queries.
sickchill/oldbeard/show_name_helpers.py Introduced contains_all_words function for word presence validation and modified filter_bad_releases logic to enforce required words. Added remove_plus_sign helper function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Validator
    participant Filter

    User->>UI: Enter search terms
    UI->>Validator: Validate terms
    Validator->>Filter: Check required words
    Filter-->>Validator: Validation result
    Validator-->>UI: Display results
Loading

🐰 In the fields where I hop and play,
New words are here to brighten the day!
With plus signs shining, they must stay,
Filtering shows in a clearer way.
Hooray for changes, let's celebrate! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 2, 2024

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Sep 2, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f40d45b and e4f5251.

Files selected for processing (3)
  • sickchill/gui/slick/views/config_search.mako (1 hunks)
  • sickchill/gui/slick/views/editShow.mako (1 hunks)
  • sickchill/oldbeard/show_name_helpers.py (3 hunks)
Additional comments not posted (5)
sickchill/oldbeard/show_name_helpers.py (3)

38-57: LGTM!

The new contains_all_words function is well-implemented and serves the purpose of checking for the presence of all specified words in a name. The regular expression ensures that partial matches do not falsely satisfy the condition. The function handles both string and list input formats, providing flexibility to the caller.


85-86: LGTM!

The new remove_plus_sign helper function is a simple utility that cleans up the list of words by removing leading '+' characters. It is used in multiple places to ensure consistency in how required words are processed.


92-94: LGTM!

The changes in the filter_bad_releases function enhance the filtering process by adding a stricter requirement for certain words, improving the overall functionality of the release filtering mechanism. The use of the remove_plus_sign function ensures consistency in how required words are processed. The logging statements provide useful information when a release is ignored due to missing required words.

Also applies to: 105-116

sickchill/gui/slick/views/editShow.mako (1)

373-373: LGTM!

The new label clearly communicates the requirement for search terms starting with a plus sign to always be present. This improves the user experience by providing explicit guidance on the search functionality.

sickchill/gui/slick/views/config_search.mako (1)

226-226: LGTM!

The updated label text clarifies that words starting with a plus sign must always be present in the search results. This improves the user experience by explicitly communicating the expected behavior.

@BKSteve
Copy link
Collaborator

BKSteve commented Sep 2, 2024

Please also consider in the future giving your edits a relevant name to the pull request that isn't develop thus removing any possible mismatch between SC and your develop.

Copy link

github-actions bot commented Oct 4, 2024

This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale Closing old issues with no activity - Comment to reopen if necessary label Oct 4, 2024
@Tensai75
Copy link
Author

Tensai75 commented Oct 5, 2024

Push...
Will you merge or not?

Copy link

stale bot commented Oct 5, 2024

This issue has now been unmarked as "stale"

@stale stale bot removed the Stale Closing old issues with no activity - Comment to reopen if necessary label Oct 5, 2024
@miigotu
Copy link
Contributor

miigotu commented Oct 7, 2024

Sorry I have been away, I'll try to get this tested manually soon.

@SickChill SickChill deleted a comment from Gabe-a-Thon Oct 16, 2024
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.

3 participants