-
Notifications
You must be signed in to change notification settings - Fork 26
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
New: Migration Scripts (fixes #89) #90
base: master
Are you sure you want to change the base?
Conversation
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.
Just a few changes that have come up from suggestions and a few version number changes.
Committing review suggestions. Co-authored-by: joe-allen-89 <[email protected]>
whereContent return corrections Co-authored-by: joe-allen-89 <[email protected]>
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.
Just a few pointers, but style and format really good and consistent @joe-replin
migrations/v3.js
Outdated
/** | ||
* * Add JSON field to component and set attribute. | ||
*/ | ||
mutateContent('adapt-contrib-assessmentResults - add assessmentResult._routeToAssessment', async () => { |
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.
_routeToAssessment
was added from v2.3.1
and v2.4.0
; consider splitting this into own describe
.
Also move _routeToAssessment
to the _retry
object
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.
Great finds, thank you.
migrations/v3.js
Outdated
@@ -0,0 +1,46 @@ | |||
import { describe, whereContent, whereFromPlugin, mutateContent, checkContent, updatePlugin } from 'adapt-migrations'; | |||
|
|||
describe('adapt-contrib-assessmentResults - v2.3.0 > v3.0.0', async () => { |
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.
The global ariaRegion
was added between v2.4.0
and v3.0.0
but is missing in this script
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.
Thanks for catching that.
migrations/v3.js
Outdated
/** | ||
* * Add JSON field to component and set attribute. | ||
*/ | ||
mutateContent('adapt-contrib-assessmentResults - add assessmentResult._resetType', async () => { |
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.
_resetType
was added from v2.3.1
and v2.4.0
; consider splitting this into own describe
.
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.
Wow. that was buried down deep. Good find.
migrations/v5.js
Outdated
@@ -0,0 +1,36 @@ | |||
import { describe, whereContent, whereFromPlugin, mutateContent, checkContent, updatePlugin } from 'adapt-migrations'; | |||
|
|||
describe('adapt-contrib-assessmentResults - v3.0.0 > v5.2.0', async () => { |
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.
global retryText
was added between v5.1.1
and v5.1.2
_completionBody
default changed between v5.2.0
and v5.2.1
/** | ||
* * Add field to each item in a JSON array and set blank. | ||
*/ | ||
mutateContent('adapt-contrib-assessmentResults - add assessmentResultInstance._bands.feedbackNotFinal attribute', async () => { |
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.
feedbackNotFinal
was added between v5.1.7
and v5.2.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.
It's nearly there, just a few comments @joe-replin
@@ -57,3 +51,48 @@ describe('adapt-contrib-assessmentResults - v2.0.3 > v2.3.0', async () => { | |||
|
|||
updatePlugin('adapt-contrib-assessmentResults - update to v2.3.0', { name: 'adapt-contrib-assessmentResults', version: '2.3.0', framework: '>=2.1.0' }); | |||
}); | |||
|
|||
describe('adapt-contrib-assessmentResults - v2.3.0 > v2.4.0', async () => { |
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.
Nitpick: these changes came in v2.3.1
😄
|
||
mutateContent('adapt-contrib-assessmentResults - add assessmentResult._retry._routeToAssessment', async () => { | ||
assessmentResults.forEach(assessmentResult => { | ||
assessmentResult._retry.forEach(item => { |
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.
_retry
is an object
|
||
checkContent('adapt-contrib-assessmentResults - check assessmentResult._retry._routeToAssessment atrribute', async () => { | ||
const isValid = assessmentResults.every(assessmentResult => | ||
assessmentResult._routeToAssessment.every(item => |
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.
_routeToAssessment
was a boolean added to the _retry
object
checkContent('adapt-contrib-assessmentResults - check assessmentResult._retry._routeToAssessment atrribute', async () => { | ||
const isValid = assessmentResults.every(assessmentResult => | ||
assessmentResult._routeToAssessment.every(item => | ||
item && item.feedbackNotFinal === false |
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.
Not sure why this is here?
@@ -1,18 +1,71 @@ | |||
import { describe, whereContent, whereFromPlugin, mutateContent, checkContent, updatePlugin } from 'adapt-migrations'; | |||
|
|||
describe('adapt-contrib-assessmentResults - v3.0.0 > v5.2.0', async () => { | |||
describe('adapt-contrib-assessmentResults - v3.0.0 > v5.1.2', async () => { |
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.
Nitpick: global retryText
was added in v5.1.1
; consider replacing v3.0.0
with v5.1.1
for consistency
updatePlugin('adapt-contrib-assessmentResults - update to v5.1.2', { name: 'adapt-contrib-assessmentResults', version: '5.1.2', framework: '>=5.19.1' }); | ||
}); | ||
|
||
describe('adapt-contrib-assessmentResults - v5.1.2 > v5.1.7', async () => { |
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.
I think this describe
should be removed as you have provided the corrected version below?
New
Testing
Test using this branch of the Adapt Framework which includes the scripts that handle the migration.
adaptlearning/adapt_framework#3633