GitHub
12/11/2024, 2:16 PMx):\n\n• Upgraded to the latest version of the relevant libraries\n• Checked to see if the issue has already been raised\n• Created an executable example that demonstrates the issue using either: \n • a Dockerfile \n • a fork of https://github.com/pact-foundation/pact-ruby-standalone-e2e-example \n • a Git repository with a Travis or Appveyor (or similar) build \n • a gist with all the relevant code and full instructions on how to run it\n\n*Software versions*\n\n• pact library: pact-cli:1.4.0.3 docker image\n• pact-ruby-standalone: ?\n• OS: Container\n\n*Expected behaviour*\n\nThe CLI is able to handle unicode escape sequences introduced by Pact JVM into example values.\n\n*Actual behaviour*\n\nPact CLI throws error message for some escaped unicode characters.\n\nFor \"\\uDAA5\" pact cli may throws\n\n```\n/usr/lib/ruby/gems/3.3.0/gems/json-2.9.0/lib/json/common.rb221in `parse': incomplete surrogate pair at '\\uDAA5\", (JSON::ParserError)\n \"created\": \"2'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/json-2.9.0/lib/json/common.rb221in `parse'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/pact_file.rb28in `pact_hash'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/pact_file.rb20in `consumer_name'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/file_list.rb70in `collect'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/file_list.rb70in `collect'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb:1[46](https://git.tech.rz.db.de/ifp/app/arbeitssteuerung/-/jobs/285704110#L46):in `consumer_names'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb61in `publish_pacts'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb34in `call'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb16in `call'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/pact_commands.rb74in `publish_pacts'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/pact_commands.rb33in `publish'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb28in `run'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb127in `invoke_command'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor.rb:[53](https://git.tech.rz.db.de/ifp/app/arbeitssteuerung/-/jobs/285704110#L53)8:in `dispatch'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/base.rb584in `start'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/custom_thor.rb34in `start'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/bin/pact-broker10in `<top (required)>'\n\tfrom /usr/bin/pact-broker25in `load'\n\tfrom /usr/bin/pact-broker25in `<main>'\n\n```\n\nFor others it throws the following, but I'm not sure which escape sequences are responsible for that yet (the ones mentioned in the log aren't exactly in the contract file).\n\n```\n/usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb127in `to_json': source sequence is illegal/malformed utf-8 (JSON::GeneratorError)\nInvalid object: \"\\xED\\xB2\\x94\"\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb127in `block in contracts_for'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb119in `collect'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb119in `contracts_for'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb:[56](https://git.tech.rz.db.de/ifp/app/arbeitssteuerung/-/jobs/285563406#L56):in `request_body_for'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb62in `block in publish_pacts'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/file_list.rb70in `collect'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/file_list.rb70in `collect'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb61in `publish_pacts'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb34in `call'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/publish_pacts.rb16in `call'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/pact_commands.rb74in `publish_pacts'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/pact_commands.rb33in `publish'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb28in `run'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb127in `invoke_command'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor.rb538in `dispatch'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/base.rb:[58](https://git.tech.rz.db.de/ifp/app/arbeitssteuerung/-/jobs/285563406#L58)4:in `start'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/lib/pact_broker/client/cli/custom_thor.rb34in `start'\n\tfrom /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.77.0/bin/pact-broker10in `<top (required)>'\n\tfrom /usr/bin/pact-broker25in `load'\n\tfrom /usr/bin/pact-broker25in `<main>'\n\n```\n\n*Steps to reproduce*\n\nInsert \"\\uDAA5\" into an example value in the contract and try to upload it using the pact CLI. Can provide a reproduction repo if required, \"pact-ruby-standalone-e2e-example\" doesn't seem to work well on windows.\n\n*Relevent log files*\n\nsee above\n\nEdit: fixed wrong usage of keyword 'surrogate' in description
pact-foundation/pact-ruby-standaloneGitHub
01/06/2025, 10:54 AM