-
Notifications
You must be signed in to change notification settings - Fork 22
Prevent divide-by-zero errors in cache_score function #7026
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe update revises the handling of the Changes
Assessment against linked issues
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
flowdb/bin/build/0030_utilities.sql (1)
270-270
: Internalise divide-by-zero guard incache_score
Centralising thegreatest(tablesize, 0.00001)
check insidecache_score
is an improvement for robustness. As an enhancement, consider declaring the functionIMMUTABLE
(since it has no side effects and depends only on its inputs) and adding theSTRICT
modifier to explicitly handleNULL
inputs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
flowdb/bin/build/0030_utilities.sql
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: CodeQL-Build
- GitHub Check: Summary
- GitHub Check: run_build_pipeline
FlowAuth
|
Project |
FlowAuth
|
Branch Review |
fix-cache-score
|
Run status |
|
Run duration | 03m 13s |
Commit |
|
Committer | James Harrison |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
3
|
|
0
|
|
6
|
|
36
|
View all changes introduced in this branch ↗︎ |
Tests for review
cypress/e2e/role_list.js • 1 failed test
Test | Artifacts | |
---|---|---|
role list screen > Add blank role |
Test Replay
Screenshots
|
add_new_server.js • 2 flaky tests
Test | Artifacts | |
---|---|---|
Server management > Add duplicate Server name |
Test Replay
Screenshots
|
|
Server management > Add server |
Test Replay
Screenshots
|
add_new_user.js • 1 flaky test
Test | Artifacts | |
---|---|---|
User management > Add password with less strength |
Test Replay
Screenshots
|
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Worth adding a test case for the bug?
Closes #7027
I have:
Description
We already had a safeguard in the FlowDB
touch_cache
function to increase table size to a non-zero value. This PR moves the safeguard intocache_score
, so that it takes effect everywherecache_score
is used.Summary by CodeRabbit