feat: add support for listing function versions and aliases in AWS Lambda Plugin#41263
Conversation
…mbda Plugin - Implemented new commands `LIST_FUNCTION_VERSIONS` and `LIST_FUNCTION_ALIASES` in the AwsLambdaPlugin to retrieve function versions and aliases respectively. - Updated the invoke.json to include optional fields for function version and alias. - Created new JSON files for listing function versions and aliases with appropriate configurations. - Enhanced the plugin's test suite to cover the new functionalities, ensuring correct behavior for version and alias retrieval. This update improves the AWS Lambda Plugin's capabilities, allowing users to manage function versions and aliases more effectively.
WalkthroughAdds LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES support: execute() dispatches new commands; trigger() returns dynamic dropdown options for FUNCTION_NAMES, FUNCTION_VERSIONS, FUNCTION_ALIASES; invoke resolves qualifier preferring alias over version; new executor helpers list versions/aliases and return JSON bodies; editor schemas and tests updated. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Editor UI
participant Plugin as AwsLambdaPlugin
participant AWS as AWSLambda
rect rgb(238,245,255)
note over User,UI: Invoke with optional version/alias
User->>UI: Submit INVOKE_FUNCTION (functionName[, functionVersion, functionAlias])
UI->>Plugin: execute(INVOKE_FUNCTION, cfg)
end
Plugin->>Plugin: Resolve qualifier\n(use functionAlias if present else functionVersion)
Plugin->>AWS: invoke(functionName:qualifier, payload)
AWS-->>Plugin: InvokeResult
Plugin-->>UI: ActionExecutionResult (payload/status JSON)
sequenceDiagram
autonumber
actor User
participant UI as Editor UI
participant Plugin as AwsLambdaPlugin
participant AWS as AWSLambda
rect rgb(243,255,243)
note over User,UI: Dynamic dropdown population via trigger()
User->>UI: Open FUNCTION_NAMES dropdown
UI->>Plugin: trigger(requestType=FUNCTION_NAMES)
Plugin->>AWS: listFunctions()
AWS-->>Plugin: functions[]
Plugin-->>UI: options[]
User->>UI: Open FUNCTION_VERSIONS or FUNCTION_ALIASES dropdown
UI->>Plugin: trigger(requestType=FUNCTION_VERSIONS|FUNCTION_ALIASES, functionName)
Plugin->>AWS: listVersionsByFunction(functionName) or listAliases(functionName)
AWS-->>Plugin: versions[] or aliases[]
Plugin-->>UI: options[]
end
sequenceDiagram
autonumber
actor User
participant UI as Editor UI
participant Plugin as AwsLambdaPlugin
participant AWS as AWSLambda
User->>UI: Select command LIST_FUNCTION_VERSIONS or LIST_FUNCTION_ALIASES
UI->>Plugin: execute(command, functionName)
alt LIST_FUNCTION_VERSIONS
Plugin->>AWS: listVersionsByFunction(functionName)
else LIST_FUNCTION_ALIASES
Plugin->>AWS: listAliases(functionName)
end
AWS-->>Plugin: results
Plugin-->>UI: ActionExecutionResult (JSON body)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/build-deploy-preview skipTests=True |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18007360639. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java (1)
216-239: Handle AWS pagination for list callslistFunctions, listVersionsByFunction, and listAliases are single-page calls today. For accounts with many functions/versions/aliases, results will be truncated. Iterate with NextMarker until null.
Also applies to: 241-264
app/server/appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java (1)
202-230: Add negative-path tests for missing functionNamePlease add tests asserting:
- execute LIST_FUNCTION_VERSIONS/ALIASES with missing functionName throws AppsmithPluginException.
- trigger FUNCTION_VERSIONS/ALIASES with null params does not NPE (after the suggested guard).
Also applies to: 232-257, 372-398, 400-423
app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/invoke.json (2)
39-66: Function version block: LGTM with a small UX tweakConsider noting that if both alias and version are set, alias takes precedence (to match backend behavior).
Apply this minimal tweak:
- "tooltipText": "Optional: Specify a version number (e.g., 1, 2, $LATEST) or leave empty for $LATEST.", + "tooltipText": "Optional: Specify a version (e.g., 1, 2, $LATEST). If both alias and version are set, alias takes precedence. Leave empty for $LATEST.",
68-94: Function alias block: LGTM with mutual‑exclusion UXTo reduce confusion, consider disabling the version dropdown when alias is selected (and vice‑versa), or add helper text about precedence.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java(4 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/invoke.json(1 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listAliases.json(1 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listVersions.json(1 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/root.json(2 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (17)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java (3)
77-81: New commands wired into execute(): LGTMCommand dispatch for LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES looks correct.
159-160: Trigger output wiring: LGTMSetting TriggerResultDTO.trigger to the options list is correct and matches tests.
235-239: Overload delegating to the 3-arg version: LGTMKeeps call sites clean while enabling reuse from trigger().
app/server/appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java (9)
202-230: LIST_FUNCTION_VERSIONS test: LGTM
232-257: LIST_FUNCTION_ALIASES test: LGTM
259-286: Invoke with version: LGTM
288-315: Invoke with alias: LGTM
317-347: Alias precedence over version: LGTM
349-370: Trigger FUNCTION_NAMES: LGTM
372-398: Trigger FUNCTION_VERSIONS: LGTM
400-423: Trigger FUNCTION_ALIASES: LGTM
425-435: Unsupported trigger type test: LGTMapp/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/root.json (3)
16-16: Command isRequired: LGTM
23-30: New command options: LGTM
42-42: Editor files list updated: LGTMapp/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listVersions.json (1)
1-43: LIST_FUNCTION_VERSIONS editor section: LGTMDynamic FUNCTION_NAMES loading and gating look correct.
app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listAliases.json (1)
1-37: Looks correct for the new alias listing command.UI wiring and dynamic fetch parameters line up with the new backend command. Nicely done.
...ver/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Show resolved
Hide resolved
...ver/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Outdated
Show resolved
Hide resolved
...ver/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Show resolved
Hide resolved
...ver/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Show resolved
Hide resolved
- Changed the method of retrieving the function name parameter from `request.getParams()` to `request.getParameters()` for better type safety and consistency. - This update ensures that the function name is correctly fetched as a String, preventing potential runtime errors. This fix enhances the reliability of the AWS Lambda Plugin's functionality related to function versions and aliases.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…//github.com/appsmithorg/appsmith into rahulbarwal/aws-lambda-version-functionality
|
/build-deploy-preview skipTests=True |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18008983181. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java(4 hunks)
🧰 Additional context used
🪛 GitHub Actions: Quality checks
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
[error] 113-113: Cannot find symbol: method getParams() in TriggerRequestDTO. This may indicate a API mismatch or missing method in TriggerRequestDTO. Check the class definition and usage.
🔇 Additional comments (1)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java (1)
247-263: Validate functionName before hitting ListAliases.Without this guard we pass
nulldown to AWS, which returns a 400 and surfaces as a plugin error. Mirror the versions check here.if (actionConfiguration != null) { functionName = getDataValueSafelyFromFormData(actionConfiguration.getFormData(), "functionName", STRING_TYPE); } + if (!StringUtils.hasText(functionName)) { + throw new AppsmithPluginException( + AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, + "function name is required for listing aliases"); + }
...ver/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Outdated
Show resolved
Hide resolved
….com:appsmithorg/appsmith into rahulbarwal/aws-lambda-version-functionality
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java(4 hunks)app/server/appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: server-spotless / spotless-check
🔇 Additional comments (1)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java (1)
254-271: ValidatefunctionNamebefore callinglistAliases.We still allow
functionNameto be null/blank here; the SDK throws (validation error) instead of returning a clean plugin error. Mirror the guard you already added for versions to keep the behavior consistent.if (actionConfiguration != null) { functionName = getDataValueSafelyFromFormData(actionConfiguration.getFormData(), "functionName", STRING_TYPE); } + if (!StringUtils.hasText(functionName)) { + throw new AppsmithPluginException( + AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, + "function name is required for listing aliases"); + }
...appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java
Show resolved
Hide resolved
...appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java
Show resolved
Hide resolved
|
/build-deploy-preview skip-tests=True recreate=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18010410345. |
|
/build-deploy-preview skip-tests=true recreate=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18010431321. |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18013188766. |
|
Deploy-Preview-URL: https://ce-41263.dp.appsmith.com |
…ases (#41267) ## Description - Enhanced the AwsLambdaPlugin to support both old and new parameter structures for retrieving function names in FUNCTION_VERSIONS and FUNCTION_ALIASES requests. - Updated the invoke.json to reflect the new parameter structure, ensuring compatibility with the updated logic. This change improves the robustness of the plugin by accommodating different parameter formats, preventing potential errors during function name retrieval. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18035803838. |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18035820742. |
|
Deploy-Preview-URL: https://ce-41263.dp.appsmith.com |
…ions and aliases in AWS Lambda Plugin (appsmithorg#41263)
…ns and aliases in AWS Lambda Plugin (appsmithorg#41263)
Description
This PR adds support for listing AWS Lambda function versions and aliases in the plugin. It’s part of ongoing efforts to make Lambda management more robust and user-friendly for Appsmith users.
Changes
LIST_FUNCTION_VERSIONSandLIST_FUNCTION_ALIASES, to the AwsLambdaPlugin, enabling retrieval of function versions and aliases.invoke.jsonto support optional fields for specifying function version and alias, improving invocation flexibility.Testing
Automated tests have been added to the plugin’s test suite, specifically targeting the new version and alias listing functionalities. These tests verify correct command execution and output structure.
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Datasource"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/18035977310
Commit: 0148b54
Cypress dashboard.
Tags:
@tag.DatasourceSpec:
Fri, 26 Sep 2025 11:49:19 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Tests