Skip to content

feat: add support for listing function versions and aliases in AWS Lambda Plugin#41263

Merged
NilanshBansal merged 9 commits intoreleasefrom
rahulbarwal/aws-lambda-version-functionality
Sep 26, 2025
Merged

feat: add support for listing function versions and aliases in AWS Lambda Plugin#41263
NilanshBansal merged 9 commits intoreleasefrom
rahulbarwal/aws-lambda-version-functionality

Conversation

@rahulbarwal
Copy link
Contributor

@rahulbarwal rahulbarwal commented Sep 25, 2025

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

  • Introduced new commands, LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES, to the AwsLambdaPlugin, enabling retrieval of function versions and aliases.
  • Updated invoke.json to support optional fields for specifying function version and alias, improving invocation flexibility.
  • Added dedicated JSON configuration files for listing function versions and aliases, streamlining command usage and future extensibility.
  • Enhanced the plugin’s test suite to cover the new commands, ensuring correct behavior for version and alias retrieval.
  • These changes align with our broader goal of making cloud integrations more manageable and transparent, especially as we scale Appsmith’s automation capabilities.

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 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="@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.Datasource
Spec:


Fri, 26 Sep 2025 11:49:19 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • List AWS Lambda function versions and aliases; invoke by selecting a version or alias (alias takes precedence).
    • New dynamic dropdowns for Function Version and Function Alias tied to the selected function; command menu adds "List Function Versions" and "List Function Aliases."
    • Trigger menus now return option lists for FUNCTION_NAMES/FUNCTION_VERSIONS/FUNCTION_ALIASES.
    • Added UI editor sections for listing versions and aliases.
  • Tests

    • Added tests for listing versions/aliases, invoking with version/alias, trigger behavior, and validation.

…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.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Plugin core & executor
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java
Added handling for LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES in execute(); trigger() builds option lists for FUNCTION_NAMES, FUNCTION_VERSIONS, FUNCTION_ALIASES; invoke chooses qualifier preferring functionAlias over functionVersion.
Executor helper methods (new)
app/server/appsmith-plugins/awsLambdaPlugin/src/main/java/com/external/plugins/AwsLambdaPlugin.java (new methods)
Added listFunctionVersions(ActionConfiguration, AWSLambda, String), listFunctionVersions(ActionConfiguration, AWSLambda), listFunctionAliases(ActionConfiguration, AWSLambda, String), listFunctionAliases(ActionConfiguration, AWSLambda). They validate required params, call AWS SDK list APIs, and serialize results to JSON bodies via objectMapper.
Editor: invoke UI
app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/invoke.json
Added optional dropdowns "Function version" and "Function alias" with conditional dynamic value fetching tied to selected function name (FUNCTION_VERSIONS, FUNCTION_ALIASES); non-required, with placeholders and no automatic default.
Editor: new list sections
app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listVersions.json, app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listAliases.json
Added SECTION_V2 configs for LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES containing a required Function name dropdown that fetches FUNCTION_NAMES; each section visible only when its command is selected and supports JSON alternate view.
Editor: root
app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/root.json
Marked Command dropdown isRequired: true; added command options LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES; registered new files listVersions.json and listAliases.json.
Tests
app/server/appsmith-plugins/awsLambdaPlugin/src/test/java/com/external/plugins/AwsLambdaPluginTest.java
Added SDK model imports and unit tests covering listing function versions/aliases, invoke with version/alias (alias precedence over version), trigger flows for names/versions/aliases, and unsupported requestType error path.

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)
Loading
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
Loading
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)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

A Lambda grew a brand-new hat,
Versions and aliases tread like that.
Dropdowns hum, tests sing bright,
Alias wins the qualifier fight.
CI nods, the plugin sleeps tonight.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ⚠️ Warning The PR description follows the template’s headings for Description, Automation, Cypress results, and Communication but the Fixes section still contains a placeholder instead of a real issue number or URL, leaving it unclear which issue this change resolves. This omission violates the template requirement to link the PR to an existing issue. Without a valid Fixes reference, the description is incomplete. Replace the placeholder in the Fixes line with an actual issue number (e.g., Fixes #1234) or a full issue URL to correctly link this PR to the relevant issue before merging.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title succinctly captures the primary enhancement of adding support for listing function versions and aliases in the AWS Lambda plugin and follows a clear and conventional commit style while remaining concise and specific.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rahulbarwal/aws-lambda-version-functionality

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.

❤️ Share

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

@github-actions github-actions bot added the Enhancement New feature or request label Sep 25, 2025
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skipTests=True

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18007360639.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 41263.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 calls

listFunctions, 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 functionName

Please 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 tweak

Consider 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 UX

To 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

📥 Commits

Reviewing files that changed from the base of the PR and between b79b160 and a8752c7.

📒 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(): LGTM

Command dispatch for LIST_FUNCTION_VERSIONS and LIST_FUNCTION_ALIASES looks correct.


159-160: Trigger output wiring: LGTM

Setting TriggerResultDTO.trigger to the options list is correct and matches tests.


235-239: Overload delegating to the 3-arg version: LGTM

Keeps 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: LGTM

app/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: LGTM

app/server/appsmith-plugins/awsLambdaPlugin/src/main/resources/editor/listVersions.json (1)

1-43: LIST_FUNCTION_VERSIONS editor section: LGTM

Dynamic 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.

rahulbarwal and others added 4 commits September 25, 2025 18:49
- 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>
@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skipTests=True

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18008983181.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 41263.
recreate: .

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8752c7 and 9f37893.

📒 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 null down 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");
+        }

….com:appsmithorg/appsmith into rahulbarwal/aws-lambda-version-functionality
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f37893 and 103c25c.

📒 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: Validate functionName before calling listAliases.

We still allow functionName to 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");
+        }

@NilanshBansal
Copy link
Contributor

/build-deploy-preview skip-tests=True recreate=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18010410345.
Workflow: On demand build Docker image and deploy preview.
skip-tests: True.
env: ``.
PR: 41263.
recreate: true.

@NilanshBansal
Copy link
Contributor

/build-deploy-preview skip-tests=true recreate=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18010431321.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41263.
recreate: true.

@NilanshBansal
Copy link
Contributor

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18013188766.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41263.
recreate: .

@github-actions
Copy link

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
@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18035803838.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 41263.
recreate: .

@rahulbarwal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@rahulbarwal rahulbarwal self-assigned this Sep 26, 2025
@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/18035820742.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41263.
recreate: .

@NilanshBansal NilanshBansal added the ok-to-test Required label for CI label Sep 26, 2025
Copy link
Contributor

@NilanshBansal NilanshBansal left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41263.dp.appsmith.com

@NilanshBansal NilanshBansal enabled auto-merge (squash) September 26, 2025 11:17
@NilanshBansal NilanshBansal merged commit 180af27 into release Sep 26, 2025
53 checks passed
@NilanshBansal NilanshBansal deleted the rahulbarwal/aws-lambda-version-functionality branch September 26, 2025 15:15
qdsordinarydream pushed a commit to qdsordinarydream/appsmith that referenced this pull request Sep 27, 2025
qdsordinarydream pushed a commit to qdsordinarydream/appsmith that referenced this pull request Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants