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

Update list limits for alert profiles dropdowns #3239

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

lunkwill42
Copy link
Member

@lunkwill42 lunkwill42 commented Nov 24, 2024

For some long-forgotten reason, there are limits configured on the length of dropdown lists in Alert Profiles: One value per match field is set in the database. The limits are set to 1000 for all fields, but some users do in fact have more than 1000 communication rooms registered in their NAV installations.

The code does not allow unlimited lengths, so a quickfix for now is to increase the limit ten-fold. A more long-term fix would be to look into why there are limitations at all (aside from the fact that selecting from a dropdown with > 1000 values and no search functionality is bad UX)

Fixes #2908

@lunkwill42 lunkwill42 self-assigned this Nov 24, 2024
Copy link

github-actions bot commented Nov 24, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 991 0 13.03s
✅ PYTHON ruff 987 0 0.1s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@lunkwill42 lunkwill42 requested a review from a team November 24, 2024 13:57
@lunkwill42 lunkwill42 marked this pull request as ready for review November 24, 2024 13:57
Copy link

Test results

    9 files      9 suites   8m 30s ⏱️
2 139 tests 2 139 ✅ 0 💤 0 ❌
4 017 runs  4 017 ✅ 0 💤 0 ❌

Results for commit 6259afc.

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.30%. Comparing base (49480a1) to head (ac5267c).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3239   +/-   ##
=======================================
  Coverage   60.30%   60.30%           
=======================================
  Files         605      605           
  Lines       43685    43685           
  Branches       48       48           
=======================================
  Hits        26343    26343           
  Misses      17330    17330           
  Partials       12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

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

My only comment is that there is still a word missing in the commit message and that the SQL file should be renamed

@lunkwill42
Copy link
Member Author

My only comment is that there is still a word missing in the commit message and that the SQL file should be renamed

Why should it be renamed?

@johannaengland
Copy link
Contributor

My only comment is that there is still a word missing in the commit message and that the SQL file should be renamed

Why should it be renamed?

Because currently it is sc.05.12.0100.sql and following https://nav.readthedocs.io/en/latest/hacking/hacking.html#changing-the-schema-migrations the point should be the next available, so 0002

@lunkwill42
Copy link
Member Author

Why should it be renamed?

Because currently it is sc.05.12.0100.sql and following https://nav.readthedocs.io/en/latest/hacking/hacking.html#changing-the-schema-migrations the point should be the next available, so 0002

If you want to be square about it, the next free number on master is in fact 0001. All other PRs beware!

The number itself means nothing, it is just that migration scripts will be run in numerical order (but anyone who runs the navsyncdb can optionally choose to run scripts out-of-order) , so if you need a particular ordering, you should take care to number your scripts in that order. I chose 100 to be sure this doesn't overlap with any other incoming PRs for 5.12.

For some long-forgotten reason, there are limits configured on the
length of dropdown lists in Alert Profiles: One value per match field
is set in the database.  The limits are set to 1000 for all fields, but
some users do in fact have more than 1000 communication rooms registered
in their NAV installations.

The code does not allow unlimited lengths, so a quickfix for now is
to increase the limit ten-fold.  A more long-term fix would be to look
into why there are limitations at all (aside from the fact that
selecting from a dropdown with > 1000 values and no search functionality
is bad UX)
@lunkwill42 lunkwill42 force-pushed the bugfix/alertprofiles-list-limit branch from 6259afc to ac5267c Compare November 29, 2024 08:38
Copy link

sonarcloud bot commented Nov 29, 2024

@lunkwill42 lunkwill42 merged commit 1953020 into master Nov 29, 2024
10 of 11 checks passed
@lunkwill42 lunkwill42 deleted the bugfix/alertprofiles-list-limit branch November 29, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Alert profile filter - list_limit reached
2 participants