contentful / contentful-merge

CLI to merge entries between environments
MIT License
17 stars 6 forks source link

Merging assets #891

Open toby-palau opened 4 months ago

toby-palau commented 4 months ago

Hi team!

I've been using contentful-merge for a couple weeks now and it works very well for me. The only issue we're having is that our links to assets break after the merge. I know your documentation says migrating assets is not supported, but it would be very helpful if they would.

Feature request Ability to merge assets from one environment to the other.

Workflow Our workflow is as follows:

Error Currently, when I try to apply a changeset that includes links to images that are not in the production environment, I'm getting an error like below:

Start applying changeset to preview 📥
❯ Applying the Changeset
  ✔ Load changeset data [0.0s]
  ✔ Validating changeset [0.4s]
  ✔ Deleting 0 entries [0.0s]
  ✖ Adding 1/1 entries
  ◼ Updating entries

Merge was unsuccessful 💔
An error occurred while publishing an entry.
The changeset was only partially applied. The merge was stopped due to the following error (entry id: ***):

{
  "sys": {
    "type": "Error",
    "id": "UnresolvedLinks"
  },
  "message": "Validation error",
  "details": {
    "errors": [
      {
        "name": "notResolvable",
        "link": {
          "type": "Link",
          "linkType": "Asset",
          "id": "***"
        },
        "path": [
          "fields",
          "avatarImage",
          "en-US"
        ]
      }
    ]
  },
  "requestId": "***"
}

Mitigation issues Despite the error, the entries do seem to appear in the production environment, but the links to the image assets are broken and the entries remain unpublished. So we need to go through each of the entries and reupload the assets, but with each following migration, the links will be broken again.

My question I would assume this workflow is pretty standard. If not, would you recommend an alternative workflow? If yes, would you consider developing a feature to migrate image assets so that the asset links don't break?

I look forward to your answer, thanks in advance!

Toby

charlescolbourn commented 4 months ago

I'm having the same problem. I just spent an hour trying to figure out what I was doing wrong because this seems like an obvious piece of workflow that should just work!

bvasen commented 1 month ago

Having the same issue. Is there any plan to fix this issue? Not sure what the usual workflow for this would be. As a workaround I tried the export api, but there I couldn't find any option to only export the assets, so that I can import them on some other environment.