Add publish option that does not affect publish status while migrating everything
#391
hpohlmeyer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The scenario
There are two cases where you might want to run a migration:
This is about the second option. Let's say you have a component that looks like this:
and you want to migrate to something like this:
And then there are three stories that would be affected by the migration
draftstatuspublished-with-changesstatuspublishedstatusFrom a dev perspective I would assume I can run the migrations and delete all legacy code that handles the
nameproperty, since onlyfirstNameandlastNameare used from now on.From a content-editor perspective I do not want my status to change at all, because it is an internal migration that does not change the content.
The current state
Since it is not quite clear from the docs how every status affects the results, I ran some tests and these are the outcomes (v4.10.0):
without flag
draftchangedchanged--publish=all
publishedpublishedpublished--publish=published
draftchangedpublished--publish=published-with-changes
draftpublishedchangedThe problem
The
publishedoption keeps every status as-is, so that matches what I want as a content-editor, but it does not migrate the published values for stories which are currentlypublished-with-changes. That is a problem, because when I remove the code that handles thenameproperty, my site will break in prod.Possible solution
For this case, another option that works like this would work:
draftchangedpublishedBy doing that as a developer, I don't mess with the content-editor's publish states, and I can safely remove the code, that handles the
nameproperty.Another option could be to split the
publishflag into multiple dedicated flags, that control the status migration, the draft json migration and the production json separately. Although to mimic the current behavior this would get quite complex, because you'd also need to control the migration behavior per publish status.I have tried to implement that myself, but the update story endpoint from the management api used under the hood does not let me decouple the update from the status either if I am not missing something. I would be happy for any hints on how this could be implemented.
Beta Was this translation helpful? Give feedback.
All reactions