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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Git spans changed from enum to string #32454

Merged
merged 7 commits into from
Apr 9, 2024
Merged

Conversation

sondermanish
Copy link
Contributor

@sondermanish sondermanish commented Apr 5, 2024

Description

  • GitSpan is now following same standards as the other spans.
  • Added meter for application fetch by id and branch
  • added test case to enforce the name standards

Fixes Issue URL

Automation

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

馃攳 Cypress test results

Summary by CodeRabbit

  • New Features
    • Enhanced Git operations like commit, push, clone, and more with improved method calls for better performance and reliability.
    • Introduced new constants for Git operations and application spans to facilitate easier tracking and management of Git-related activities.
  • Refactor
    • Updated various classes to use new constants for Git operations, streamlining the process of event name generation and span tracking.
    • Improved method chaining in Git services for clearer and more efficient code.
  • Tests
    • Added tests to ensure the correct usage of names in Git operations, validating the new approach to event name generation and span tracking.

Important

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8613398600
Commit: 60d265ab55b3373a73f48cc1fb6e3124027dd000
Cypress dashboard url: Click here!
All cypress tests have passed 馃帀馃帀馃帀

@sondermanish sondermanish self-assigned this Apr 5, 2024
Copy link
Contributor

coderabbitai bot commented Apr 5, 2024

Walkthrough

Walkthrough

The changes aim to streamline Git operations and boost observability in the Appsmith application, enhancing code maintainability and monitoring for improved performance tracking.

Changes

File Path Change Summary
.../git/service/ce/GitExecutorCEImpl.java Updated method calls to use GitSpans constants directly for various Git operations.
.../constants/spans/BaseSpan.java Added APPLICATION_SPAN_PREFIX constant.
.../git/constants/GitSpans.java Refactored to focus on event name generation, removing enum declaration.
.../git/constants/ce/GitSpansCE.java Defined constants for Git operations tracing spans.
.../git/GitSpansTest.java Introduced tests validating GitSpansCE usage and event name correctness.
.../applications/base/ApplicationServiceCEImpl.java
.../server/applications/base/ApplicationServiceImpl.java
.../server/services/ce_compatible/ApplicationServiceCECompatibleImpl.java
Added ObservationRegistry dependency and updated metrics tracking using ApplicationSpans.
.../applications/spans/ApplicationSpans.java
.../applications/spans/ApplicationSpansCE.java
Introduced classes for application span constants related to different application span types.
.../server/services/ce/GitServiceCEImpl.java Updated Git method chaining and added application span tracking using ApplicationSpans.

Possibly related issues

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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 the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Apr 5, 2024
@sondermanish sondermanish changed the title chore: added changes chore: Git spans changed from enum to string Apr 5, 2024
Copy link

github-actions bot commented Apr 8, 2024

Failed server tests

  • com.appsmith.server.refactors.ce.RefactoringServiceCETest#tableWidgetKeyEscapeRefactorName

@sondermanish sondermanish added ok-to-test Required label for CI Git performance Issues related to perceived performance on any git operation labels Apr 9, 2024
Copy link

github-actions bot commented Apr 9, 2024

Failed server tests

  • com.appsmith.server.services.PageServiceTest#createValidPageWithLayout

import static com.appsmith.external.constants.spans.BaseSpan.APPSMITH_SPAN_PREFIX;
import static com.appsmith.external.constants.spans.BaseSpan.GIT_SPAN_PREFIX;

public class GitSpansCE {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, existing classes are singular, please converge nomenclature

public static final String FILE_SYSTEM_PUSH = APPSMITH_SPAN_PREFIX + GIT_SPAN_PREFIX + "file_system_push";
public static final String FILE_SYSTEM_FETCH_REMOTE =
APPSMITH_SPAN_PREFIX + GIT_SPAN_PREFIX + "file_system_fetch_remote";
public static final String STATUS = APPSMITH_SPAN_PREFIX + GIT_SPAN_PREFIX + "status";
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all of these compounds at API level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the one which doesn't have FILE_SYSTEM prefix

Copy link
Contributor

@nidhi-nair nidhi-nair left a comment

Choose a reason for hiding this comment

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

Minor nomenclature related comments.

Copy link

github-actions bot commented Apr 9, 2024

Failed server tests

  • com.appsmith.server.git.ServerSchemaMigrationEnforcerTest#importApplication_ThenExportApplication_MatchJson_equals_Success
  • com.appsmith.server.solutions.ApplicationForkingServiceTests#cloneApplicationMultipleTimes

@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 9, 2024
@nidhi-nair nidhi-nair merged commit 807f560 into release Apr 9, 2024
12 checks passed
@nidhi-nair nidhi-nair deleted the chore/meter-git branch April 9, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Git performance Issues related to perceived performance on any git operation 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.

None yet

2 participants