Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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;
}
Expand All @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the github: prefix? It seems redundant since we are already specifying the type at start. Also, since only a small width is typically allocated for artifacts, most of the text would overflow.

"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": {}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Loading