Skip to content

Comments

Add file integration improvements#692

Merged
niveathika merged 8 commits intoballerina-platform:1.6.xfrom
niveathika:1.6.x
Feb 18, 2026
Merged

Add file integration improvements#692
niveathika merged 8 commits intoballerina-platform:1.6.xfrom
niveathika:1.6.x

Conversation

@niveathika
Copy link
Contributor

@niveathika niveathika commented Feb 12, 2026

Summary

This draft PR adds and stabilizes FTP service-model support in the language server for file integration flows.

Included changes

  • Updated FTP service metadata/version entries.
  • Added support for multiple FTP services attached to a single listener.
  • Added onError handler model support.
  • Added post-processing action support for success/error paths and aligned builder logic with the updated ftp_service.json structure.
  • Added filtering for deprecated listener init/config parameters (derived from compiler annotations) so deprecated config members are not exposed in listener configuration models.
  • Hardened listener model resolution/index lookup flow and included follow-up checkstyle fixes.

Notes

  • This branch was rebased/squashed by functionality and force-pushed to keep the draft PR history aligned.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 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

This pull request enhances FTP file integration by moving the monitoring path from listener configuration to a service-level annotation pattern, adding post-processing actions for file handlers, and updating to FTP module version 2.17.0.

Changes:

  • Moved path configuration from listener parameters to @ftp:ServiceConfig service annotation
  • Added post-processing actions (postProcessActionOnSuccess and postProcessActionOnError) for FTP file handlers with support for MOVE, DELETE, and NONE actions
  • Updated FTP module version from 2.15.1/2.16.0 to 2.17.0 and corresponding package icons
  • Added FTPFunctionBuilder to handle function-level annotation transformations
  • Enhanced listener reuse logic to filter out legacy FTP listeners that don't use the new annotation pattern

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ftp_service.json Added annotServiceConfig property and post-processing actions to all file handlers; updated version to 2.17.0
ftp_init.json Moved path property from listener config to service-level with SERVICE_ANNOTATION codedata type; removed from protocol choices; updated version to 2.17.0
FTPServiceBuilder.java Implemented listener reuse with legacy filtering, service path annotation generation, and post-processing action parsing from function annotations
FTPFunctionBuilder.java New builder to transform post-processing choice properties into @ftp:FunctionConfig annotations
Utils.java Added SERVICE_ANNOTATION handling to group annotation fields together
CommonUtils.java Enhanced annotation field extraction to handle non-literal expressions
Artifact.java Added FTP path field to moduleAnnotationFields for architecture model generation
Test resources Updated test files with new annotation pattern and line number adjustments
FunctionBuilderRouter.java Registered FTPFunctionBuilder for FTP protocol

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

@niveathika niveathika requested a review from Copilot February 17, 2026 19:49
@niveathika niveathika marked this pull request as ready for review February 17, 2026 19:49
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 19 out of 19 changed files in this pull request and generated 2 comments.


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

Comment on lines +759 to +760
// Check for @ftp:ServiceConfig annotation (allow alias prefixes)
if (annotationText.endsWith("ServiceConfig")) {
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

hasServiceConfigAnnotation is intended to verify the presence of @ftp:ServiceConfig, but it currently accepts any annotation whose reference ends with ServiceConfig (e.g., @http:ServiceConfig, @graphql:ServiceConfig). This can incorrectly classify a listener as “non-legacy” and allow reusing it even when the FTP service is missing the required FTP annotation. Tighten the check to ensure the annotation resolves to the ballerina/ftp module (e.g., via SemanticModel symbol resolution for the annotation reference, or by matching the qualifier/alias that corresponds to the imported ftp module).

Suggested change
// Check for @ftp:ServiceConfig annotation (allow alias prefixes)
if (annotationText.endsWith("ServiceConfig")) {
// Check specifically for @ftp:ServiceConfig annotation
if ("ftp:ServiceConfig".equals(annotationText)) {

Copilot uses AI. Check for mistakes.
Comment on lines +281 to +283
String serviceConfigAnnotation = "@ftp:ServiceConfig {" + NEW_LINE +
" path: " + folderPath + NEW_LINE +
"}" + NEW_LINE;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The generated service annotation is hardcoded as @ftp:ServiceConfig, which assumes the module is imported with the default prefix ftp. If the user already has import ballerina/ftp as <alias>; in the file, importExists will return true (it ignores the alias) and the generated @ftp:... reference will not compile. Consider resolving the actual import prefix/alias for ballerina/ftp from the existing import declarations and using that prefix when emitting the annotation reference (or otherwise ensuring the prefix used in generated code matches the import).

Copilot uses AI. Check for mistakes.
@niveathika niveathika merged commit e4dbb57 into ballerina-platform:1.6.x Feb 18, 2026
8 of 10 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.

1 participant