-
Notifications
You must be signed in to change notification settings - Fork 4.1k
chore: Hiding git author settings for AI instances #40210
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 update in the AdminSettings Profile introduces a new selector, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ProfileComponent
participant Selector
User->>ProfileComponent: Load profile page
ProfileComponent->>Selector: getIsAiAgentFlowEnabled()
Selector-->>ProfileComponent: Return AI agent flow state (boolean)
ProfileComponent->>ProfileComponent: Conditionally render "Git author" section
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 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
🧹 Nitpick comments (2)
app/client/src/pages/AdminSettings/Profile/index.tsx (2)
280-322
: Consider refactoring conditional rendering.The Git author section uses two separate conditionals for the heading and form fields. Consider wrapping both in a single conditional to improve code maintainability.
-{!isAIAgentFlowEnabled && ( - <SubCategory kind="heading-s" renderAs="p"> - Git author - </SubCategory> -)} -{!isAIAgentFlowEnabled && ( - <Flex flexDirection="column" gap="spaces-5"> - <FieldWrapper> - {isFetching && <Loader className={Classes.SKELETON} />} - {!isFetching && ( - <Input - data-testid="t--git-author-name" - isRequired - label={createMessage(AUTHOR_NAME)} - labelPosition="top" - onChange={setAuthorNameInState} - placeholder={createMessage(AUTHOR_NAME)} - renderAs="input" - size="md" - type="text" - value={authorName} - /> - )} - </FieldWrapper> - <FieldWrapper> - {isFetching && <Loader className={Classes.SKELETON} />} - {!isFetching && ( - <Input - data-testid="t--git-author-email" - isRequired - label={createMessage(AUTHOR_EMAIL)} - labelPosition="top" - onChange={setAuthorEmailInState} - placeholder={createMessage(AUTHOR_EMAIL)} - renderAs="input" - size="md" - type="text" - value={authorEmail} - /> - )} - </FieldWrapper> - </Flex> -)} +{!isAIAgentFlowEnabled && ( + <> + <SubCategory kind="heading-s" renderAs="p"> + Git author + </SubCategory> + <Flex flexDirection="column" gap="spaces-5"> + <FieldWrapper> + {isFetching && <Loader className={Classes.SKELETON} />} + {!isFetching && ( + <Input + data-testid="t--git-author-name" + isRequired + label={createMessage(AUTHOR_NAME)} + labelPosition="top" + onChange={setAuthorNameInState} + placeholder={createMessage(AUTHOR_NAME)} + renderAs="input" + size="md" + type="text" + value={authorName} + /> + )} + </FieldWrapper> + <FieldWrapper> + {isFetching && <Loader className={Classes.SKELETON} />} + {!isFetching && ( + <Input + data-testid="t--git-author-email" + isRequired + label={createMessage(AUTHOR_EMAIL)} + labelPosition="top" + onChange={setAuthorEmailInState} + placeholder={createMessage(AUTHOR_EMAIL)} + renderAs="input" + size="md" + type="text" + value={authorEmail} + /> + )} + </FieldWrapper> + </Flex> + </> +)}
131-146
: Consider adding AI agent flow checks in Git author update/save functions.While the UI elements are hidden, the code still maintains the state for Git author fields and might attempt to update them. Consider adding checks in
updateConfig
,onSave
, andonClear
functions to prevent unnecessary Git author operations when dealing with AI agents.const updateConfig = () => { + if (isAIAgentFlowEnabled) return; if (authorName && authorEmail && emailValidator(authorEmail).isValid) { // Existing code } }; const onSave = () => { if (user?.name !== name) { setIsSaving(true); saveName(); } + if (!isAIAgentFlowEnabled && (gitConfig?.authorName !== authorName || gitConfig?.authorEmail !== authorEmail) ) { setIsSaving(true); updateConfig(); } }; const onClear = () => { setName(user?.name || ""); + if (!isAIAgentFlowEnabled) { setAuthorNameInState(gitConfig?.authorName); setAuthorEmailInState(gitConfig?.authorEmail); + } setAreFormValuesUpdated(false); };Also applies to: 180-193, 195-200
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/pages/AdminSettings/Profile/index.tsx
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-build / client-build
🔇 Additional comments (4)
app/client/src/pages/AdminSettings/Profile/index.tsx (4)
53-53
: Import for new AI agent flow selector added correctly.The new import for
getIsAiAgentFlowEnabled
is appropriately added to determine if the AI agent flow is enabled.
98-98
: State variable for AI agent flow correctly implemented.The selector is properly used to create a state variable that will control the conditional rendering of the Git author section.
280-284
: Git author heading is properly hidden for AI agents.The heading section is correctly wrapped in a conditional that checks
isAIAgentFlowEnabled
.
285-322
: Git author form fields properly hidden for AI agents.The implementation correctly hides the Git author form fields when an AI agent flow is enabled.
## Description Hiding git author settings for AI instances 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 --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14375296937> > Commit: 4ef0db7 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14375296937&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Settings` > Spec: > <hr>Thu, 10 Apr 2025 08:21:57 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** - Streamlined the Profile settings by conditionally displaying the Git author section. When AI agent functionality is enabled, the Git author inputs and heading are no longer visible, reducing clutter in the interface. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Hiding git author settings for AI instances as workflows is no longer supported on those instances and so in turn Git is not supported.
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/14375296937
Commit: 4ef0db7
Cypress dashboard.
Tags:
@tag.Settings
Spec:
Thu, 10 Apr 2025 08:21:57 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit