From e94640903fb8ca15bcdc0b6701e9b63fa9133a02 Mon Sep 17 00:00:00 2001 From: JakubWorek Date: Thu, 23 Jul 2026 10:25:45 +0000 Subject: [PATCH 1/3] test: build itk instruction proto straight from repository and remove local copy --- itk/pom.xml | 37 +++++++++++++++++ itk/run_itk.sh | 14 +++---- itk/src/main/proto/instruction.proto | 60 ---------------------------- 3 files changed, 44 insertions(+), 67 deletions(-) delete mode 100644 itk/src/main/proto/instruction.proto diff --git a/itk/pom.xml b/itk/pom.xml index b2d11e5d4..e5511efad 100644 --- a/itk/pom.xml +++ b/itk/pom.xml @@ -98,8 +98,45 @@ + + + ${project.basedir}/a2a-itk/protos + 4.1.2 + + + + + io.github.ascopes + protobuf-maven-plugin + ${protobuf-maven-plugin.version} + + ${protobuf-java.version} + + ${a2a.itk.proto.dir} + + + + + generate-sources + + generate + + + + io.quarkus quarkus-maven-plugin diff --git a/itk/run_itk.sh b/itk/run_itk.sh index 0ab793490..7e4104450 100755 --- a/itk/run_itk.sh +++ b/itk/run_itk.sh @@ -31,7 +31,10 @@ cleanup() { # Register cleanup function to run on script exit trap cleanup EXIT -# 1. Pull a2a-itk and checkout revision +# 1. Pull a2a-itk and checkout revision. +# The clone doubles as the single source of truth for instruction.proto: +# protobuf-maven-plugin in itk/pom.xml reads it directly from +# ${project.basedir}/a2a-itk/protos (see the `a2a.itk.proto.dir` property). : "${A2A_ITK_REVISION:?A2A_ITK_REVISION environment variable must be set}" if [ ! -d "a2a-itk" ]; then @@ -47,17 +50,14 @@ if git symbolic-ref -q HEAD > /dev/null; then fi cd .. -# 2. Copy latest instruction.proto from a2a-itk -cp a2a-itk/protos/instruction.proto src/main/proto/instruction.proto - -# 3. Build itk_service container image from root of a2a-itk +# 2. Build itk_service container image from root of a2a-itk CONTAINER_BUILD_ARGS="" if [ "$CONTAINER_RT" = "podman" ]; then CONTAINER_BUILD_ARGS="--format docker" fi $CONTAINER_RT build $CONTAINER_BUILD_ARGS -t itk_service a2a-itk -# 4. Start container service with a single mount: the a2a-java repo +# 3. Start container service with a single mount: the a2a-java repo A2A_JAVA_ROOT=$(cd .. && pwd) # Stop existing container if any @@ -80,7 +80,7 @@ $CONTAINER_RT run -d --name itk-service \ -p 8000:8000 \ itk_service -# 5. Verify service is up and send post request +# 4. Verify service is up and send post request MAX_RETRIES=30 echo "Waiting for ITK service to start on 127.0.0.1:8000..." set +e diff --git a/itk/src/main/proto/instruction.proto b/itk/src/main/proto/instruction.proto deleted file mode 100644 index c607567aa..000000000 --- a/itk/src/main/proto/instruction.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; - -package itk; - - -message Instruction { - // what should the "agent" do - oneof step { - CallAgent call_agent = 1; - ReturnResponse return_response = 2; - SeriesOfSteps steps = 3; - } -} - -// Behavior messages -message SendMessageBehavior {} -message PushNotificationBehavior { - string url = 1; -} -message ResubscribeBehavior {} - -// gets the agent card from a remote agent, calls it and returns the response -message CallAgent { - // which transport use to get agent card and later call - string transport = 1; - // where to get the agent card from - string agent_card_uri = 2; - // instruction for the called agent - Instruction instruction = 3; - // whether to use streaming - bool streaming = 4; - - // behavior mode - oneof behavior { - SendMessageBehavior send_message = 5; - PushNotificationBehavior push_notification = 6; - ResubscribeBehavior resubscribe = 7; - } -} - -// this option just returns a response -message ReturnResponse { - // what to return to the calling agent - string response = 1; - // whether to hold the task in WORKING state instead of completing it - bool hold_task = 2; -} - -// executes step series and returns response based on response_generator -message SeriesOfSteps { - repeated Instruction instructions = 1; - - enum ResponseGenerator { - // default - RESPONSE_GENERATOR_UNSPECIFIED = 0; - RESPONSE_GENERATOR_CONCAT = 1; - } - - ResponseGenerator response_generator = 2; -} From d90c35d4b2f51aa7ecd686dc9dba431c6e879ce8 Mon Sep 17 00:00:00 2001 From: JakubWorek Date: Fri, 24 Jul 2026 08:20:06 +0000 Subject: [PATCH 2/3] ci: gate itk module behind a Maven profile --- pom.xml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d0e6dbd38..2c1958176 100644 --- a/pom.xml +++ b/pom.xml @@ -599,8 +599,13 @@ transport/grpc transport/rest - - itk + compat-0.3 @@ -648,6 +653,19 @@ + + + itk + + itk + + ${project.basedir}/a2a-itk/protos - 4.1.2 @@ -118,10 +117,15 @@ by a2a-itk/agents/java/v10 so generated code (package `itk`, outer class `InstructionOuterClass`) stays byte-identical across the two paths during the strangler migration. + Version is pinned inline to match spec-grpc/pom.xml (same + plugin, same version) rather than reusing the parent's + protobuf-maven-plugin.version property, which resolves to + the org.xolstice plugin's version scheme (0.6.x) used by + compat-0.3/spec-grpc. --> io.github.ascopes protobuf-maven-plugin - ${protobuf-maven-plugin.version} + 4.1.2 ${protobuf-java.version}