-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(backend): Toggle flow online or offline #3170
Conversation
🤖 Hasura Change Summary compared a subset of table metadata including permissions: Tracked Tables (2)Updated Tables (1)
|
Removed vultr server and associated DNS entries |
eade504
to
940a2c0
Compare
940a2c0
to
3856c52
Compare
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.
Looking good & thorough (appreciate all the testing here), but a few questions around domain assumptions here!
Plus one more point I'm thinking about for "Next steps..."
- Only write analytics records when URL does not have param
?analytics=false
AND when flow status is "online" !- If we can just skip writing the tracking events altogether when flows are "offline", that should save us having to add joins to
flow_status_history
to the analytics views? - This would similarly assume that existing flows are online by default & new ones are offline I think?
- If we can just skip writing the tracking events altogether when flows are "offline", that should save us having to add joins to
e2e/tests/api-driven/src/flowStatusHistory/flowStatusHistory.feature
Outdated
Show resolved
Hide resolved
This is an elegant and clever solution - very much on board! Much easier than a tricky join and actually matches the model we want and users would expect (analytics are collected for "online" services only). |
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.
Most recent changes look good!
Please see theopensystemslab/planx-new#3170 for context. This PR adds a helper method to toggle the status of the flow. This is used in E2E tests, and will be called by Editors in the frontend.
eec4867
to
29a71ed
Compare
- Setup table and populate - Setup trigger - Add status column to flows, setup permissions
- This has some implications for e2e tests that are best handled in isolation in another PR
8a462a6
to
88939f6
Compare
What does this PR do?
flows.status
column, which can be one of "online" or "offline"flow_status_history
audit table which could be used to check the status of a flow at a given point in time, and could be used to filter analytics if we wished to do sotack_flow_status_history()
which has the following behaviour -UPDATE
toflow.status
orINSERT
toflows
flow_status_history
record, and opens new one with toggled statusTesting
Next steps...
Regression tests passing here - https://github.com/theopensystemslab/planx-new/actions/runs/9162033526