-
Notifications
You must be signed in to change notification settings - Fork 43
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
Calculate profile status based on evaluation history tables #4149
Conversation
c83df0c
to
979eeae
Compare
RAISE WARNING 'default case should not happen'; | ||
END CASE; | ||
|
||
-- This turned out to be very useful during debugging |
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.
This comment is copy-pasted from the previous trigger function, but I can testify that it was in fact very useful during debugging.
Changes unknown |
AND les.rule_entity_id = NEW.rule_entity_id; | ||
|
||
IF v_new_status IS NULL THEN | ||
RAISE EXCEPTION 'oh no'; |
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.
While this gave me a chuckle, perhaps we should use a more descriptive exception message?
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.
This was a debugging message I forgot to remove
Remove the existing triggers on rule_evaluations and rule_details_eval. Replace with triggers on latest_evaluation_statuses. Tweak the trigger logic to work on the new tables.
6678a1d
to
ebd7f2b
Compare
@@ -180,6 +181,61 @@ func upsertEvalStatus( | |||
require.NoError(t, err) | |||
} | |||
|
|||
func createRuleEntity( |
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.
All the changes in this test file are needed to use the evaluation history tables instead of the old rule evaluations tables when testing profile status transitions.
Remove the existing triggers on rule_evaluations and rule_details_eval.
Replace with triggers on latest_evaluation_statuses. Tweak the trigger
logic to work on the new tables.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: