{"action":"created","issue":{"url":"https://api.github.com/repos/deluan/contentful-migrate/issues/20","repository_url":"https://api.github.com/repos/deluan/contentful-migrate","labels_url":"https://api.github.com/repos/deluan/contentful-migrate/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/deluan/contentful-migrate/issues/20/comments","events_url":"https://api.github.com/repos/deluan/contentful-migrate/issues/20/events","html_url":"https://github.com/deluan/contentful-migrate/issues/20","id":352379188,"node_id":"MDU6SXNzdWUzNTIzNzkxODg=","number":20,"title":"Validation errors not returning exit code 1","user":{"login":"sheakelly","id":892544,"node_id":"MDQ6VXNlcjg5MjU0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/892544?v=4","gravatar_id":"","url":"https://api.github.com/users/sheakelly","html_url":"https://github.com/sheakelly","followers_url":"https://api.github.com/users/sheakelly/followers","following_url":"https://api.github.com/users/sheakelly/following{/other_user}","gists_url":"https://api.github.com/users/sheakelly/gists{/gist_id}","starred_url":"https://api.github.com/users/sheakelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheakelly/subscriptions","organizations_url":"https://api.github.com/users/sheakelly/orgs","repos_url":"https://api.github.com/users/sheakelly/repos","events_url":"https://api.github.com/users/sheakelly/events{/privacy}","received_events_url":"https://api.github.com/users/sheakelly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-21T04:12:04Z","updated_at":"2018-08-21T15:19:23Z","closed_at":null,"author_association":"NONE","body":"I am getting an error but the exit code is 0 which mean the build passes incorrectly. I was using an invalid character in the contentType name which I fixed it but I think when any error occurs it should fail the build i.e. exit 1\r\n\r\n``` \r\nMigration unsuccessful: \r\nBatch failed\r\n\r\nError: {\"status\":\"Unprocessable Entity\",\"message\":\"Validation error\",\"details\":{\"errors\":[{\"name\":\"regexp\",\"details\":\"Does not match /^[a-zA-Z][a-zA-Z0-9_]*$/\",\"value\":\"inline-link-group\",\"pattern\":\"^[a-zA-Z][a-zA-Z0-9_]*$\",\"path\":[\"fields\",3,\"id\"]}]},\"url\":\"https://api.contentful.com:443/spaces/qwerty/environments/dev/content_types/topic\"}\r\n\r\n\r\nError: {\"status\":\"Conflict\",\"message\":\"\",\"details\":{},\"url\":\"https://api.contentful.com:443/spaces/qwerty/environments/dev/content_types/topic/published\"}\r\n\r\n\r\nPlease check the errors log for more details: /app/errors-1534393589930.log\r\n  error : Error: Batch failed\r\n\r\n🚨  Error applying migrations in dev! See above for error message\r\n```"},"comment":{"url":"https://api.github.com/repos/deluan/contentful-migrate/issues/comments/414712682","html_url":"https://github.com/deluan/contentful-migrate/issues/20#issuecomment-414712682","issue_url":"https://api.github.com/repos/deluan/contentful-migrate/issues/20","id":414712682,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDcxMjY4Mg==","user":{"login":"deluan","id":331353,"node_id":"MDQ6VXNlcjMzMTM1Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/331353?v=4","gravatar_id":"","url":"https://api.github.com/users/deluan","html_url":"https://github.com/deluan","followers_url":"https://api.github.com/users/deluan/followers","following_url":"https://api.github.com/users/deluan/following{/other_user}","gists_url":"https://api.github.com/users/deluan/gists{/gist_id}","starred_url":"https://api.github.com/users/deluan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deluan/subscriptions","organizations_url":"https://api.github.com/users/deluan/orgs","repos_url":"https://api.github.com/users/deluan/repos","events_url":"https://api.github.com/users/deluan/events{/privacy}","received_events_url":"https://api.github.com/users/deluan/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T15:19:23Z","updated_at":"2018-08-21T15:19:23Z","author_association":"OWNER","body":"Hey, thanks for the report. I tested it here and I don't get this issue. How are you calling the `ctf-migrate` command? Here is what I get when running an invalid migration:\r\n```\r\n[ui (master)⚡] ➔ ctf-migrate -s qqxhciuzj3io -e master list -c headline\r\nListing headline\r\n  [2018-06-13 15:06:12] 20180613190106-create-headline.js : Create content model for Headline\r\n  [pending]             20180821151031-test-delete-invalid-field.js : Test issue 20\r\n[ui (master)⚡] ➔ echo $?\r\n0\r\n[ui (master)⚡] ➔ ctf-migrate -s qqxhciuzj3io -e master up -c headline\r\nProcessing headline\r\n  up : 20180821151031-test-delete-invalid-field.js\r\nValidation failed\r\n\r\n\r\nErrors in /Users/deluan/TW/ui/migrations/headline/20180821151031-test-delete-invalid-field.js\r\n\r\nLine 6: Field with id \"invalidField\" cannot be deleted because it does not exist.\r\n 4:   const flowConfiguration = migration.editContentType('headline');\r\n 5:\r\n 6:   flowConfiguration.deleteField('invalidField');\r\n 7: };\r\n 8:\r\n\r\n🚨  Migration unsuccessful\r\n[ui (master)⚡] ➔ echo $?\r\n1\r\n```"}}
{"actor":{"display_login":"deluan"}}