From 4a10bca9e1974c5320d5b136c191f08ddeef48ff Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Wed, 11 Feb 2026 09:52:52 +0530 Subject: [PATCH 1/2] Update Artifact entryPointMap keys --- .../java/io/ballerina/artifactsgenerator/Artifact.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/artifactsgenerator/Artifact.java b/architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/artifactsgenerator/Artifact.java index 29b4637be8..eebd44938c 100644 --- a/architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/artifactsgenerator/Artifact.java +++ b/architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/artifactsgenerator/Artifact.java @@ -90,8 +90,8 @@ public record Artifact(String id, LineRange location, String type, String name, Map.entry("rabbitmq", "RabbitMQ Event Integration"), Map.entry("kafka", "Kafka Event Integration"), Map.entry("salesforce", "Salesforce Event Integration"), - Map.entry("github", "GitHub Event Integration"), - Map.entry("twilio", "Twilio Event Integration"), + Map.entry("trigger.github", "GitHub Event Integration"), + Map.entry("trigger.twilio", "Twilio Event Integration"), Map.entry("ai", "AI Agent Services"), Map.entry("solace", "Solace Event Integration"), Map.entry("mssql", "CDC MSSQL Service") @@ -236,7 +236,7 @@ public Builder serviceName(String name) { if (module == null || !entryPointMap.containsKey(module)) { this.name = name; } else { - this.name = entryPointMap.get(module); + this.name = entryPointMap.get(module) + (isTriggerModule() ? " - " + name : ""); } return this; } @@ -254,6 +254,10 @@ public Builder addMetadata(String key, Object value) { return this; } + private boolean isTriggerModule() { + return module != null && module.startsWith("trigger"); + } + /** * Attempts to set the service name from annotations if applicable for the module. * From 717238e607dd9d4366f2390196f168ebc30a080d Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Wed, 11 Feb 2026 09:54:05 +0530 Subject: [PATCH 2/2] Add tests --- .../resources/artifacts/config/github.json | 178 ++++++++++++++++++ .../resources/artifacts/source/github.bal | 61 ++++++ 2 files changed, 239 insertions(+) create mode 100644 architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/config/github.json create mode 100644 architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/source/github.bal diff --git a/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/config/github.json b/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/config/github.json new file mode 100644 index 0000000000..ff8ac347ec --- /dev/null +++ b/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/config/github.json @@ -0,0 +1,178 @@ +{ + "description": "", + "source": "github.bal", + "packageName": ".", + "output": { + "Listeners": { + "githubListener": { + "id": "githubListener", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 2, + "offset": 0 + }, + "endLine": { + "line": 2, + "offset": 49 + } + }, + "type": "LISTENER", + "name": "githubListener", + "scope": "Global", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_trigger.github_0.10.0.png", + "module": "trigger.github", + "children": {} + } + }, + "Entry Points": { + "628752842": { + "id": "628752842", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 4, + "offset": 0 + }, + "endLine": { + "line": 60, + "offset": 1 + } + }, + "type": "SERVICE", + "name": "GitHub Event Integration - github:IssuesService", + "scope": "Global", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_trigger.github_0.10.0.png", + "module": "trigger.github", + "children": { + "onOpened": { + "id": "onOpened", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 5, + "offset": 4 + }, + "endLine": { + "line": 11, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onOpened", + "scope": "Global", + "children": {} + }, + "onClosed": { + "id": "onClosed", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 13, + "offset": 4 + }, + "endLine": { + "line": 19, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onClosed", + "scope": "Global", + "children": {} + }, + "onReopened": { + "id": "onReopened", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 21, + "offset": 4 + }, + "endLine": { + "line": 27, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onReopened", + "scope": "Global", + "children": {} + }, + "onAssigned": { + "id": "onAssigned", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 29, + "offset": 4 + }, + "endLine": { + "line": 35, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onAssigned", + "scope": "Global", + "children": {} + }, + "onLabeled": { + "id": "onLabeled", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 45, + "offset": 4 + }, + "endLine": { + "line": 51, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onLabeled", + "scope": "Global", + "children": {} + }, + "onUnlabeled": { + "id": "onUnlabeled", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 53, + "offset": 4 + }, + "endLine": { + "line": 59, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onUnlabeled", + "scope": "Global", + "children": {} + }, + "onUnassigned": { + "id": "onUnassigned", + "location": { + "fileName": "github.bal", + "startLine": { + "line": 37, + "offset": 4 + }, + "endLine": { + "line": 43, + "offset": 5 + } + }, + "type": "REMOTE", + "name": "onUnassigned", + "scope": "Global", + "children": {} + } + } + } + } + } +} diff --git a/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/source/github.bal b/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/source/github.bal new file mode 100644 index 0000000000..1fad2b36da --- /dev/null +++ b/architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/artifacts/source/github.bal @@ -0,0 +1,61 @@ +import ballerinax/trigger.github; + +listener github:Listener githubListener = new (); + +service github:IssuesService on githubListener { + remote function onOpened(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onClosed(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onReopened(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onAssigned(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onUnassigned(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onLabeled(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } + + remote function onUnlabeled(github:IssuesEvent payload) returns error|() { + do { + } on fail error err { + // handle error + return error("unhandled error", err); + } + } +}