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

Improve handling of filter categories #210

Open
trz42 opened this issue Aug 14, 2023 · 0 comments
Open

Improve handling of filter categories #210

trz42 opened this issue Aug 14, 2023 · 0 comments

Comments

@trz42
Copy link
Contributor

trz42 commented Aug 14, 2023

Currently, the defined filter categories are architecture, instance, job and repository (see code snippet below). Because they do not share any common prefix, even using just a single letter a, i, j or r is sufficient to uniquely specify a category. If filters with shared prefixes were defined, e.g., repository and request (common prefixes r or re), at least three characters were needed to uniquely identify a category.

Code defining filter categories

FILTER_COMPONENT_ARCH = 'architecture'
FILTER_COMPONENT_INST = 'instance'
FILTER_COMPONENT_JOB = 'job'
FILTER_COMPONENT_REPO = 'repository'
FILTER_COMPONENTS = [FILTER_COMPONENT_ARCH, FILTER_COMPONENT_INST, FILTER_COMPONENT_JOB, FILTER_COMPONENT_REPO]

When working with filters it should be verified if a filter in a command matches a single or multiple of these categories. If it matches more than one category, a response providing guidance should be generated and the command should be ignored. For example, if a command

bot: build re:2023.06

is sent to the bot, a response such as below could be generated

Filter category 're' in command 'bot: build re:2023.06' is ambiguous (matches categories 'repository' and 'request') - so, ignoring it. Please, add more letters to the category to uniquely chose one of the categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant