-
Notifications
You must be signed in to change notification settings - Fork 63
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 credentialSecret to snapshot model and update logic to use it #3649
Conversation
Am going to spin up a test env to do some more pointing and clicking before we merge, but please continue the review of the code. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3649 +/- ##
==========================================
- Coverage 41.88% 41.88% -0.01%
==========================================
Files 628 629 +1
Lines 24417 24413 -4
Branches 5977 5973 -4
==========================================
- Hits 10228 10225 -3
+ Misses 14189 14188 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hitting a postgres-only test failure. Can recreate locally on pg, but on sqlite. Investigating... |
Test fixed. |
code and tests read fine but i am pulling this branch for a quick run through. |
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.
code review and local testing with app device and other instance snapshot deploys 👍
@knolleary Approved. Had to update branch and so tests are re-running. Merge when tests pass. |
@knolleary now that #3645 is merged, we can merge this. #3645 had migration "20240325-01-add-teamTypeScope-to-FlowTemplates.js" which has a date 2 days prior to this PR "20240327-01-add-credentialSecret-to-snapshots.js" I've merged main to this and will merge as soon as tests pass unless you shout up |
@Steve-Mcl all good - thanks |
Fixes #3644
Description
This adds
credentialSecret
to the snapshot model so we no longer depend on the parent of the snapshot existing. This makes it easier to reason about the snapshots as they get moved around.The db migration will populate the new column with the appropriate value from with the Device or ProjectSettings tables. I've tested this migration in both sqlite and postgres.
I have looked at many of the pipeline tests that relate to snapshots. They checked the result had a credentials property, but didn't try to validate the value. I've updated the tests in a few places to validate the credentials are properly encrypted with the expected key.
I've also done various bits of manual testing with rollbacks, instance-assigned devices, app-assigned devices, pipeline deploys to instances and devices/device groups.