Skip to content
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

feat: adding current env name to the appsmith context #38894

Open
wants to merge 4 commits into
base: release
Choose a base branch
from

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Jan 29, 2025

Description

Add current environment name to appsmith context object

Fixes #38306
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.JS"

🔍 Cypress test results

Important

🟣 🟣 🟣 Your tests are running.
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13107856659
Commit: 348255d
Workflow: PR Automation test suite
Tags: @tag.JS
Spec: ``


Mon, 03 Feb 2025 06:41:55 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Added currentEnvironmentName property to the Appsmith entity data structure
    • Enhanced data tree selectors to support current environment information
  • Refactor

    • Updated data tree selector methods to incorporate environment name
    • Standardized key extraction method for internal keywords

Copy link
Contributor

coderabbitai bot commented Jan 29, 2025

Walkthrough

This pull request introduces the currentEnvironmentName property to the AppsmithEntity interface, enabling developers to access the current environment name within the Appsmith context object. The changes span multiple files, primarily focusing on selector functions and type definitions to integrate this new property seamlessly into the existing data tree structure.

Changes

File Change Summary
app/client/src/ce/entities/DataTree/types.ts Added currentEnvironmentName: string to AppsmithEntity interface
app/client/src/ce/selectors/dataTreeCyclicSelectors.ts Added getCurrentEnvironmentName() function returning an empty string
app/client/src/ce/selectors/environmentSelectors.tsx Imported getCurrentEnvironmentName from ee/selectors/dataTreeCyclicSelectors
app/client/src/ee/selectors/dataTreeCyclicSelectors.ts Re-exported all entities from ce/selectors/dataTreeCyclicSelectors
app/client/src/selectors/dataTreeSelectors.ts Updated selectors to include currentEnvironmentName

Assessment against linked issues

Objective Addressed Explanation
Add current env name to Appsmith context

Possibly related PRs

Suggested labels

Enhancement, JS Evaluation, Query & JS Pod, ok-to-test

Suggested reviewers

  • ApekshaBhosale

Poem

In the realm of code, a whisper grows,
Environment's name, now softly shows
A context rich, with secrets untold
Where dev and prod their stories unfold 🌐✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 754d3ef and 6335442.

📒 Files selected for processing (5)
  • app/client/src/ce/entities/DataTree/types.ts (1 hunks)
  • app/client/src/ce/selectors/dataTreeCyclicSelectors.ts (1 hunks)
  • app/client/src/ce/selectors/environmentSelectors.tsx (1 hunks)
  • app/client/src/ee/selectors/dataTreeCyclicSelectors.ts (1 hunks)
  • app/client/src/selectors/dataTreeSelectors.ts (5 hunks)
✅ Files skipped from review due to trivial changes (2)
  • app/client/src/ee/selectors/dataTreeCyclicSelectors.ts
  • app/client/src/ce/selectors/dataTreeCyclicSelectors.ts
⏰ 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-unit-tests / client-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (5)
app/client/src/ce/selectors/environmentSelectors.tsx (1)

5-5: Verify circular dependencies with the new import.

The import from ee/selectors/dataTreeCyclicSelectors could potentially create circular dependencies. Please ensure that the dependency graph remains acyclic.

app/client/src/ce/entities/DataTree/types.ts (1)

196-196: LGTM! Type-safe addition of environment name.

The new property is properly typed and well-placed within the interface.

app/client/src/selectors/dataTreeSelectors.ts (3)

47-48: LGTM! Clean import additions.

The imports are properly organized and the utility function import will help with type safety.


157-157: LGTM! Proper integration of environment name.

The environment name is correctly integrated into the selector chain and data tree construction.

Also applies to: 168-168, 190-190


233-233: Good type-safety improvement.

Replacing Object.keys with objectKeys utility function improves type safety.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ 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. (Beta)
  • @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.

@github-actions github-actions bot added Enhancement New feature or request Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets labels Jan 29, 2025
@AmanAgarwal041 AmanAgarwal041 added the ok-to-test Required label for CI label Jan 29, 2025
@github-actions github-actions bot added Bug Something isn't working Enhancement New feature or request and removed Enhancement New feature or request labels Jan 29, 2025
@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@AmanAgarwal041 AmanAgarwal041 changed the title fix: adding current env name to the appsmith context feat: adding current env name to the appsmith context Jan 29, 2025
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13029574204.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38894.
recreate: .

@github-actions github-actions bot removed the Bug Something isn't working label Jan 29, 2025
@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13030444249.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38894.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-38894.dp.appsmith.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request ok-to-test Required label for CI Query & Widgets Pod All issues related to Query, JS, Eval, and Widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: add current env name to the appsmith context object
2 participants