Open teu opened 8 years ago
Actually wait. It's blowing up in the controller, which mean it was inserted fine in the DB but now it can't encode it in JSON.
What database are you using?
RDS mysql 5.6 character set utf8 collate utf8_general_ci
Ok, by googling a but I found people with similar issues: https://github.com/JoshCheek/seeing_is_believing/issues/46#issuecomment-69007428
I think that might be an actual bug that we are not experiencing because we have LANG=en_US.UTF-8
. I'll try to reproduce this.
Will try to set locale tomorrow. Midnight here.
Set the locale system wide and restarted apache (passenger). No change.
yeah sorry, I was about to update to say I can reproduce without changing LANG.
Reproducing is basically as simple as:
>> JSON.dump(Shipit::Command.new("echo test √ test", chdir: '.').run)
Encoding::UndefinedConversionError: "\xE2" from ASCII-8BIT to UTF-8
What I don't understand though it that we do handle this already here: https://github.com/Shopify/shipit-engine/blob/fd3ce935a20163cf7dd39b3dfa5d0731a848e632/app/models/shipit/output_chunk.rb#L8
>> JSON.dump(Shipit::Command.new("echo test √ test", chdir: '.').run.force_encoding(Encoding::UTF_8).scrub)
=> "\"test √ test\\r\\n\""
So there is something fishy here :/
Ok, so one possibility would be the usual utf8 vs utf8mb4
MySQL shenanigans.
If you have say, and emoji in your output, it's very possible it got truncated by MySQL.
Perhaps I should create a database with a different encoding then?
Well, I haven't tested yet to confirm it's indeed this. But it's recommended to use utf8mb4
with Shipit. People have a tendency to put emojis in commit messages or build outputs.
Hi,
out deployment cycle relies fully on capistrano, I basically only need shipit to fetch the specific repository. Is there a way to override all shipit events and just run one shell command?
Thanks