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

schema: Require & use citext extension #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yhabteab
Copy link
Member

@yhabteab yhabteab commented May 16, 2023

To allow case-insensitive matches when filtering by these columns.

cc @nilmerg

@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label May 16, 2023
@yhabteab yhabteab requested a review from julianbrost May 16, 2023 09:41
Copy link
Collaborator

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

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

I think most changes should be fine, but others probably need individual/more careful consideration (see individual comments).

In general:

  • The changes that don't have individual comments should be fine for doing them immediately.
  • All the others should probably be discussed first, so please don't treat the comments as change requests for now.

If the changes without individual comments are useful enough on it's own, I'd do them first and postpone the rest to a later point. /cc @nilmerg

schema/pgsql/schema.sql Show resolved Hide resolved
schema/pgsql/schema.sql Outdated Show resolved Hide resolved
schema/pgsql/schema.sql Outdated Show resolved Hide resolved
schema/pgsql/schema.sql Show resolved Hide resolved
@nilmerg
Copy link
Member

nilmerg commented Oct 4, 2023

Display names should be case-insensitive, as they're used as quick search columns in their respective view. This affects sources, schedules, rules, channels, contacts and contactgroups.

Id tags, or tags in general, should be case-sensitive on the other hand. They resemble e.g. icinga object names, and these are also case-sensitive. This also applies to extra tags. In Icinga DB, custom variable names are case-insensitive as this was the case in the IDO as well. Here we have no such predecessor with which we should be compatible. So being case-sensitive should be our way to go here.

The username (referencing the name of a contact in the interface) should be case-insensitive, as that's what it is in Web anyway.

@yhabteab yhabteab force-pushed the require-ctext-extension branch 2 times, most recently from 3b5c986 to 978778b Compare October 9, 2023 15:28
@yhabteab yhabteab requested a review from nilmerg October 9, 2023 15:29
schema/pgsql/schema.sql Outdated Show resolved Hide resolved
Copy link
Collaborator

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

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

Change itself looks fine for me now, if @nilmerg gives an ok as well, we can pick the correct sequence number for the upgrade file and merge it.

@yhabteab yhabteab force-pushed the require-ctext-extension branch 2 times, most recently from 811d68d to 84e59c9 Compare October 20, 2023 12:49
@yhabteab yhabteab requested review from nilmerg and removed request for nilmerg October 20, 2023 12:50
@yhabteab
Copy link
Member Author

Change itself looks fine for me now, if @nilmerg gives an ok as well, we can pick the correct sequence number for the upgrade file and merge it.

Ping @nilmerg

Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

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

Extra tag values should be case-insensitive.

@julianbrost
Copy link
Collaborator

Extra tag values should be case-insensitive.

Why? That would mean that the object_id_tag and object_extra_tag tables would become inconsistent. Is that really intended?

@nilmerg
Copy link
Member

nilmerg commented Apr 22, 2024

Because that's what users expect. Another reason, by the way, why we shouldn't hide values in names. Inconsistent? Of course they are. They have different names after all... (I don't see any reason why any inconsistency should be of interest here)

@julianbrost
Copy link
Collaborator

Because that's what users expect. Another reason, by the way, why we shouldn't hide values in names.

That would result in searching by host name being case-sensitive but searching by host group name being case-insensitive. To me, that doesn't sound like something anyone would expect.

@nilmerg
Copy link
Member

nilmerg commented Apr 29, 2024

Fair enough. But then I'd propose a second column for each with a _ci suffix. Would you like that?

No, seriously. Web differentiates between id and extra tag, so a user should not be surprised that they are handled differently.

@julianbrost
Copy link
Collaborator

No, seriously. Web differentiates between id and extra tag, so a user should not be surprised that they are handled differently.

On the other hand, for rule.object_filter, neither the filter syntax nor the daemon differentiates between ID and extra tags. Changing this would mean that filtering for a key there would be case-sensitive or case-insensitive on a per-object basis, depending on whether this object gave the key as ID or extra tag.

Fair enough. But then I'd propose a second column for each with a _ci suffix. Would you like that?

First of all, I'd like to know the reason for the change and not just some vague claim that users expect it. I mean for most of the columns changed in this PR, I don't care too much as the most the daemon has to do with them is to just copy it's value somewhere (to a log message, or a notification message maybe). But for tags, this is different, as they have to be compared by the daemon as well.

@nilmerg
Copy link
Member

nilmerg commented Apr 29, 2024

It's not just a vague claim. During the user testing at OSMC last year, we noticed that user's don't make much of a difference how a lookup for a value (in the searchbar) and how a filter for one works.

Take this example:
image

It doesn't make a difference which suggestion you choose or whether one at all. You'll find hosts with a custom variable called department set to backend.

Or phrased differently: You'll see the value backend and you'll find hosts that use this value. It doesn't matter whether you look for this value in the searchbar or whether you search for it as part of a filter.

Now, what this means for case-sensitivity is this: If the lookup in the searchbar is case-insensitive, the filter must as well.

And this is what the user testing also showed: Users expected the lookup in the searchbar to be case insensitive.

So if I look for baCK, I'll get backend as suggestion and with department=baCK I should find objects matching department=backend.

@julianbrost
Copy link
Collaborator

Doesn't that argument boil down to "if it appears in a search bar, it should be handled case-insensitively everywhere"?

Otherwise, how would you explain that host~*.prod.example.com does not match SOMETHING.PROD.EXAMPLE.COM (because well, that happened because Windows happens to love upper-case host names).

Case-handling is messy already within Icinga:

The change you're asking for is inconsistent with both (I don't know if there's something else it's consistent with) and would even introduce inconsistencies within this project. I'm sorry, but I fail to see how this is an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants