Skip to content

chore: make branchName a query param in consolidated api#38851

Merged
dvj1988 merged 10 commits intoreleasefrom
chore/remove-branchname-header-consolidated-api
Jan 28, 2025
Merged

chore: make branchName a query param in consolidated api#38851
dvj1988 merged 10 commits intoreleasefrom
chore/remove-branchname-header-consolidated-api

Conversation

@dvj1988
Copy link

@dvj1988 dvj1988 commented Jan 27, 2025

Description

  • Move branchName header to branchName query param for consolidated api
  • Update the service worker prefetching logic to reflect the new url signature changes for consolidated api.

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/13005671168
Commit: 45b23c1
Cypress dashboard.
Tags: @tag.All
Spec:


Tue, 28 Jan 2025 08:54:43 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for branch-specific data retrieval across multiple components.
    • Enhanced API endpoint configuration to dynamically handle branch parameters.
  • Improvements

    • Refactored URL generation and parameter handling for more flexible API calls.
    • Updated server-side controllers to support branch-related query parameters.
  • Technical Updates

    • Modified several API and saga functions to include optional branch information.
    • Improved type safety and parameter management in consolidated API services.

@dvj1988 dvj1988 requested a review from a team as a code owner January 27, 2025 09:19
@dvj1988 dvj1988 requested review from rahulbarwal and removed request for a team January 27, 2025 09:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Warning

Rate limit exceeded

@dvj1988 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7a818ef and 45b23c1.

📒 Files selected for processing (2)
  • app/client/src/ce/sagas/PageSagas.tsx (1 hunks)
  • app/client/src/sagas/InitSagas.ts (2 hunks)

Walkthrough

This pull request introduces a branch parameter across various components of the application to enhance the fetching and handling of page resources in a branch-specific context. The changes include updates to interfaces, API methods, and sagas to accommodate this new parameter, allowing for more dynamic and context-aware resource retrieval, particularly in relation to Git operations.

Changes

File Change Summary
app/client/src/actions/pageActions.tsx Added branch property to FetchPublishedPageResourcesPayload interface.
app/client/src/api/services/ConsolidatedPageLoadApi/api.ts Updated API methods to use dynamic URL generation with ConsolidatedApiParams.
app/client/src/api/services/ConsolidatedPageLoadApi/types.ts Introduced new ConsolidatedApiParams type with optional applicationId, defaultPageId, and branchName.
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts Added ConsolidatedApiUtils class for URL generation with static methods.
app/client/src/ce/sagas/PageSagas.tsx Modified parameter handling in fetchPublishedPageResourcesSaga to include branch.
app/client/src/pages/AppViewer/index.tsx Updated fetchPublishedPageResources to include branch parameter in dispatch call.
app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ConsolidatedAPIController.java Changed request parameter sources from headers to query parameters for specific methods.
app/client/src/ce/utils/serviceWorkerUtils.ts Updated URL construction in getConsolidatedApiPrefetchRequest to include branchName.
app/client/src/ce/utils/serviceWorkerUtils.test.ts Adjusted test cases to reflect new URL structure with branchName.
app/client/src/sagas/InitSagas.ts Added optional branch parameter to getInitResponses function.

Possibly related PRs

Suggested Reviewers

  • ApekshaBhosale
  • rajatagrawal

Poem

🌿 Branches dancing in the code's embrace,
Queries flowing with newfound grace,
From headers to params, a subtle shift,
Bringing context, giving data a lift!
🚀 Git's whispers now clearly heard,
In every fetch, a branch-specific word!


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 Jan 27, 2025
@dvj1988
Copy link
Author

dvj1988 commented Jan 27, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (1)

4-20: Consider refactoring static-only class to functions.

While the implementation is clean, consider refactoring to standalone functions for better maintainability:

-export class ConsolidatedApiUtils {
-  private static BASE_URL = "v1/consolidated-api";
-  private static VIEW_URL = `${this.BASE_URL}/view`;
-  private static EDIT_URL = `${this.BASE_URL}/edit`;
-
-  static getViewUrl = (requestParams: ConsolidatedApiParams) => {
-    const queryParams = getQueryStringfromObject(requestParams);
-    return `${this.VIEW_URL}${queryParams}`;
-  };
-
-  static getEditUrl = (requestParams: ConsolidatedApiParams) => {
-    const queryParams = getQueryStringfromObject(requestParams);
-    return `${this.EDIT_URL}${queryParams}`;
-  };
-}
+const BASE_URL = "v1/consolidated-api";
+const VIEW_URL = `${BASE_URL}/view`;
+const EDIT_URL = `${BASE_URL}/edit`;
+
+export const getViewUrl = (requestParams: ConsolidatedApiParams) => {
+  const queryParams = getQueryStringfromObject(requestParams);
+  return `${VIEW_URL}${queryParams}`;
+};
+
+export const getEditUrl = (requestParams: ConsolidatedApiParams) => {
+  const queryParams = getQueryStringfromObject(requestParams);
+  return `${EDIT_URL}${queryParams}`;
+};
🧰 Tools
🪛 Biome (1.9.4)

