From 641ce801b49f01af090ba51f792edf24cc7d4d85 Mon Sep 17 00:00:00 2001 From: Katharina Przybill <30441792+kathap@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:41:29 +0200 Subject: [PATCH] Mysql throws error when app name contains emoji MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In postgres there is no issue when you name your app e.g. 🦄🦄🦄, but the tests for mysql fail with: Sequel::DatabaseError: Mysql2::error: Incorrect string value: '\xF0\x9F\xA6\x84\xF0\x9F...' for column 'name' at row 1 Suggestion: consistency -> app names should have the same options in mysql and postgres --- spec/request/space_manifests_spec.rb | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/spec/request/space_manifests_spec.rb b/spec/request/space_manifests_spec.rb index 61155572088..54d00303129 100644 --- a/spec/request/space_manifests_spec.rb +++ b/spec/request/space_manifests_spec.rb @@ -218,6 +218,36 @@ ) end + + context 'when the manifest contains valid binary-encoded URL(s) for the buildpack(s)' do + let(:app1_model) { VCAP::CloudController::AppModel.make(name: '🦄🦄🦄', space: space) } + let(:yml_manifest_with_binary_valid_buildpacks) do + "--- + applications: + - name: #{app1_model.name} + buildpacks: + - !!binary |- + aHR0cHM6Ly9naXRodWIuY29tL2Nsb3VkZm91bmRyeS9uZ2lueC1idWlsZHBhY2suZ2l0 + - !!binary |- + aHR0cHM6Ly9naXRodWIuY29tL2J1aWxkcGFja3MvbXktc3BlY2lhbC1idWlsZHBhY2s=" + end + + it 'applies the manifest' do + post "/v3/spaces/#{space.guid}/actions/apply_manifest", yml_manifest_with_binary_valid_buildpacks, yml_headers(user_header) + expect(last_response.status).to eq(202) + job_guid = VCAP::CloudController::PollableJobModel.last.guid + expect(last_response.headers['Location']).to match(%r{/v3/jobs/#{job_guid}}) + + Delayed::Worker.new.work_off + expect(VCAP::CloudController::PollableJobModel.find(guid: job_guid)).to be_complete, VCAP::CloudController::PollableJobModel.find(guid: job_guid).cf_api_error + + app1_model.reload + lifecycle_data = app1_model.lifecycle_data + expect(lifecycle_data.buildpacks.first).to include('https://github.com/cloudfoundry/nginx-buildpack.git') + expect(lifecycle_data.buildpacks.second).to include('https://github.com/buildpacks/my-special-buildpack') + end + end + context 'service bindings' do let(:client) { instance_double(VCAP::Services::ServiceBrokers::V2::Client, bind: {}) }