-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: added automatic option to run behaviour behind feature flag #40608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change introduces a new "Automatic" run behavior option across plugin action settings, updates type definitions and configuration schemas, and implements logic to conditionally show or hide the "Automatic" option based on a feature flag. Type safety is improved throughout, and plugin configuration files are updated to include the new option. Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant Redux
participant FeatureFlag
participant PluginUtils
UI->>Redux: Select run behavior dropdown
Redux->>FeatureFlag: Check "release_reactive_actions_enabled"
FeatureFlag-->>Redux: Return flag value (true/false)
Redux->>PluginUtils: updateRunBehaviourForActionSettings(config, flag)
PluginUtils-->>Redux: Return filtered config (with/without "Automatic")
Redux-->>UI: Render dropdown with correct options
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (10)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/14903155093. |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/14903838178. |
Deploy-Preview-URL: https://ce-40608.dp.appsmith.com |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/14904311492. |
Deploy-Preview-URL: https://ce-40608.dp.appsmith.com |
app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts
Outdated
Show resolved
Hide resolved
…com/appsmithorg/appsmith into chore/remove-unnecessary-code
…com/appsmithorg/appsmith into chore/run-behviour-with-ff
…ithorg/appsmith into chore/remove-unnecessary-code
…ithorg/appsmith into chore/remove-unnecessary-code
chore: Removing unnecessary code and keeping the logic same for plugin based and other action settings only on frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be merged only after Milestone 1 feature branches are merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useGoogleSheetsSetDefaultProperty.ts (1)
34-36
: Guard against potentially undefinedsettingsConfig
CastingsettingsConfig
directly may break if it's everundefined
. Consider using a fallback:- merge(initialValues, - getConfigInitialValues(settingsConfig as PluginActionSettingsConfig[]), - ); + merge(initialValues, + getConfigInitialValues(settingsConfig ?? []), + );app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (2)
10046-10051
: Avoid duplicating run behavior options.
The"Automatic"
option block is replicated in multiple dropdown definitions. Extract it into a shared constant (for example,automaticRunBehaviorOption
) or importRUN_BEHAVIOR_VALUES
fromPluginSettings.ts
to keep test fixtures DRY and aligned with production code.
10103-10108
: Use enum reference for the option value.
Instead of hardcoding"AUTOMATIC"
, import and use theActionRunBehaviour.AUTOMATIC
enum fromPluginActionTypes.ts
. This ensures type safety and guards against typos if the enum is ever renamed.app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
6-11
: Consider removing duplication in option objects.The
label
andchildren
properties have identical values in each option. Consider either using a factory function to create these objects or removing one of the duplicated fields if the consuming components don't require both.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
app/client/package.json
(1 hunks)app/client/src/PluginActionEditor/PluginActionContext.tsx
(1 hunks)app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useGoogleSheetsSetDefaultProperty.ts
(2 hunks)app/client/src/PluginActionEditor/components/PluginActionToolbar/components/ActionSettings.tsx
(3 hunks)app/client/src/PluginActionEditor/types/PluginActionTypes.ts
(1 hunks)app/client/src/ce/entities/FeatureFlag.ts
(2 hunks)app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts
(4 hunks)app/client/src/constants/AppsmithActionConstants/ActionConstants.tsx
(2 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts
(2 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts
(2 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts
(2 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx
(2 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json
(7 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json
(7 hunks)app/client/src/utils/PluginUtils.ts
(1 hunks)app/client/test/factories/MockPluginsState.ts
(4 hunks)app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (8)
app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useGoogleSheetsSetDefaultProperty.ts (1)
app/client/src/components/formControls/utils.ts (1)
getConfigInitialValues
(404-528)
app/client/src/PluginActionEditor/components/PluginActionToolbar/components/ActionSettings.tsx (2)
app/client/src/ce/selectors/featureFlagsSelectors.ts (1)
selectFeatureFlagCheck
(19-30)app/client/src/utils/PluginUtils.ts (1)
updateRunBehaviourForActionSettings
(8-36)
app/client/src/utils/PluginUtils.ts (2)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
ActionSettingsConfig
(26-30)ActionSettingsConfigChildren
(13-24)app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
RUN_BEHAVIOR_CONFIG_PROPERTY
(3-3)
app/client/src/PluginActionEditor/PluginActionContext.tsx (1)
app/client/src/api/ActionAPI.tsx (1)
ActionResponse
(76-92)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (1)
app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
RUN_BEHAVIOR_VALUES
(5-24)
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (1)
app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
RUN_BEHAVIOR_CONFIG_PROPERTY
(3-3)
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (1)
app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
RUN_BEHAVIOR_CONFIG_PROPERTY
(3-3)
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (1)
app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
RUN_BEHAVIOR_CONFIG_PROPERTY
(3-3)
🔇 Additional comments (51)
app/client/package.json (1)
430-430
: Add a POSIX-compliant newline at end-of-file.Including a trailing newline helps prevent issues with certain Unix tools and keeps diffs cleaner.
app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json (1)
13-17
: Add new "Automatic" run behavior option
The"Automatic"
entry has been correctly inserted with the properlabel
,subText
, andvalue
. It aligns with the existing options and JSON schema. Ensure the client’s feature-flag logic (release_reactive_actions_enabled
) filters this option as intended in the UI.app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json (1)
13-17
: Add new "Automatic" run behavior option
The"Automatic"
option is correctly added to the dropdown array with consistent formatting. Confirm that the UI respects the feature flag gating for this option.app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json (1)
13-17
: Add new "Automatic" run behavior option
The inserted"Automatic"
block matches the pattern in other plugins. Validate that the client-side filter viaupdateRunBehaviourForActionSettings
hides this when the feature flag is off.app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json (1)
13-17
: Add new "Automatic" run behavior option
The new option is inserted properly and JSON remains valid. Please verify that no downstream consumers assume only two options.app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json (1)
13-17
: Add new "Automatic" run behavior option
The"Automatic"
entry is in the correct position and format. Ensure consistency across all plugin UIs under the feature flag.app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json (1)
13-17
: Add "Automatic" run behavior option
The new dropdown entry is correctly formatted and matches other plugins. Verify that the client‐sideupdateRunBehaviourForActionSettings
utility properly hides this whenrelease_reactive_actions_enabled
is false.app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json (1)
13-17
: Add "Automatic" run behavior option
Consistent addition here. Ensure the client filtering logic (release_reactive_actions_enabled
) prevents display when the feature flag is off.app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json (1)
13-17
: Add "Automatic" run behavior option
Looks good in the MySQL config. Confirm that on the frontend,ActionRunBehaviour.AUTOMATIC
is only shown when the feature flag is enabled.app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json (1)
13-17
: Add "Automatic" run behavior option
The JSON syntax is correct. Please test that the Oracle action settings dropdown respects therelease_reactive_actions_enabled
flag.app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json (1)
13-17
: Add "Automatic" run behavior option
This addition aligns with other plugin schemas. Verify the UI hides this option when reactive actions are disabled.app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json (1)
13-17
: Integrate new "Automatic" run behavior option
The new option is correctly inserted before existing entries, preserving"MANUAL"
as the default. This aligns with the client-side feature flag filtering logic.app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json (1)
13-17
: Integrate new "Automatic" run behavior option
Consistent addition for the Postgres plugin’s settings. Ordering and defaults match other plugins.app/client/src/PluginActionEditor/components/PluginActionForm/components/UQIEditor/hooks/useGoogleSheetsSetDefaultProperty.ts (1)
10-10
: Refine import to use specific settings config type
ImportingPluginActionSettingsConfig
improves type safety over the previous generic record type.app/client/src/PluginActionEditor/PluginActionContext.tsx (1)
11-17
: RefinesettingsConfig
type for stronger typing
Updating fromunknown[]
toPluginActionSettingsConfig[]
aligns this context with the new structured schema and prevents unsafe casts downstream.app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json (1)
2550-2554
: Add new "Automatic" option to initial state run behavior
This aligns the mocked initial state with the updated plugin settings. Verify that any tests asserting on the run behavior options are updated to include this new choice.app/client/src/ce/entities/FeatureFlag.ts (2)
63-63
: New feature flag added correctly.The new feature flag follows the naming convention documented in the link at the top of the file and is positioned appropriately in the object.
114-114
: Default value appropriately set to false.Setting the default to false is correct for a feature flag that controls a new feature, allowing for controlled rollout.
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (2)
2-5
: Good refactoring of imports.The imports have been updated to use constants from a centralized location, which improves maintainability.
14-16
: Improved type safety with enum replacement.Replacing string literals with constants and using the enum
ActionRunBehaviour.MANUAL
instead of string values improves type safety and code maintainability.app/client/src/constants/AppsmithActionConstants/ActionConstants.tsx (2)
11-11
: Appropriate type import added.The import for
PluginActionSettingsConfig
type is correctly added to support the type annotation changes.
170-173
: Improved type safety by removing 'any'.Replacing the generic
Record<PluginType, any>
with the more specificRecord<PluginType, PluginActionSettingsConfig[]>
improves type safety and helps prevent potential errors.app/client/test/factories/MockPluginsState.ts (4)
6960-6964
: Implementation looks good for REST API plugin.The "Automatic" run behavior option has been correctly added to the REST API plugin settings with appropriate label and descriptive subtext.
7045-7049
: Implementation consistent for GraphQL API plugin.The same "Automatic" run behavior option has been properly added to the GraphQL API plugin settings, maintaining consistency with other plugins.
7130-7134
: Implementation matches pattern for Appsmith AI plugin.The "Automatic" option has been correctly added to the Appsmith AI plugin settings following the same pattern as other plugins.
7179-7183
: Implementation complete for PostgreSQL plugin.The "Automatic" run behavior option has been successfully added to the PostgreSQL plugin settings, completing the implementation across all targeted plugins.
app/client/src/PluginActionEditor/components/PluginActionToolbar/components/ActionSettings.tsx (4)
9-11
: Good integration of feature flag checkThe implementation correctly imports the necessary selectors and uses them to check the feature flag status for reactive actions.
47-54
: Well-structured feature flag checkThe feature flag selector is properly implemented with the correct flag name. This ensures the "Automatic" option can be controlled via configuration.
51-54
: Properly applying conditional settings logicThe code correctly uses the utility function to update settings configuration based on the feature flag status.
58-67
: Appropriate conditional renderingGood update to the rendering logic, now using the filtered settings config and maintaining the error handling.
app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json (7)
2551-2555
: Consistent implementation of Automatic option for MongoDBThe new "Automatic" run behavior option is correctly added with appropriate label and descriptive subtext.
2602-2606
: Consistent implementation of Automatic option for SQLThe option is correctly implemented with the same structure as other plugins.
2653-2657
: Consistent implementation of Automatic option for REST APIThe implementation maintains consistency with other plugin configurations.
2710-2714
: Consistent implementation of Automatic option for FirebaseThe option is correctly added with appropriate description.
2754-2758
: Consistent implementation of Automatic option for Google SheetsThe option is properly integrated with the same pattern as other plugins.
2805-2809
: Consistent implementation of Automatic option for S3The implementation follows the established pattern across all plugins.
2856-2860
: Consistent implementation of Automatic option for RedisThe option is correctly added with consistent structure.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (2)
22-23
: Good update to centralized constants usageThe code correctly imports run behavior values from the central constants file.
52-59
: Well-implemented feature flag check and option filteringThe implementation properly uses the feature flag hook and filters options accordingly to conditionally show the Automatic option.
app/client/src/utils/PluginUtils.ts (2)
1-7
: Clean imports with proper typingThe imports are correctly organized and include necessary types from the appropriate modules.
8-36
: Well-designed utility function for conditional option filteringThe function efficiently filters out the "Automatic" option when the feature flag is disabled while maintaining immutability through proper mapping. The implementation follows functional programming principles by creating new objects rather than mutating existing ones.
This utility helps maintain consistent behavior across the application.
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (3)
3-5
: Import statements updated to use centralized constantsThe changes properly refactor imports to use centralized run behavior constants from PluginSettings instead of direct imports, and introduce the ActionRunBehaviour enum.
14-14
: Using constant instead of hardcoded stringGood refactoring to use the RUN_BEHAVIOR_CONFIG_PROPERTY constant instead of hardcoded "runBehaviour" string, improving maintainability.
16-16
: Using enum value for better type safetyAppropriate update to use ActionRunBehaviour.MANUAL enum value instead of RUN_BEHAVIOR.MANUAL.label, improving type safety and enabling the automatic option feature.
app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (2)
10160-10165
: Ensure test utils respect the feature flag.
These fixtures include the"Automatic"
option unconditionally. Ifrelease_reactive_actions_enabled
is false in tests, the dropdown behavior may diverge from production. Mock or set the flag totrue
in your unit test setup when using these utils.
10247-10251
: ValidatesubText
consistency.
Double-check that thesubText
here exactly matches the description in the centralizedRUN_BEHAVIOR_VALUES
. Keeping them in sync avoids confusing discrepancies between tests and UI.app/client/src/constants/AppsmithActionConstants/formConfig/PluginSettings.ts (1)
1-24
: Good centralization of run behavior constants.This new file effectively centralizes the run behavior configuration, making it easier to maintain and reference across the codebase. The constants are well-defined with clear labels and descriptive text.
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (2)
10-13
: Good import refactoring.The imports have been properly updated to use the new centralized constants from PluginSettings.
21-25
: Improved type safety in run behavior configuration.Using constants and enum values instead of string literals improves code maintainability and type safety.
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
8-8
: Good addition of AUTOMATIC enum value.Properly extends the enum to support the new Automatic run behavior option.
11-30
: Improved type safety with new interfaces.The new type alias and interfaces provide better type checking and structure for action settings configurations, making the code more robust and maintainable.
…o chore/run-behviour-with-ff
…o chore/run-behviour-with-ff
Description
Updated settings for different actions for adding new option (Automatic) to run behaviour drop down behind feature flag
release_reactive_actions_enabled
Fixes #40456
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15065485800
Commit: 4c4074c
Cypress dashboard.
Tags:
@tag.All
Spec:
Fri, 16 May 2025 10:58:06 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Enhancements