-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add user to flow to StorageFlows table, to record who triggered auto snapshot #4518
base: main
Are you sure you want to change the base?
Conversation
Need to double check how this behaves when a snapshot is exported/imported |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4518 +/- ##
==========================================
- Coverage 78.15% 78.08% -0.07%
==========================================
Files 299 301 +2
Lines 14261 14299 +38
Branches 3235 3243 +8
==========================================
+ Hits 11145 11165 +20
- Misses 3116 3134 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Needs nr-launcher pr FlowFuse/nr-launcher#287 |
Note we now have #4526 that also contains a migration. Whichever merges first, the other one will need to rename its migration to ensure the ordering is correct. |
I have renamed the migration in this PR to 02 so merge the OTHER PR first |
@@ -25,14 +25,20 @@ module.exports = async function (app) { | |||
|
|||
app.post('/:projectId/flows', async (request, response) => { | |||
const id = request.params.projectId | |||
let UserId = null | |||
if (request.headers['ff-user']) { | |||
UserId = app.db.models.User.decodeHashid(request.headers['ff-user'])[0] |
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.
UserId = app.db.models.User.decodeHashid(request.headers['ff-user'])[0] | |
UserId = app.db.models.User.decodeHashid(request.headers['ff-user'])?.[0] || null |
// CHECK ME | ||
onDelete: 'SET NULL', | ||
// CHECK ME | ||
onUpdate: 'CASCADE' |
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.
// CHECK ME | |
onDelete: 'SET NULL', | |
// CHECK ME | |
onUpdate: 'CASCADE' | |
onDelete: 'SET NULL', | |
onUpdate: 'CASCADE' |
happy with cascades
Given the comments in the parent issue, has this PR been replaced by #4530 ? Not clear if this PR is required in the 2.9 release or not. |
Not required for 2.9 Nick. Its partner PR FlowFuse/nr-launcher#287 is switched to draft for now. |
@Steve-Mcl thanks - have marked this as a draft as well then |
part of #4413
Description
Records which user triggered the last flow deploy so it can be used in snapshot data.
Related Issue(s)
#4413
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label