-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃彈 Migrated unsplash setting to up to date convention #12632
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.
I would either add irreversible: true
in the config (that would require an update to the helper) or return Promise.reject();
in down()
like in
Ghost/core/server/data/migrations/utils.js
Line 261 in 873d21d
return Promise.reject(); |
I think it's better than doing nothing so that we can't run this migration twice.
@tpatel good spot! Changed the migration 馃槈 |
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.
awesome 馃檶
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 looks good, only the comment about duplicate id
's is essential
core/server/data/migrations/versions/4.0/10-refactor-unsplash-setting.js
Outdated
Show resolved
Hide resolved
cbbf6a8
to
c9795c5
Compare
f0777d7
to
7cfb38c
Compare
7cfb38c
to
0bb7be3
Compare
@daniellockyer @tpatel @allouis I've updated the migration here to follow idempotence rule. The commit which fixes is is this one - 0bb7be3 |
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 migration looks great 馃檶
refs TryGhost#10318 - JSON object format used in previous "unsplash" setting was considered an anti-pattern. Flat structure was extracted out of the "unsplash.isActive" JSON. - The naming convention uses `amp` as a precedent (TryGhost/Product#331 (comment))
0bb7be3
to
7298f70
Compare
refs TryGhost#10318 - API changes introduced: canary/v4 Admin API GET /settings/ (browse) + "unsplash" present in response as boolean value GET /settings/:settingName (read) + "unsplash" present in response as boolean value PUT /settings/ (edit) + "unsplash" updates setting, accepts ONLY boolean format v3 Admin API GET /settings/ (browse) + "unsplash" present in response with object value GET /settings/:settingName (read) + "unsplash" present in response with object value PUT /settings/ (edit) + "unsplash" updates setting, accepts either boolean or object formats v2 Admin API GET /settings/ (browse) + "unsplash" present in response with object value GET /settings/:settingName (read) + "unsplash" present in response with object value PUT /settings/ (edit) + "unsplash" updates setting, accepts object format
no issue - The migration didn't want to go away after rebases combined with renames
refs TryGhost#10318 - Previous version of migration was not following the idempotence rule of migrations
7298f70
to
394d204
Compare
refs TryGhost/Ghost#12632 - The `unsplash` setting has been migrated to a new format - plain boolean value. This is why it's no longer needed to do any serialization dances
refs TryGhost/Ghost#12632 - The `unsplash` setting has been migrated to a new format - plain boolean value. This is why it's no longer needed to do any serialization dances
refs TryGhost/Ghost#12632 - The `unsplash` setting has been migrated to a new format - plain boolean value. This is why it's no longer needed to do any serialization dances
splits #12615 into "slack" and "unsplash" parts
refs closes TryGhost/Team#331
refs #10318
Note to reviewers: the part that needs thorough review is the migration located in 10-refactor-unsplash-setting.js file. The rest is optional if you feel like having a look 馃槈
TODO:
Object
return type in v4 apiChange/compatibility table for this PR:
importer
unsplash
鉁旓笍 import from both boolean AND objectcanary/v4
GET /settings/
(browse)unsplash
鉁旓笍 present in response withboolean
valueGET /settings/:settingName
(read)unsplash
鉁旓笍 present in response withboolean
valuePUT /settings/
(edit)unsplash
鉁旓笍 updates setting, accepts a booleanv3 Admin API
GET /settings/
(browse)unsplash
鉁旓笍 present in response withObject
valueGET /settings/:settingName
(read)unsplash
鉁旓笍 present in response withObject
valuePUT /settings/
(edit)unsplash
鉁旓笍 updates setting, accepts either boolean or objectv2 Admin API
GET /settings/
(browse)unsplash
鉁旓笍 present in response with object valueGET /settings/:settingName
(read)unsplash
鉁旓笍 present in response with object valuePUT /settings/
(edit)unsplash
鉁旓笍 updates setting, accepts object