Gracefully handle non indexed services and support deleting service functions#423
Merged
NipunaRanasinghe merged 15 commits intoballerina-platform:1.3.xfrom Oct 24, 2025
Conversation
b2607a9 to
67fcc12
Compare
edb64af to
19f4ccd
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds graceful handling for non-indexed service types and introduces support for deleting optional service functions. The changes enable users to work with services that haven't been indexed yet, providing access to service designer views and configuration forms. Additionally, service type functions can now be marked as optional and deleted when appropriate.
Key changes:
- Added
optionalfield to service type functions to distinguish between required and optional functions - Implemented fallback service model creation when service types are not found in the database
- Updated database schema and queries to support the optional function field
Reviewed Changes
Copilot reviewed 136 out of 137 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| service_artifacts.json | Added optional field to service type function definitions |
| service-index.sql | Added optional column to ServiceTypeFunction table schema |
| ServiceIndexGenerator.java | Updated function creation to include optional parameter |
| DatabaseManager.java | Modified SQL queries to handle optional field in database operations |
| ServiceModelUtils.java | Added fallback service model creation and refactored function generation logic |
| ListenerUtil.java | Refactored listener model creation and improved method organization |
| ServiceMetadata.java | Changed to use ModuleID instead of separate org/package/module fields |
| Utils.java | Fixed annotation value handling to return null for empty annotations |
| Multiple test config files | Updated version references for http/jsondata packages and test expectations |
Comments suppressed due to low confidence (4)
service-model-generator/modules/service-model-index-generator/src/main/resources/service-index.sql:1
- The CHECK constraint references the wrong column name. It should check
optional IN (0, 1)instead ofenable IN (0, 1).
service-model-generator/modules/service-model-generator-ls-extension/src/main/java/io/ballerina/servicemodelgenerator/extension/util/Utils.java:1 - Duplicate conditional check for
annotationNode.annotValue().isEmpty(). The second check at line 659 is unreachable because if the condition is true, the method already returns at line 656.
model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/FunctionDataBuilder.java:1 - Catching
Throwableis too broad and may catch errors that shouldn't be suppressed (likeOutOfMemoryErrororStackOverflowError). Consider catchingExceptioninstead, or a more specific exception type likeIOExceptionorJsonSyntaxException.
model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/FunctionDataBuilder.java:1 - Catching
Throwableis too broad and may catch errors that shouldn't be suppressed (likeOutOfMemoryErrororStackOverflowError). Consider catchingExceptioninstead, or a more specific exception type.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
$subject
This PR enables graceful handling of non-indexed service types, improving the user experience when working with services that haven't been indexed yet.
Screen.Recording.2025-10-24.at.14.52.47.mov
Additional Enhancements