[error] 4-20: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 56018b0 and edec5f9.

📒 Files selected for processing (9)
  • app/client/src/actions/pageActions.tsx (2 hunks)
  • app/client/src/api/services/ConsolidatedPageLoadApi/api.ts (1 hunks)
  • app/client/src/api/services/ConsolidatedPageLoadApi/types.ts (1 hunks)
  • app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (1 hunks)
  • app/client/src/ce/sagas/PageSagas.tsx (2 hunks)
  • app/client/src/ce/utils/serviceWorkerUtils.ts (2 hunks)
  • app/client/src/pages/AppViewer/index.tsx (1 hunks)
  • app/client/src/sagas/InitSagas.ts (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ConsolidatedAPIController.java (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts

[error] 4-20: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: server-spotless / spotless-check
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (15)
app/client/src/api/services/ConsolidatedPageLoadApi/types.ts (1)

1-5: LGTM! Clean interface definition.

The ConsolidatedApiParams interface properly defines the optional parameters needed for the consolidated API.

app/client/src/api/services/ConsolidatedPageLoadApi/api.ts (2)

6-11: LGTM! Clean implementation of view endpoint.

The implementation properly uses the new parameter interface and URL utilities.


14-19: LGTM! Clean implementation of edit endpoint.

The implementation mirrors the view endpoint pattern consistently.

app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ConsolidatedAPIController.java (2)

51-53: LGTM! Clean conversion of headers to query parameters.

The edit endpoint properly moves headers to query parameters with appropriate default values.


84-86: LGTM! Consistent parameter handling in view endpoint.

The view endpoint mirrors the edit endpoint's parameter handling pattern.

app/client/src/ce/utils/serviceWorkerUtils.ts (3)

13-13: LGTM! Good addition of ConsolidatedApiUtils import.

The import aligns with the goal of centralizing URL construction logic.


114-120: LGTM! Clean refactor of edit mode URL construction.

The change properly delegates URL construction to ConsolidatedApiUtils, removing direct URL manipulation.


127-133: LGTM! Clean refactor of view mode URL construction.

Similar to edit mode, the change properly delegates URL construction to ConsolidatedApiUtils.

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

169-169: LGTM! Proper addition of branch parameter.

The change correctly propagates the branch information to the resource fetching action.

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

224-224: LGTM! Clean interface update for branch support.

The function signature is properly updated to include the optional branch parameter.

Also applies to: 232-233


238-238: LGTM! Proper integration of branch parameter.

The branch parameter is correctly mapped to branchName in the params object.

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

76-76: LGTM! Clean interface update.

The interface is properly updated to include the branch property.


302-302: LGTM! Proper action creator update.

The action creator correctly includes the branch parameter in its payload.

Also applies to: 309-309

app/client/src/ce/sagas/PageSagas.tsx (2)

155-155: LGTM!

Clean import of required lodash utilities.


404-406: Verify branch parameter handling.

The code correctly handles the branch parameter by:

  1. Destructuring it from the payload
  2. Using pickBy to conditionally include it in the params
  3. Renaming it to branchName for API consistency

However, we should verify that all callers of this saga are updated to handle the new branch parameter.

@github-actions
Copy link

Failed server tests

  • com.appsmith.server.services.ce.ActionServiceCE_Test#moveAction_forGitConnectedApp_defaultResourceIdsUpdateSuccess

@dvj1988 dvj1988 force-pushed the chore/remove-branchname-header-consolidated-api branch from edec5f9 to 029a844 Compare January 27, 2025 10:41
@dvj1988
Copy link
Author

dvj1988 commented Jan 27, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@dvj1988 dvj1988 added the ok-to-test Required label for CI label Jan 27, 2025
@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 27, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 27, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 27, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (2)

5-8: Consider using a namespace or object with functions instead of a static-only class.

While the implementation is clean, we can improve it by following TypeScript best practices.

Consider this alternative approach:

-export class ConsolidatedApiUtils {
-  private static BASE_URL = "v1/consolidated-api";
-  private static VIEW_URL = `${this.BASE_URL}/view`;
-  private static EDIT_URL = `${this.BASE_URL}/edit`;
+export const ConsolidatedApiUtils = {
+  BASE_URL: "v1/consolidated-api",
+  VIEW_URL: "v1/consolidated-api/view",
+  EDIT_URL: "v1/consolidated-api/edit",
🧰 Tools
🪛 Biome (1.9.4)

[error] 5-25: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)


10-24: Consider reducing code duplication in URL generation methods.

Both methods share identical parameter handling logic.

Consider extracting the common logic:

+  private static createUrlWithParams(baseUrl: string, params: ConsolidatedApiParams) {
+    const queryParamsObject = pickBy(params, identity);
+    const queryParams = new URLSearchParams(queryParamsObject);
+    return `${baseUrl}?${queryParams}`;
+  }
+
-  static getViewUrl = (requestParams: ConsolidatedApiParams) => {
-    // Remove undefined values from the requestParams object
-    const queryParamsObject = pickBy(requestParams, identity);
-    const queryParams = new URLSearchParams(queryParamsObject);
-
-    return `${this.VIEW_URL}?${queryParams}`;
-  };
+  static getViewUrl = (params: ConsolidatedApiParams) => {
+    return this.createUrlWithParams(this.VIEW_URL, params);
+  };

-  static getEditUrl = (requestParams: ConsolidatedApiParams) => {
-    // Remove undefined values from the requestParams object
-    const queryParamsObject = pickBy(requestParams, identity);
-    const queryParams = new URLSearchParams(queryParamsObject);
-
-    return `${this.EDIT_URL}?${queryParams}`;
-  };
+  static getEditUrl = (params: ConsolidatedApiParams) => {
+    return this.createUrlWithParams(this.EDIT_URL, params);
+  };
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6ad31ee and 96a7249.

📒 Files selected for processing (2)
  • app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (1 hunks)
  • app/client/src/ce/utils/serviceWorkerUtils.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/ce/utils/serviceWorkerUtils.ts
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts

[error] 5-25: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: server-spotless / spotless-check
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (1)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (1)

1-3: LGTM! Clean imports using specific lodash utilities.

The imports are well-organized and use specific lodash utility imports instead of importing the entire library.

@github-actions
Copy link

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/api/services/ConsolidatedPageLoadApi/url.ts (2)

5-8: Consider converting static class to pure functions.

The class contains only static members which can be simplified to pure functions for better maintainability and reduced complexity.

Consider this alternative implementation:

-export class ConsolidatedApiUtils {
-  private static BASE_URL = "v1/consolidated-api";
-  private static VIEW_URL = `${this.BASE_URL}/view`;
-  private static EDIT_URL = `${this.BASE_URL}/edit`;

+const BASE_URL = "v1/consolidated-api";
+const VIEW_URL = `${BASE_URL}/view`;
+const EDIT_URL = `${BASE_URL}/edit`;
🧰 Tools
🪛 Biome (1.9.4)

[error] 5-25: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)


10-24: Extract common URL generation logic to reduce duplication.

Both methods share identical parameter processing logic. Consider extracting it to a shared utility function.

Here's a suggested implementation:

+const generateUrlWithParams = (baseUrl: string, params: ConsolidatedApiParams) => {
+  const queryParamsObject = pickBy(params, identity);
+  const queryParamsString = new URLSearchParams(queryParamsObject).toString();
+  return `${baseUrl}?${queryParamsString}`;
+};

-static getViewUrl = (requestParams: ConsolidatedApiParams) => {
-  const queryParamsObject = pickBy(requestParams, identity);
-  const queryParamsString = new URLSearchParams(queryParamsObject).toString();
-  return `${this.VIEW_URL}?${queryParamsString}`;
-};
+static getViewUrl = (requestParams: ConsolidatedApiParams) => 
+  generateUrlWithParams(this.VIEW_URL, requestParams);

-static getEditUrl = (requestParams: ConsolidatedApiParams) => {
-  const queryParamsObject = pickBy(requestParams, identity);
-  const queryParamsString = new URLSearchParams(queryParamsObject).toString();
-  return `${this.EDIT_URL}?${queryParamsString}`;
-};
+static getEditUrl = (requestParams: ConsolidatedApiParams) =>
+  generateUrlWithParams(this.EDIT_URL, requestParams);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 96a7249 and 869ecd6.

📒 Files selected for processing (2)
  • app/client/src/api/services/ConsolidatedPageLoadApi/types.ts (1 hunks)
  • app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/api/services/ConsolidatedPageLoadApi/types.ts
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts

[error] 5-25: Avoid classes that contain only static members.

Prefer using simple functions instead of classes with only static members.

(lint/complexity/noStaticOnlyClass)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: server-spotless / spotless-check
🔇 Additional comments (2)
app/client/src/api/services/ConsolidatedPageLoadApi/url.ts (2)

1-3: LGTM! Good use of specific lodash imports.

The selective imports from lodash will help with tree-shaking and bundle size optimization.


10-24: Headers are still being added through API interceptors

The consolidated API endpoints are still using the core API instance which adds headers through interceptors.

#!/bin/bash
# Check the API interceptor implementation
rg -l "apiRequestInterceptor" app/client/src/api
cat $(rg -l "apiRequestInterceptor" app/client/src/api)

@dvj1988
Copy link
Author

dvj1988 commented Jan 28, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
app/client/src/ce/utils/serviceWorkerUtils.test.ts (1)

473-482: Simplify request key test case.

The test case can be made more concise by combining the URL and method declarations.

-        const url =
-          "https://app.appsmith.com/api/v1/consolidated-api/edit?defaultPageId=page123&applicationId=app123&branchName=main";
-        const method = "GET";
-        const request = new Request(url, {
-          method,
-        });
+        const request = new Request(
+          "https://app.appsmith.com/api/v1/consolidated-api/edit?defaultPageId=page123&applicationId=app123&branchName=main",
+          { method: "GET" }
+        );
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 869ecd6 and 7a818ef.

📒 Files selected for processing (2)
  • app/client/src/ce/utils/serviceWorkerUtils.test.ts (6 hunks)
  • app/client/src/ce/utils/serviceWorkerUtils.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/ce/utils/serviceWorkerUtils.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: server-spotless / spotless-check
🔇 Additional comments (5)
app/client/src/ce/utils/serviceWorkerUtils.test.ts (5)

353-353: LGTM! URL construction for EDIT mode with applicationId.

The test correctly verifies the consolidated API URL construction with branch name as a query parameter.


371-371: LGTM! URL construction for PUBLISHED mode with applicationId.

The test correctly verifies the consolidated API URL construction with branch name as a query parameter.


388-388: LGTM! URL construction for EDIT mode without applicationId.

The test correctly verifies the consolidated API URL construction with branch name as a query parameter.


405-405: LGTM! URL construction for PUBLISHED mode without applicationId.

The test correctly verifies the consolidated API URL construction with branch name as a query parameter.


437-437: LGTM! URL construction in getPrefetchRequests.

The test correctly verifies the consolidated API URL construction with branch name as a query parameter.

@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 28, 2025

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@dvj1988 dvj1988 changed the title chore: remove request headers from consolidated api chore: make branchName a query params in consolidated api Jan 28, 2025
@dvj1988 dvj1988 changed the title chore: make branchName a query params in consolidated api chore: make branchName a query param in consolidated api Jan 28, 2025
@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 28, 2025

@dvj1988 dvj1988 requested a review from rajatagrawal January 28, 2025 09:14
@brayn003
Copy link
Contributor

Have you tried manually testing this?

@brayn003
Copy link
Contributor

/build-deploy-preview

@github-actions
Copy link

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

@dvj1988
Copy link
Author

dvj1988 commented Jan 28, 2025

Have you tried manually testing this?

@brayn003 Yes I have on both CE and EE.

CE DP: https://ce-38851.dp.appsmith.com/
EE DP: https://ee-6024.dp.appsmith.com/

@dvj1988
Copy link
Author

dvj1988 commented Jan 28, 2025

/build-deploy-preview

@brayn003 I am cancelling this run because the DP is already up to date with the latest changes.

@brayn003
Copy link
Contributor

LGTM

@dvj1988 dvj1988 merged commit 9d1f515 into release Jan 28, 2025
88 checks passed
@dvj1988 dvj1988 deleted the chore/remove-branchname-header-consolidated-api branch January 28, 2025 10:35
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
…#38851)

## Description
- Move `branchName` header to `branchName` query param for consolidated
api
- Update the service worker prefetching logic to reflect the new url
signature changes for consolidated api.

## Automation

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

### 🔍 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/13005671168>
> Commit: 45b23c1
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13005671168&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 28 Jan 2025 08:54:43 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

## Release Notes

- **New Features**
- Added support for branch-specific data retrieval across multiple
components.
- Enhanced API endpoint configuration to dynamically handle branch
parameters.

- **Improvements**
- Refactored URL generation and parameter handling for more flexible API
calls.
- Updated server-side controllers to support branch-related query
parameters.

- **Technical Updates**
- Modified several API and saga functions to include optional branch
information.
- Improved type safety and parameter management in consolidated API
services.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
…#38851)

## Description
- Move `branchName` header to `branchName` query param for consolidated
api
- Update the service worker prefetching logic to reflect the new url
signature changes for consolidated api.

## Automation

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

### 🔍 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/13005671168>
> Commit: 45b23c1
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13005671168&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 28 Jan 2025 08:54:43 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

## Release Notes

- **New Features**
- Added support for branch-specific data retrieval across multiple
components.
- Enhanced API endpoint configuration to dynamically handle branch
parameters.

- **Improvements**
- Refactored URL generation and parameter handling for more flexible API
calls.
- Updated server-side controllers to support branch-related query
parameters.

- **Technical Updates**
- Modified several API and saga functions to include optional branch
information.
- Improved type safety and parameter management in consolidated API
services.
<!-- 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