Skip to content

chore: Adding AI agent feature flag check for audit logs upgrade page #40185

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Apr 9, 2025

Description

Adding AI agent feature flag check for audit logs upgrade page

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.Settings"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14350813652
Commit: 89483c5
Cypress dashboard.
Tags: @tag.Settings
Spec:


Wed, 09 Apr 2025 07:12:00 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Upgrade messaging now dynamically reflects the selected plan—displaying "business" or "enterprise" based on current settings.
    • Enhanced audit log configurations incorporate an enterprise flag to adjust messaging contextually.
  • Bug Fixes
    • Corrected text capitalization for clearer plan description in the upgrade footer.

Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

The pull request updates dynamic messaging in the application by modifying the EXCLUSIVE_TO_BUSINESS constant to accept an additional parameter, planName, and updating the text in ACCESS_CONTROL_UPGRADE_PAGE_FOOTER. It also integrates a Redux selector to conditionally set the isEnterprise flag in both the audit logs configuration and the upgrade page footer, allowing the UI to reflect whether the enterprise feature is enabled.

Changes

File(s) Change Summary
app/client/src/ce/constants/messages.ts Updated EXCLUSIVE_TO_BUSINESS to accept an additional planName parameter and revised the message text in ACCESS_CONTROL_UPGRADE_PAGE_FOOTER.
app/client/src/ce/pages/AdminSettings/config/auditlogs.ts Added import for store and getIsAiAgentFlowEnabled. Introduced isEnterprise property in the configuration based on the Redux state.
app/client/src/ce/pages/Upgrade/AuditLogsUpgradePage.tsx Integrated Redux state with useSelector to define isAiAgentFlowEnabled. Updated the footer message logic to pass "enterprise" or "business" dynamically and added an isEnterprise property.

Sequence Diagram(s)

sequenceDiagram
    participant AuditPage as AuditLogsUpgradePage
    participant Redux as Redux Store
    participant Selector as getIsAiAgentFlowEnabled
    participant Footer as Footer Component

    AuditPage->>Redux: useSelector(getIsAiAgentFlowEnabled)
    Redux-->>AuditPage: isAiAgentFlowEnabled (true/false)
    AuditPage->>Footer: Set footer message ("enterprise" if true, "business" if false)
    Footer-->>AuditPage: Render dynamic footer message
Loading

Suggested labels

skip-changelog, ok-to-test

Suggested reviewers

  • albinAppsmith
  • jsartisan

Poem

In lines of code, a new path is cast,
Parameters and state align at last,
Redux whispers the plan, enterprise or base,
Dynamic messages now find their place,
A clever tweak to make our code a blast! 🚀

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ankitakinger ankitakinger added the ok-to-test Required label for CI label Apr 9, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Apr 9, 2025
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: 0

🧹 Nitpick comments (1)
app/client/src/ce/pages/Upgrade/AuditLogsUpgradePage.tsx (1)

83-88: Dynamic messaging based on feature flag is well-implemented.

The implementation correctly passes the appropriate plan name to the message function based on the feature flag, and sets the isEnterprise property accordingly.

One minor suggestion: The boolean expression isAiAgentFlowEnabled ? true : false could be simplified to just isAiAgentFlowEnabled.

- isEnterprise: isAiAgentFlowEnabled ? true : false,
+ isEnterprise: isAiAgentFlowEnabled,
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af2f442 and 89483c5.

📒 Files selected for processing (3)
  • app/client/src/ce/constants/messages.ts (2 hunks)
  • app/client/src/ce/pages/AdminSettings/config/auditlogs.ts (2 hunks)
  • app/client/src/ce/pages/Upgrade/AuditLogsUpgradePage.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-build / client-build
🔇 Additional comments (5)
app/client/src/ce/pages/AdminSettings/config/auditlogs.ts (2)

8-11: Good implementation of Redux selector for feature flag.

The import of Redux store and the AI agent selector is well-structured. This allows for a centralized feature flag check across components.


22-22: Conditional property based on feature flag looks good.

The isEnterprise flag is properly set based on the AI agent flow state, using a clean ternary expression.

app/client/src/ce/constants/messages.ts (1)

1514-1518: Good function parameter enhancement with backward compatibility.

The EXCLUSIVE_TO_BUSINESS function has been appropriately updated to accept a planName parameter, with a default value of "business" to maintain backward compatibility with existing code.

app/client/src/ce/pages/Upgrade/AuditLogsUpgradePage.tsx (2)

22-23: Good implementation of Redux hooks for feature flag.

Clean implementation of the necessary imports for Redux state management.


32-32: Correctly using selector hook to access feature flag.

The useSelector hook is properly used to access the AI agent feature flag state.

@ankitakinger ankitakinger merged commit 62bdd84 into release Apr 9, 2025
47 checks passed
@ankitakinger ankitakinger deleted the chore/update-audit-logs-feature-tag branch April 9, 2025 07:14
ankitakinger added a commit that referenced this pull request Apr 9, 2025
…#40185)

## Description

Adding AI agent feature flag check for audit logs upgrade page

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.Settings"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/14350813652>
> Commit: 89483c5
> Workflow: `PR Automation test suite`
> Tags: `@tag.Settings`
> Spec: ``
> <hr>Wed, 09 Apr 2025 06:49:26 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Upgrade messaging now dynamically reflects the selected
plan—displaying "business" or "enterprise" based on current settings.
- Enhanced audit log configurations incorporate an enterprise flag to
adjust messaging contextually.
- **Bug Fixes**
- Corrected text capitalization for clearer plan description in the
upgrade footer.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
…appsmithorg#40185)

## Description

Adding AI agent feature flag check for audit logs upgrade page

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.Settings"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/14350813652>
> Commit: 89483c5
> Workflow: `PR Automation test suite`
> Tags: `@tag.Settings`
> Spec: ``
> <hr>Wed, 09 Apr 2025 06:49:26 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Upgrade messaging now dynamically reflects the selected
plan—displaying "business" or "enterprise" based on current settings.
- Enhanced audit log configurations incorporate an enterprise flag to
adjust messaging contextually.
- **Bug Fixes**
- Corrected text capitalization for clearer plan description in the
upgrade footer.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants