-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore: Add isModuleInstance property to EXECUTE_ACTION event #37191
Conversation
WalkthroughThe changes in the pull request enhance the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
|
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
🧹 Outside diff range and nitpick comments (2)
app/client/src/ce/sagas/analyticsSaga.ts (2)
76-79
: Consider combining selectors for performanceThe pattern of selecting both widget and jsCollection using the same ID could be optimized into a single selector.
Consider creating a combined selector:
const getSourceDetails = createSelector( [getWidget, getJSCollection], (widget, jsCollection) => ({ widget, jsCollection }) );
105-105
: Extract repeated isModuleInstance calculationThe isModuleInstance calculation is duplicated. Consider extracting it to a constant.
+ const isModuleInstance = Boolean(jsCollection?.moduleInstanceId); AnalyticsUtil.logEvent("EXECUTE_ACTION", { // ... other properties ... - isModuleInstance: Boolean(jsCollection?.moduleInstanceId), + isModuleInstance, }); AnalyticsUtil.logEvent( isUnsuccessfulExecution ? "EXECUTE_ACTION_FAILURE" : "EXECUTE_ACTION_SUCCESS", { // ... other properties ... - isModuleInstance: Boolean(jsCollection?.moduleInstanceId), + isModuleInstance, }, );Also applies to: 131-131
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/src/ce/sagas/analyticsSaga.ts
(4 hunks)
🔇 Additional comments (2)
app/client/src/ce/sagas/analyticsSaga.ts (2)
9-9
: LGTM: Import addition follows existing patterns
Line range hint 76-131
: Verify analytics event property consistency
Let's ensure other module-related analytics events also track the isModuleInstance property.
✅ Verification successful
Based on the search results, I can see that the isModuleInstance
property is being consistently used in analytics events for action execution in the codebase. The property is added to both success and failure events (EXECUTE_ACTION
, EXECUTE_ACTION_SUCCESS
, EXECUTE_ACTION_FAILURE
) for JS expressions. This shows proper analytics tracking for module-related executions.
Analytics property consistency verified ✓
The implementation correctly tracks module instance information across all relevant analytics events in the action execution flow.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other analytics events that might need the isModuleInstance property
rg "AnalyticsUtil\.logEvent.*module" --type ts
Length of output: 48
Script:
#!/bin/bash
# Let's search for all analytics events in the codebase
rg "AnalyticsUtil\.logEvent" -A 5 --type ts
Length of output: 222415
Script:
#!/bin/bash
# Let's also check for any module-related code patterns
ast-grep --pattern 'moduleInstanceId'
Length of output: 37
Script:
#!/bin/bash
# Search for any module-related analytics events with a broader pattern
rg "logEvent.*module|module.*logEvent" --type ts
Length of output: 50
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: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/src/ce/sagas/analyticsSaga.ts
(4 hunks)
🔇 Additional comments (2)
app/client/src/ce/sagas/analyticsSaga.ts (2)
9-9
: LGTM: Import statement is correctly placed and necessary
The new import aligns with the implementation requirements.
107-107
: LGTM: Analytics property addition is consistent and type-safe
The isModuleInstance property is correctly implemented with proper type coercion and null safety.
Let's verify that this property is handled correctly in analytics:
Also applies to: 133-133
✅ Verification successful
Analytics property addition verified and properly integrated
The isModuleInstance
property is correctly implemented in the analytics events:
- Present in both EXECUTE_ACTION and EXECUTE_ACTION_SUCCESS/FAILURE events
- Consistently uses Boolean constructor for type coercion
- Events are properly defined in analyticsUtilTypes.ts
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if analytics utilities properly handle this new property
rg -l "EXECUTE_ACTION" --type ts
Length of output: 300
Script:
#!/bin/bash
# Check analytics event type definitions and handling
rg "EXECUTE_ACTION" app/client/src/ce/utils/analyticsUtilTypes.ts -A 5
# Check analytics saga implementation
rg "isModuleInstance" app/client/src/ce/sagas/analyticsSaga.ts -A 5
# Look for any other usages of isModuleInstance in analytics context
rg "isModuleInstance.*analytics" --type ts
Length of output: 826
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11658967753. |
Deploy-Preview-URL: https://ce-37191.dp.appsmith.com |
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
This PR has been closed because of inactivity. |
Description
Update 'EXECUTE_ACTION' event to include
isModuleInstance
propertyFixes #
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.All"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11658289069
Commit: 4e2d9a8
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:
Mon, 04 Nov 2024 06:28:25 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
isModuleInstance
.instanceId
andpageId
.Bug Fixes