Skip to content
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

Merging assets #891

Open
toby-palau opened this issue Apr 30, 2024 · 3 comments
Open

Merging assets #891

toby-palau opened this issue Apr 30, 2024 · 3 comments

Comments

@toby-palau
Copy link

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:

  • Our dev team uses an environment called development for testing out new content models, entries etc.
  • When a new content model configuration is tested and ready for deployment, we deploy the development models with the other environments using the contentful Merge app (in the Contentful UI)
  • Our content creation team uses an environment called preview to preview what their content looks like in a preview app
  • When a piece of content is ready to be published, we use the contentful-merge CLI tool to migrate the content from preview to production environment
  • Our environment called production is set up as alias of master and serves our application

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
Copy link

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
Copy link

bvasen commented Jul 15, 2024

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.

@jimmythigpen
Copy link

We are also running into this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants