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

chore: add packagePullStatus to consolidated API #38179

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

ashit-rath
Copy link
Contributor

@ashit-rath ashit-rath commented Dec 16, 2024

Description

This is a refactor PR to support auto pull of packages on page load.

  1. adds an additional property on the consolidated API which reflects if the application needs to upgrade it's packages (packagePullStatus)
  2. A scaffold component to be extended in EE to show the package pull status as it's called in parallel to consolidated API and is non-blocking to the app's first page load

Not this is only relevant to the edit mode of the application

PR for https://github.com/appsmithorg/appsmith-ee/pull/5745

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12349195312
Commit: 9112f8a
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 16 Dec 2024 12:30:28 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Introduced a new PackageUpgradeStatus component for future use.
    • Added a new enumeration PACKAGE_PULL_STATUS with status constants.
  • Enhancements
    • Updated setupPageAction to accept additional parameters for improved data handling.
    • Enhanced error handling and logic in methods related to loading application data and managing plugins.
  • Bug Fixes
    • Adjusted the argument structure for the setupPage method to ensure compatibility with updated action handling.
  • Documentation
    • Updated interfaces and method signatures to reflect new parameters and structures.

Copy link
Contributor

coderabbitai bot commented Dec 16, 2024

Walkthrough

This pull request introduces a new mechanism for tracking package upgrade status across the Appsmith application. The changes primarily focus on adding a packagePullStatus field to various components, including the consolidated API, page actions, and bottom bar. A new PACKAGE_PULL_STATUS enum is created to represent different upgrade states (UPGRADABLE, UPGRADED, UPGRADING), enabling more granular tracking of package synchronization processes.

Changes

File Change Summary
app/client/src/actions/pageActions.tsx Updated setupPageAction to accept new packagePullStatus parameter
app/client/src/ce/components/BottomBar/PackageUpgradeStatus.tsx Created new component (currently returning null)
app/client/src/ce/constants/ModuleConstants.ts Added PACKAGE_PULL_STATUS enum
app/client/src/components/BottomBar/index.tsx Added PackageUpgradeStatus component to rendering
app/client/src/entities/Engine/AppEditorEngine.ts Modified loadPageThemesAndActions to include packagePullStatus
app/client/src/pages/Editor/index.tsx Updated mapDispatchToProps to pass object to setupPageAction
app/client/src/sagas/InitSagas.ts Added packagePullStatus to EditConsolidatedApi interface

Possibly related issues

Possibly related PRs

Suggested labels

Integrations Product, Integrations Pod General, QA

Suggested reviewers

  • ayushpahwa
  • sneha122

Poem

🚀 Packages dance, status in hand,
Upgrades flow across the land
Bits and bytes in smooth transition
Code evolves with new precision
Synchronization's sweet refrain! 🔄

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request.


📜 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 e2916b2 and 9112f8a.

📒 Files selected for processing (8)
  • app/client/src/actions/pageActions.tsx (2 hunks)
  • app/client/src/ce/components/BottomBar/PackageUpgradeStatus.tsx (1 hunks)
  • app/client/src/ce/constants/ModuleConstants.ts (1 hunks)
  • app/client/src/components/BottomBar/index.tsx (2 hunks)
  • app/client/src/ee/components/BottomBar/PackageUpgradeStatus.tsx (1 hunks)
  • app/client/src/entities/Engine/AppEditorEngine.ts (1 hunks)
  • app/client/src/pages/Editor/index.tsx (1 hunks)
  • app/client/src/sagas/InitSagas.ts (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • app/client/src/ce/components/BottomBar/PackageUpgradeStatus.tsx
  • app/client/src/ee/components/BottomBar/PackageUpgradeStatus.tsx
🔇 Additional comments (9)
app/client/src/entities/Engine/AppEditorEngine.ts (2)

127-127: Destructuring packagePullStatus

Destructuring packagePullStatus from allResponses is appropriate.


134-139: Including packagePullStatus in setupPageAction

Passing packagePullStatus to setupPageAction aligns with the updated action parameters.

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

36-40: Addition of PACKAGE_PULL_STATUS enum

The PACKAGE_PULL_STATUS enum is well-defined and correctly added.

app/client/src/components/BottomBar/index.tsx (2)

18-18: Importing PackageUpgradeStatus component

The import statement for PackageUpgradeStatus is correctly added.


48-48: Rendering PackageUpgradeStatus component

Rendering <PackageUpgradeStatus /> within the BottomBar component is appropriate.

app/client/src/pages/Editor/index.tsx (1)

244-244: Updating setupPage dispatch to match new action signature

Passing an object with id to setupPageAction aligns with the updated function parameters.

app/client/src/sagas/InitSagas.ts (1)

93-93: LGTM: Clean interface extension

The addition of packagePullStatus to track package upgrade states is well-typed and consistently integrated with the existing API response structure.

Also applies to: 137-137

app/client/src/actions/pageActions.tsx (2)

34-35: LGTM: Well-structured action creator refactor

The refactoring of setupPageAction to use object destructuring improves maintainability and the new packagePullStatus field is properly typed. The changes align well with the PR's objective of supporting automatic package pulling.

Also applies to: 662-662, 665-676


665-670: Verify all callers of setupPageAction are updated

The function signature has changed from positional parameters to object destructuring. Let's verify all callers have been updated to use the new signature.

✅ Verification successful

All callers of setupPageAction are using the new object parameter signature

The verification shows that both callers in the codebase are already using the new object parameter syntax:

  • app/client/src/pages/Editor/index.tsx uses setupPageAction({ id: pageId })
  • app/client/src/entities/Engine/AppEditorEngine.ts uses setupPageAction({ id: toLoadPageId, isFirstLoad: true })
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for all calls to setupPageAction to verify they use the new signature
rg -A 2 "setupPageAction\(" 

Length of output: 608


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 the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 16, 2024
@ashit-rath ashit-rath added the ok-to-test Required label for CI label Dec 16, 2024
@ashit-rath ashit-rath marked this pull request as ready for review December 16, 2024 12:37
@ashit-rath ashit-rath self-assigned this Dec 16, 2024
Comment on lines +134 to +138
setupPageAction({
id: toLoadPageId,
isFirstLoad: true,
pageWithMigratedDsl,
packagePullStatus,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you share the EE pr with me @ashit-rath .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ashit-rath
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

@ashit-rath
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

1 similar comment
Copy link

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

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