Skip to content

Comments

Draw the connection usages for service classes #683

Merged
NipunaRanasinghe merged 4 commits intoballerina-platform:1.6.xfrom
LakshanWeerasinghe:fix#2396
Feb 9, 2026
Merged

Draw the connection usages for service classes #683
NipunaRanasinghe merged 4 commits intoballerina-platform:1.6.xfrom
LakshanWeerasinghe:fix#2396

Conversation

@LakshanWeerasinghe
Copy link
Contributor

@LakshanWeerasinghe LakshanWeerasinghe commented Feb 9, 2026

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the architecture model generator to attribute connection usage that occurs inside service classes back to the services/resources that instantiate/use those service classes (fixing wso2/product-ballerina-integrator#2396).

Changes:

  • Track service-class definitions and collect their function models during syntax-tree analysis.
  • Track instantiated/used classes from new expressions and incorporate service-class function dependencies when building the connection graph.
  • Add a new test project + expected design-model output to validate connection propagation through a service class.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/designmodelgenerator/core/IntermediateModel.java Extends the intermediate representation to include service-class models and class-usage tracking.
architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/designmodelgenerator/core/CodeAnalyzer.java Detects service class definitions, associates functions with service classes, and records classes instantiated via new.
architecture-model-generator/modules/architecture-model-generator-core/src/main/java/io/ballerina/designmodelgenerator/core/DesignModelGenerator.java Incorporates service-class function dependencies while computing transitive connection usage.
architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/get_design_model/source/project_9/main.bal Adds a sample WebSocket service that returns a service-class instance which uses an HTTP client.
architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/get_design_model/source/project_9/Ballerina.toml Adds package metadata for the new test project.
architecture-model-generator/modules/architecture-model-generator-ls-extension/src/test/resources/get_design_model/config/connections_for_service_classes.json Adds the expected design-model output for the new service-class connection propagation scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

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

LGTM

@NipunaRanasinghe NipunaRanasinghe merged commit 4c47bd3 into ballerina-platform:1.6.x Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants