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: added classes for ce and ee spans #34484

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

NilanshBansal
Copy link
Contributor

@NilanshBansal NilanshBansal commented Jun 26, 2024

Description

The spans directory currently did not have a way to add EE-specific spans.
SCR-20240626-j4l

This PR fixes the span directory to add ce and ee spans support.

Fixes #34483

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9676199406
Commit: 45830b0
Cypress dashboard.
Tags: @tag.Sanity

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor

    • Improved code structure by extending specialized classes (ActionSpanCE, DatasourceSpanCE, TenantSpanCE) for ActionSpan, DatasourceSpan, and TenantSpan.
  • New Features

    • Introduced new constants for tracing various action executions and data fetching related to datasources and tenants.

Copy link
Contributor

coderabbitai bot commented Jun 26, 2024

Walkthrough

The refactoring tasks involve reorganizing span-related classes in the Appsmith codebase, following a cleaner structure where common spans are defined in new CE (Community Edition) classes, with their corresponding non-CE classes extending them. This change enables easier inclusion of Enterprise Edition (EE) specific spans without cluttering the CE codebase.

Changes

Files/Groups of Files Change Summary
.../appsmith-interfaces/.../ActionSpan.java, .../DatasourceSpan.java, .../TenantSpan.java Updated these classes to extend their respective CE counterparts instead of directly defining static final string constants.
.../appsmith-interfaces/.../ce/ActionSpanCE.java, .../DatasourceSpanCE.java, .../TenantSpanCE.java Introduced new CE classes that define the constants previously present in the now refactored classes to make it easier to add EE-specific spans.

Sequence Diagram(s)

No sequence diagrams necessary as the changes are structural and do not modify control flows.

Assessment against linked issues

Objective Addressed Explanation
Folder structure CE & EE correction for Span Files (#34483)
Ensures spans for EE can be added without cluttering the CE codebase (#34483)
Implement refactoring to extend CE classes in relevant span classes as described in #34483

Poem

In the code where spans now blend,
CE and EE find their mend.
Constants once, now shared with grace,
Elegance in structure takes its place.
EE grows with ease, spans unfurled,
In Appsmith, a neater world. 🌐✨

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 Integrations Product Issues related to a specific integration Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Task A simple Todo skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels Jun 26, 2024
@NilanshBansal NilanshBansal added the ok-to-test Required label for CI label Jun 26, 2024
@@ -1,23 +1,9 @@
package com.appsmith.external.constants.spans;

import static com.appsmith.external.constants.spans.BaseSpan.APPSMITH_SPAN_PREFIX;
import com.appsmith.external.constants.spans.ce.ActionSpanCE;

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

This could also be copied to CE classes, please make sure it's consistent across.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9c16e4f and 45830b0.

Files selected for processing (6)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ActionSpan.java (1 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/DatasourceSpan.java (1 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/TenantSpan.java (1 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/ActionSpanCE.java (1 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/DatasourceSpanCE.java (1 hunks)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/TenantSpanCE.java (1 hunks)
Files skipped from review due to trivial changes (3)
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ActionSpan.java
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/ActionSpanCE.java
  • app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/TenantSpanCE.java
Additional comments not posted (3)
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/TenantSpan.java (1)

3-3: Inheritance from TenantSpanCE is correctly implemented.

The change aligns with the PR's objective to modularize span constants. Ensure that this change is tested thoroughly to prevent any runtime issues due to the new inheritance structure.

#!/bin/bash
# Description: Verify if the change in inheritance affects other parts of the project.
# Test: Search for references to TenantSpan constants across the project.

rg --type java "TenantSpan."

Also applies to: 5-5

app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/DatasourceSpan.java (1)

3-3: Inheritance from DatasourceSpanCE is correctly implemented.

This change is consistent with the PR's goals to better organize span constants. It is crucial to verify that all functionalities relying on the constants previously declared in DatasourceSpan continue to operate correctly.

#!/bin/bash
# Description: Verify if the change in inheritance affects other parts of the project.
# Test: Search for references to DatasourceSpan constants across the project.

rg --type java "DatasourceSpan."

Also applies to: 5-5

app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/spans/ce/DatasourceSpanCE.java (1)

6-8: Constant declarations are well-defined.

The use of APPSMITH_SPAN_PREFIX ensures consistency in naming spans. Verify that the actual values of these constants match the intended spans in the application.

#!/bin/bash
# Description: Verify the correctness of span constant values.
# Test: Check if the span constants are used appropriately within the application.

rg --type java "get_all_datasource_storage|get_all_plugins_in_workspace"

@NilanshBansal NilanshBansal merged commit f109c2f into release Jun 26, 2024
46 of 47 checks passed
@NilanshBansal NilanshBansal deleted the chore/issue-34483/fix-span-folder-structure branch June 26, 2024 09:26
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Jul 10, 2024
## Description
The spans directory currently did not have a way to add EE-specific
spans.
<img width="340" alt="SCR-20240626-j4l"
src="https://github.com/appsmithorg/appsmith/assets/25542733/610dd7d4-2309-4fed-8dce-7faf1c02b6a7">


**This PR fixes the span directory to add ce and ee spans support.**



Fixes appsmithorg#34483  

## Automation

/ok-to-test tags="@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/9676199406>
> Commit: 45830b0
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9676199406&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- 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

- **Refactor**
- Improved code structure by extending specialized classes
(`ActionSpanCE`, `DatasourceSpanCE`, `TenantSpanCE`) for `ActionSpan`,
`DatasourceSpan`, and `TenantSpan`.
  
- **New Features**
- Introduced new constants for tracing various action executions and
data fetching related to datasources and tenants.

<!-- 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
Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Product Issues related to a specific integration ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Folder structure CE & EE correction for Span Files
2 participants