From 7935f8209b2d1386329510d39869031aa924ddae Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 00:55:52 +0000 Subject: [PATCH 1/6] fork: you54f libpact_ffi-v0.4.16 --- FFI_VERSION | 2 +- deno/downloadFfi.ts | 4 ++-- python/ctypes/download-ffi-only-os-dependant.sh | 2 +- script/lib/download-ffi-only-os-dependant.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FFI_VERSION b/FFI_VERSION index c8a5397..5a81b9b 100644 --- a/FFI_VERSION +++ b/FFI_VERSION @@ -1 +1 @@ -0.4.5 \ No newline at end of file +0.4.16 \ No newline at end of file diff --git a/deno/downloadFfi.ts b/deno/downloadFfi.ts index 74fcba9..1843fcc 100644 --- a/deno/downloadFfi.ts +++ b/deno/downloadFfi.ts @@ -50,8 +50,8 @@ export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.5") => { `We do not have a binary for your platform ${platform}`; break; } - const ffiLibDownloadLocation = `https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-${ffiVersion}/${filename}`; - const ffiHeaderDownloadLocation = `https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-${ffiVersion}/pact.h`; + const ffiLibDownloadLocation = `https://github.com/you54f/pact-reference/releases/download/libpact_ffi-${ffiVersion}/${filename}`; + const ffiHeaderDownloadLocation = `https://github.com/you54f/pact-reference/releases/download/libpact_ffi-${ffiVersion}/pact.h`; console.log(ffiLibDownloadLocation); return { ffiLibDownloadLocation, ffiHeaderDownloadLocation }; }; diff --git a/python/ctypes/download-ffi-only-os-dependant.sh b/python/ctypes/download-ffi-only-os-dependant.sh index a32c514..14da163 100644 --- a/python/ctypes/download-ffi-only-os-dependant.sh +++ b/python/ctypes/download-ffi-only-os-dependant.sh @@ -8,7 +8,7 @@ require_binary gunzip require_env_var FFI_VERSION -BASEURL=https://github.com/pact-foundation/pact-reference/releases/download +BASEURL=https://github.com/you54f/pact-reference/releases/download FFI_DIR="${LIB_DIR}/../.." function download_ffi_file { diff --git a/script/lib/download-ffi-only-os-dependant.sh b/script/lib/download-ffi-only-os-dependant.sh index 021004c..2399df0 100755 --- a/script/lib/download-ffi-only-os-dependant.sh +++ b/script/lib/download-ffi-only-os-dependant.sh @@ -8,7 +8,7 @@ require_binary gunzip require_env_var FFI_VERSION -BASEURL=https://github.com/pact-foundation/pact-reference/releases/download +BASEURL=https://github.com/you54f/pact-reference/releases/download FFI_DIR="${LIB_DIR}/../.." function download_ffi_file { From 5c90ab84428e6fc4e84ac56fdc8dacef2b0e1296 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 00:56:48 +0000 Subject: [PATCH 2/6] fork: you54f libpact_ffi-v0.4.17 --- FFI_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFI_VERSION b/FFI_VERSION index 5a81b9b..e958495 100644 --- a/FFI_VERSION +++ b/FFI_VERSION @@ -1 +1 @@ -0.4.16 \ No newline at end of file +0.4.17 \ No newline at end of file From 77096607066227e46062cbb282b139159e1d6daa Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 00:59:29 +0000 Subject: [PATCH 3/6] fork: you54f libpact_ffi-v0.4.17 --- .github/workflows/update_ffi.yml | 2 +- deno/downloadFfi.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_ffi.yml b/.github/workflows/update_ffi.yml index d0dd9ec..ea90c72 100644 --- a/.github/workflows/update_ffi.yml +++ b/.github/workflows/update_ffi.yml @@ -9,7 +9,7 @@ on: PACT_FFI_VERSION: description: Tag from https://github.com/you54f/pact-reference/releases for libpact_ffi required: true - default: 0.4.5 + default: 0.4.17 type: string jobs: diff --git a/deno/downloadFfi.ts b/deno/downloadFfi.ts index 1843fcc..5d4443d 100644 --- a/deno/downloadFfi.ts +++ b/deno/downloadFfi.ts @@ -25,7 +25,7 @@ async function downloadFile(src: string, dest: string) { await resp.body.pipeTo(file.writable); } -export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.5") => { +export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.17") => { const platform = Deno.build.os + "-" + Deno.build.arch; console.log(platform); let filename; @@ -56,7 +56,7 @@ export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.5") => { return { ffiLibDownloadLocation, ffiHeaderDownloadLocation }; }; -export const downloadFfiForPlatform = async (ffiVersion = "v0.4.5") => { +export const downloadFfiForPlatform = async (ffiVersion = "v0.4.17") => { const locs = detectFfiDownloadForPlatform(ffiVersion); const libraryFilename = Deno.build.os === "darwin" From a8f8a7be345cd6eb40c0491e03019e7e156359b8 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 01:02:25 +0000 Subject: [PATCH 4/6] fork: you54f libpact_ffi-v0.4.18 --- .github/workflows/update_ffi.yml | 2 +- FFI_VERSION | 2 +- deno/downloadFfi.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_ffi.yml b/.github/workflows/update_ffi.yml index ea90c72..4f689bb 100644 --- a/.github/workflows/update_ffi.yml +++ b/.github/workflows/update_ffi.yml @@ -9,7 +9,7 @@ on: PACT_FFI_VERSION: description: Tag from https://github.com/you54f/pact-reference/releases for libpact_ffi required: true - default: 0.4.17 + default: 0.4.18 type: string jobs: diff --git a/FFI_VERSION b/FFI_VERSION index e958495..c742be6 100644 --- a/FFI_VERSION +++ b/FFI_VERSION @@ -1 +1 @@ -0.4.17 \ No newline at end of file +0.4.18 \ No newline at end of file diff --git a/deno/downloadFfi.ts b/deno/downloadFfi.ts index 5d4443d..c9a0d22 100644 --- a/deno/downloadFfi.ts +++ b/deno/downloadFfi.ts @@ -25,7 +25,7 @@ async function downloadFile(src: string, dest: string) { await resp.body.pipeTo(file.writable); } -export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.17") => { +export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.18") => { const platform = Deno.build.os + "-" + Deno.build.arch; console.log(platform); let filename; @@ -56,7 +56,7 @@ export const detectFfiDownloadForPlatform = (ffiVersion = "v0.4.17") => { return { ffiLibDownloadLocation, ffiHeaderDownloadLocation }; }; -export const downloadFfiForPlatform = async (ffiVersion = "v0.4.17") => { +export const downloadFfiForPlatform = async (ffiVersion = "v0.4.18") => { const locs = detectFfiDownloadForPlatform(ffiVersion); const libraryFilename = Deno.build.os === "darwin" From 20baf70c4c97a5cdf3bc5f87ffd5ebbc6e2738c9 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 01:06:29 +0000 Subject: [PATCH 5/6] fork: you54f pact-protobuf-plugin / pact-plugin-cli --- Makefile | 2 +- bun/index.ts | 2 +- lua/hello_grpc.lua | 2 +- pacts/consumer-test-provider-test.json | 2 +- perl/hello_grpc.pl | 2 +- php/hello_grpc.php | 4 ++-- python/cffi/hello_grpc.py | 2 +- python/ctypes/download-plugin-cli.sh | 2 +- script/lib/download-plugin-cli.sh | 2 +- script/lib/export-binary-versions.sh | 2 +- swift/hello_grpc.swift | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 706a899..9cce0bb 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ get_plugin_cli: ./script/download-plugin-cli.sh install_protobuf_plugin: - ${HOME}/.pact/cli/plugin/pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/latest + ${HOME}/.pact/cli/plugin/pact-plugin-cli -y install https://github.com/you54f/pact-protobuf-plugin/releases/latest haskell_hello_ffi: ghc haskell/hello_ffi.hs ${pactffi_filename} -o haskell/hello_ffi_haskell diff --git a/bun/index.ts b/bun/index.ts index e71bfdf..1a304b5 100644 --- a/bun/index.ts +++ b/bun/index.ts @@ -207,7 +207,7 @@ const PactTestGrpc = async() => { console.log('pactffi_with_specification_res') console.log(pactffi_with_specification_res) // Start mock server - const pactffi_using_plugin_res = pactffi_using_plugin(pact, s2b("protobuf"), s2b("0.1.17")); + const pactffi_using_plugin_res = pactffi_using_plugin(pact, s2b("protobuf"), s2b("0.3.14")); console.log('pactffi_using_plugin_res') console.log(pactffi_using_plugin_res) const pactffi_interaction_contents_res = pactffi_interaction_contents(message_pact, s2b('InteractionPart_Request'), s2b("application/grpc"), s2b(JSON.stringify(contents))); diff --git a/lua/hello_grpc.lua b/lua/hello_grpc.lua index 2aabbe9..2b6180c 100644 --- a/lua/hello_grpc.lua +++ b/lua/hello_grpc.lua @@ -40,7 +40,7 @@ lib.pactffi_with_specification(pact, 5) -- Start mock server -lib.pactffi_using_plugin(pact, 'protobuf', '0.1.17') +lib.pactffi_using_plugin(pact, 'protobuf', '0.3.14') lib.pactffi_interaction_contents(message_pact, 0, 'application/grpc',contents) mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , '0.0.0.0',0,'grpc',ffi.cast("void *", 0)) lib.pactffi_log_message(appName, 'INFO', "Mock server started: "..mock_server_port) diff --git a/pacts/consumer-test-provider-test.json b/pacts/consumer-test-provider-test.json index d0d45f5..47c0b5a 100644 --- a/pacts/consumer-test-provider-test.json +++ b/pacts/consumer-test-provider-test.json @@ -172,7 +172,7 @@ } }, "name": "protobuf", - "version": "0.1.17" + "version": "0.3.14" }, { "configuration": {}, diff --git a/perl/hello_grpc.pl b/perl/hello_grpc.pl index 525f12e..41a97b6 100644 --- a/perl/hello_grpc.pl +++ b/perl/hello_grpc.pl @@ -49,7 +49,7 @@ # Start mock server pactffi_log_message('pact-perl-ffi', 'INFO', "using plugin"); $ffi->attach('pactffi_using_plugin', ['pact','string','string'] => 'int'); -pactffi_using_plugin($pact, 'protobuf', '0.1.17'); +pactffi_using_plugin($pact, 'protobuf', '0.3.14'); pactffi_log_message('pact-perl-ffi', 'INFO', "got plugin"); pactffi_log_message('pact-perl-ffi', 'INFO', "setting interaction contents"); $ffi->attach('pactffi_interaction_contents', ['message_pact','int','string','string'] => 'int'); diff --git a/php/hello_grpc.php b/php/hello_grpc.php index 3522f1a..f4f69c0 100644 --- a/php/hello_grpc.php +++ b/php/hello_grpc.php @@ -42,7 +42,7 @@ // Start mock server -$ffi->pactffi_using_plugin($pact, 'protobuf', '0.1.17'); +$ffi->pactffi_using_plugin($pact, 'protobuf', '0.3.14'); $ffi->pactffi_interaction_contents($message_pact, 0, 'application/grpc', $contents); $port = $ffi->pactffi_create_mock_server_for_transport($pact , '0.0.0.0',0,'grpc', null); @@ -50,7 +50,7 @@ // This is where we would call our client, gRPC in this example plugin demo // PHP gRPC is client only, so would need to use a provider from the following -// https://github.com/pact-foundation/pact-plugins/tree/main/examples/gRPC/area_calculator +// https://github.com/you54f/pact-plugins/tree/main/examples/gRPC/area_calculator // TODO build out an area calculator PHP example // https://grpc.io/docs/languages/php/ diff --git a/python/cffi/hello_grpc.py b/python/cffi/hello_grpc.py index 517d92e..fe085e9 100644 --- a/python/cffi/hello_grpc.py +++ b/python/cffi/hello_grpc.py @@ -47,7 +47,7 @@ # Start mock server -lib.pactffi_using_plugin(pact, b'protobuf', b'0.1.17') +lib.pactffi_using_plugin(pact, b'protobuf', b'0.3.14') lib.pactffi_interaction_contents(message_pact, 0, b'application/grpc', ffi.new("char[]", json.dumps(contents).encode('ascii'))) mock_server_port = lib.pactffi_create_mock_server_for_transport(pact , b'0.0.0.0',0,b'grpc',ffi.cast("void *", 0)) print(f"Mock server started: {mock_server_port}") diff --git a/python/ctypes/download-plugin-cli.sh b/python/ctypes/download-plugin-cli.sh index b86685e..b942744 100644 --- a/python/ctypes/download-plugin-cli.sh +++ b/python/ctypes/download-plugin-cli.sh @@ -8,7 +8,7 @@ require_binary gunzip require_env_var PLUGIN_CLI_VERSION -BASEURL=https://github.com/pact-foundation/pact-plugins/releases/download +BASEURL=https://github.com/you54f/pact-plugins/releases/download PLUGIN_CLI_DIR="${HOME}/.pact/cli/plugin" if [[ $(find "${PLUGIN_CLI_DIR}" -name "${PLUGIN_CLI_VERSION}*") ]]; then diff --git a/script/lib/download-plugin-cli.sh b/script/lib/download-plugin-cli.sh index 13a9023..0d4d78c 100755 --- a/script/lib/download-plugin-cli.sh +++ b/script/lib/download-plugin-cli.sh @@ -8,7 +8,7 @@ require_binary gunzip require_env_var PLUGIN_CLI_VERSION -BASEURL=https://github.com/pact-foundation/pact-plugins/releases/download +BASEURL=https://github.com/you54f/pact-plugins/releases/download PLUGIN_CLI_DIR="${HOME}/.pact/cli/plugin" if [[ $(find "${PLUGIN_CLI_DIR}" -name "${PLUGIN_CLI_VERSION}*") ]]; then diff --git a/script/lib/export-binary-versions.sh b/script/lib/export-binary-versions.sh index ae16dba..ea01763 100644 --- a/script/lib/export-binary-versions.sh +++ b/script/lib/export-binary-versions.sh @@ -2,4 +2,4 @@ LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the script is running PROJECT_DIR="${LIB_DIR}"/../../ export FFI_VERSION=v$(cat $PROJECT_DIR/FFI_VERSION) -export PLUGIN_CLI_VERSION=v0.0.1 \ No newline at end of file +export PLUGIN_CLI_VERSION=v0.1.2 \ No newline at end of file diff --git a/swift/hello_grpc.swift b/swift/hello_grpc.swift index 85fc44e..bdeb285 100755 --- a/swift/hello_grpc.swift +++ b/swift/hello_grpc.swift @@ -92,7 +92,7 @@ pactffi_with_specification(pact!!, PactSpecification_V4) // Start mock server pactffi_log_message(app_name, "INFO", "using plugin") -pactffi_using_plugin(pact!!, "protobuf", "0.1.17") +pactffi_using_plugin(pact!!, "protobuf", "0.3.14") pactffi_log_message(app_name, "INFO", "got plugin, setting interaction contents: \(contents!)") pactffi_interaction_contents(message_pact!!, InteractionPart_Request, "application/grpc", contents!) pactffi_log_message(app_name, "INFO", "set interaction contents") From 477f46704ba8bdec92846391df05bc9b1258ee20 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 27 Feb 2024 01:09:35 +0000 Subject: [PATCH 6/6] fork: you54f pact-plugin-driver - auto installing plugins --- .github/workflows/action.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index e4b669e..e960312 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -110,7 +110,7 @@ jobs: rm -rf /usr/bin/perl.exe - run: cpanm FFI::Platypus - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: ls - run: make perl haskell: @@ -162,7 +162,7 @@ jobs: with: python-version: "3.10" - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: ls - run: make python_install_deps - run: make python @@ -195,7 +195,7 @@ jobs: php-version: 8.1 extensions: ffi - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: ls - run: make php deno: @@ -225,7 +225,7 @@ jobs: - uses: denoland/setup-deno@v1 with: deno-version: v1.x - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: make deno bun: timeout-minutes: 10 @@ -251,7 +251,7 @@ jobs: echo "BUN_INSTALL=$HOME/.bun" >> $GITHUB_ENV echo "$HOME/.bun/bin" >> $GITHUB_PATH - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: make bun zig: timeout-minutes: 10 @@ -338,7 +338,7 @@ jobs: branch: swift-5.7.1-release tag: 5.7.1-RELEASE - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: make swift lua: timeout-minutes: 10 @@ -402,7 +402,7 @@ jobs: with: args: install protoc - run: make get_pact_ffi - - run: make get_pact_plugins + # - run: make get_pact_plugins - run: make lua # scala: # timeout-minutes: 10