From 01bd272192c2c896d798737712158193efc057e3 Mon Sep 17 00:00:00 2001 From: "vaszakharchenko@gmail.com" Date: Thu, 4 Jun 2026 10:12:58 +0300 Subject: [PATCH] update Forge container and sample code - Set explicit environment variables (APP_ID, ENV_NAME, ENV_ID) in `dev-loop.sh`. - Simplify `manifest.yml` by removing unused `connect` block and updating routes. - Adjust `/health` endpoint path in `ContainerHealthEndpoint`. - Refactor `BusinessLogicController` for improved exception handling and logic flow. --- .../connect/spring/atlaskit/BusinessLogicController.java | 8 ++++---- .../forge-container/manifest.yml | 5 +---- .../connect/spring/atlaskit/ContainerHealthEndpoint.java | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java b/examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java index 1a79ef8..415f83f 100644 --- a/examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java +++ b/examples/atlassian-connect-forge-spring-boot-sample/core/src/main/java/sample/connect/spring/atlaskit/BusinessLogicController.java @@ -88,14 +88,14 @@ public Map impersonation( AtlassianHost host = hostFromQuery(installationId, cloudId); try { manualAuthorizationService.authorize(host); + AtlassianHostUser hostUser = AtlassianHostUser.builder(host).withUserAccountId(accountId).build(); + JiraMyselfResponse myself = fetchJiraMyself(hostUser); + String label = myself != null ? myself.displayName() : accountId; + return message("Hello from BusinessLogicController. User: " + label); } catch (Exception e) { LOG.warn("Impersonation failed", e); return message("Impersonation failed: " + e.getMessage()); } - AtlassianHostUser hostUser = AtlassianHostUser.builder(host).withUserAccountId(accountId).build(); - JiraMyselfResponse myself = fetchJiraMyself(hostUser); - String label = myself != null ? myself.displayName() : accountId; - return message("Hello from BusinessLogicController. User: " + label); } private JiraMyselfResponse fetchJiraMyself(AtlassianHostUser user) { diff --git a/examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml b/examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml index c2b084e..2f4d921 100644 --- a/examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml +++ b/examples/atlassian-connect-forge-spring-boot-sample/forge-container/manifest.yml @@ -23,9 +23,6 @@ services: app: id: ari:cloud:ecosystem::app/cbad754b-3ea4-4759-a6ef-eb575b1a7427 - connect: - key: runtime-bridge-spring-boot-sample-atlaskit - remote: java-service runtime: name: nodejs24.x @@ -48,7 +45,7 @@ modules: - key: impersonation-ep service: java-service route: - path: /api/impersonation + path: /api resources: - key: main diff --git a/examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java b/examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java index b840caf..8609503 100644 --- a/examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java +++ b/examples/atlassian-connect-forge-spring-boot-sample/forge-container/src/main/java/sample/connect/spring/atlaskit/ContainerHealthEndpoint.java @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("/ping") +@RequestMapping("/health") public class ContainerHealthEndpoint { @GetMapping