Skip to content

Conversation

@yatinappsmith
Copy link
Contributor

@yatinappsmith yatinappsmith commented Jun 5, 2025

This pull request contains the daily promotion from the release branch to the master branch.

Warning

Tests have not run on the HEAD 9ae1eb9 yet


Thu, 05 Jun 2025 06:22:03 UTC

jacquesikot and others added 2 commits June 4, 2025 06:02
…loud billing domains (#40855)

## Problem

With the introduction of cloud billing and multi-organization support,
users can now access Appsmith through organization-specific subdomains
(e.g., `testorg.appsmith.com`). However, when users attempt to access
non-existent domains (e.g., `domaindoesnotexist.appsmith.com`), the
system fails to return a user object, causing the application to get
stuck in an infinite loading state.

## 🔍 Root Cause

The issue was in the `LandingScreen` component's conditional logic:

```tsx
// Previous implementation ❌
if (props.user && window.location.pathname === BASE_URL) {
  if (props.user.email === ANONYMOUS_USERNAME) {
    return <Redirect to={AUTH_LOGIN_URL} />;
  } else {
    return <Redirect to={APPLICATIONS_URL} />;
  }
}
```

**The problem:** When accessing a non-existent domain, `props.user` is
`null`/`undefined`, causing the condition `props.user &&
window.location.pathname === BASE_URL` to evaluate to `false`. This
prevented the redirect logic from executing, leaving users on a
perpetual loading screen instead of being properly redirected to the
login page.

## ✅ Solution

Updated the conditional logic to handle cases where the user object is
undefined:

```tsx
// Fixed implementation ✅
if (window.location.pathname === BASE_URL) {
  if (!props.user || props.user.email === ANONYMOUS_USERNAME) {
    return <Redirect to={AUTH_LOGIN_URL} />;
  } else {
    return <Redirect to={APPLICATIONS_URL} />;
  }
}
```

### Key changes:
1. **Removed the `props.user &&` guard condition** - Now the redirect
logic always executes when on the base URL
2. **Added explicit null/undefined check** - The condition `!props.user
|| props.user.email === ANONYMOUS_USERNAME` properly handles both
scenarios:
   - When no user object exists (non-existent domains)
   - When the user is anonymous

## 📊 Impact

| Scenario | Before | After |
|----------|---------|-------|
| Valid org domain + authenticated user | ✅ Redirects to applications |
✅ Redirects to applications |
| Valid org domain + anonymous user | ✅ Redirects to login | ✅ Redirects
to login |
| **Non-existent org domain** | ❌ **Infinite loading screen** | ✅
**Redirects to login** |
| Direct access to login URL | ✅ Works as expected | ✅ Works as expected
|

## 🧪 Testing Scenarios

This fix addresses the following scenarios in the cloud billing
multi-org environment:

- [x] Valid organization domain with authenticated user → Redirects to
applications
- [x] Valid organization domain with anonymous user → Redirects to login
- [x] **Non-existent organization domain → Redirects to login (instead
of infinite loading)**
- [x] Direct access to login URL → Works as expected

## Automation

/ok-to-test tags="@tag.Authentication, @tag.Sanity"

### 🔍 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/15438685266>
> Commit: afee6b1
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=15438685266&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Authentication, @tag.Sanity`
> Spec:
> <hr>Wed, 04 Jun 2025 10:09:08 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

- **Bug Fixes**
- Improved user redirection on the landing screen to ensure users are
correctly routed based on their authentication status.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description

Requires: #40642

Adds an environment variable activating nss_wrapper when the
`securityPolicy.runAsUser` value is set so the UID can be set
dynamically. This avoids the `I have no name!` in the prompt when doing
a `kubectl exec` with that value set.

I am also introducing
[helm-unittest](https://github.com/helm-unittest/helm-unittest) for
ensuring that changes to our defaults are made explicit.

Fixes #38787

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Tests have not run on the HEAD
d30d87f yet
> <hr>Mon, 19 May 2025 18:59:10 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**
- Added automated unit testing for Helm charts, including snapshot and
security context tests.
- Introduced documentation for running and understanding Helm chart unit
tests.
- Added a GitHub Actions workflow to run Helm chart unit tests on pull
requests and manually.
- **Bug Fixes**
- Ensured the LD_PRELOAD environment variable is set when a specific
security context is configured in deployments.
- **Documentation**
- Updated Helm chart README to reference new testing documentation and
improve clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Goutham Pratapa <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • pg
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate sequence diagram to generate a sequence diagram of the changes in this 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.

@btsgh btsgh requested a review from RakshaKShetty June 5, 2025 06:12
…40873)

Updated the chart version from 3.6.2 to 3.6.3 in the Helm test snapshots
to reflect the latest changes and ensure consistency across deployments.

## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


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=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


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

@RakshaKShetty RakshaKShetty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@btsgh btsgh merged commit 996ad8c into master Jun 5, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants