Skip to content

chore: Update instance variables via organization config update#39856

Merged
abhvsn merged 2 commits intoreleasefrom
chore/update-instance-vars-via-org-config
Mar 24, 2025
Merged

chore: Update instance variables via organization config update#39856
abhvsn merged 2 commits intoreleasefrom
chore/update-instance-vars-via-org-config

Conversation

@abhvsn
Copy link
Contributor

@abhvsn abhvsn commented Mar 21, 2025

Description

Changes made in this PR are temporary and will be removed once we have seperate API to fetch instance config. This is just to enable the skipped tests theappsmith.slack.com/archives/C0134BAVDB4/p1742273278029189.

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.

/test Settings

🔍 Cypress test results

Tip

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


Fri, 21 Mar 2025 12:22:32 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced organization settings management with streamlined instance variable updates.
  • Bug Fixes
    • Improved email verification handling to ensure robust, null-safe behavior.
  • Refactor
    • Optimized workflows for updating organization configurations for more immediate and consistent updates.
  • Tests
    • Updated test routines to validate the refined configuration and email verification processes.

@abhvsn abhvsn requested a review from sharat87 as a code owner March 21, 2025 11:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2025

Walkthrough

The changes adjust how organization configuration values are handled. Key fields in the configuration class are now marked as transient to avoid persistence, and the boolean getter for email verification has been replaced with a standard getter. New helper methods have been added to manage instance variables, and method signatures for updating these variables have been updated from a JSONObject to a Map. Minor logic improvements in null handling and operation sequencing have also been introduced in both service and test classes.

Changes

File(s) Change Summary
app/.../OrganizationConfigurationCE.java Added @Transient to googleMapsKey, instanceName, and emailVerificationEnabled; removed isEmailVerificationEnabled(); updated copyNonSensitiveValues to use getEmailVerificationEnabled().
app/.../InstanceVariablesHelperCE.java Added new methods: populateOrgConfigWithInstanceVariables, updateInstanceVariables, and updateAllowedInstanceVariables to manage instance variables in organization configurations.
app/.../Migration069MigrateOrganizationConfigToInstanceConfig.java Changed the retrieval of emailVerificationEnabled from isEmailVerificationEnabled() to getEmailVerificationEnabled() in the migration logic.
app/.../ConfigServiceCE.java
app/.../ConfigServiceCEImpl.java
Updated updateInstanceVariables signature from accepting JSONObject to Map<String, Object>; removed permission check in the implementation with a note to add it post-migration.
app/.../OrganizationServiceCEImpl.java Enhanced null safety using Boolean.TRUE.equals(getEmailVerificationEnabled()); chained a call to update instance variables post-DB update; refactored organization configuration retrieval to use instance variables.
app/.../OrganizationServiceCETest.java Injected dependency on ConfigService and updated test setup to call updateInstanceVariables; modified assertions to call getEmailVerificationEnabled() instead of isEmailVerificationEnabled().

Possibly related PRs

Suggested labels

Enhancement, Bug

Suggested reviewers

  • nidhi-nair
  • sharat87

Poem

In code we trust, where fields transcend,
Transient markers guide as old ways end.
New methods spark a brighter design,
Instance updates in a smooth pipeline.
A little magic in each line—happy coding shine!
🚀✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between f2f8960 and 648757f.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration069MigrateOrganizationConfigToInstanceConfig.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/db/ce/Migration069MigrateOrganizationConfigToInstanceConfig.java
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • 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: server-spotless / spotless-check
  • GitHub Check: server-unit-tests / server-unit-tests

🪧 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 resolve resolve all the CodeRabbit review comments.
  • @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.

@abhvsn abhvsn added the ok-to-test Required label for CI label Mar 21, 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 Mar 21, 2025
@abhvsn abhvsn requested a review from trishaanand March 21, 2025 12:20
@github-actions
Copy link

Failed server tests

  • com.appsmith.server.git.ServerSchemaMigrationEnforcerTest#saveGitRepo_ImportAndThenExport_diffOccurs

@abhvsn abhvsn merged commit 5c05624 into release Mar 24, 2025
47 checks passed
@abhvsn abhvsn deleted the chore/update-instance-vars-via-org-config branch March 24, 2025 05:33
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
…mithorg#39856)

## Description
Changes made in this PR are temporary and will be removed once we have
seperate API to fetch instance config. This is just to enable the
skipped tests
[theappsmith.slack.com/archives/C0134BAVDB4/p1742273278029189](https://theappsmith.slack.com/archives/C0134BAVDB4/p1742273278029189).

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

/test 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/13991283921>
> Commit: 648757f
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13991283921&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Settings`
> Spec:
> <hr>Fri, 21 Mar 2025 12:22:32 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**
- Enhanced organization settings management with streamlined instance
variable updates.
- **Bug Fixes**
- Improved email verification handling to ensure robust, null-safe
behavior.
- **Refactor**
- Optimized workflows for updating organization configurations for more
immediate and consistent updates.
- **Tests**
- Updated test routines to validate the refined configuration and email
verification processes.
<!-- 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