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: additional test cases and method refactor to follow old standards #33734

Merged
merged 10 commits into from
May 27, 2024

Conversation

sondermanish
Copy link
Contributor

@sondermanish sondermanish commented May 26, 2024

Description

  • Added fallback implementation for autocommit eligibility helper to avoid accessing FS for git connected apps when feature flags are switched off
  • Added test cases to verify the same
  • modified test cases names to follow standards
  • refactored method to follow standard

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9255023455
Commit: f378b03
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

@sondermanish sondermanish requested a review from a team as a code owner May 26, 2024 12:47
Copy link
Contributor

coderabbitai bot commented May 26, 2024

Walkthrough

Walkthrough

The recent changes encompass various updates across multiple files, focusing on reordering parameters in specific methods, correcting typos, enhancing logging, adding annotations, and improving error handling. Key modifications include adjustments in method calls, corrections of interface names, adding new utility methods for Redis operations, and refining test setups. These changes collectively enhance code readability, maintainability, and functionality.

Changes

File Path Change Summary
...CommonGitFileUtilsCE.java Reordered parameters in getMetadataServerSchemaMigrationVersion method and updated corresponding method call.
.../autocommit/AutoCommitEligibilityHelper.java Corrected typo in interface name from AutoCommitEligibiltyHelper to AutoCommitEligibilityHelper.
.../autocommit/AutoCommitEligibilityHelperImpl.java Added @Primary annotation, adjusted parameter order, enhanced logging, handled default values, and improved error handling in various methods.
.../autocommit/AutoCommitEligibilityHelperFallbackImpl.java Provided implementations for auto-commit eligibility checks.
.../autocommit/AutoCommitTriggerDTO.java Added @AllArgsConstructor and @RequiredArgsConstructor annotations.
.../ApplicationPageServiceImpl.java Corrected typo in import statement and class name for AutoCommitEligibilityHelper.
.../git/GitRedisUtils.java Introduced GitRedisUtils class with methods for adding and releasing file locks using Redis.
.../autocommit/ApplicationPageServiceAutoCommitTest.java Corrected spelling of AutoCommitEligibiltyHelper to AutoCommitEligibilityHelper throughout the file.
.../autocommit/AutoCommitEligibilityHelperTest.java Added new imports for FeatureFlagService and RedisUtils, introduced @BeforeEach method, and adjusted method calls.
.../testhelpers/git/GitFileSystemTestHelper.java Modified to delete the repository if it exists before setting up a new one.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant Client
    participant Server
    participant GitRedisUtils
    participant CommonGitFileUtilsCE

    Client->>Server: Request auto-commit eligibility
    Server->>GitRedisUtils: Add file lock
    GitRedisUtils-->>Server: Lock added
    Server->>CommonGitFileUtilsCE: getMetadataServerSchemaMigrationVersion()
    CommonGitFileUtilsCE-->>Server: Return version
    Server->>Client: Respond with eligibility status
    Server->>GitRedisUtils: Release file lock
    GitRedisUtils-->>Server: Lock released
Loading

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8ffede1 and f378b03.
Files selected for processing (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperImpl.java (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/GitRedisUtils.java
  • app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/autocommit/AutoCommitEligibilityHelperImpl.java

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the 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 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 May 26, 2024
@sondermanish sondermanish self-assigned this May 26, 2024
@sondermanish sondermanish added the ok-to-test Required label for CI label May 26, 2024
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

@sondermanish sondermanish enabled auto-merge (squash) May 26, 2024 22:58
@sondermanish sondermanish requested a review from nidhi-nair May 26, 2024 22:58
@sondermanish sondermanish requested a review from nidhi-nair May 27, 2024 04:11
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
nidhi-nair
nidhi-nair previously approved these changes May 27, 2024
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot May 27, 2024
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@sondermanish sondermanish requested a review from nidhi-nair May 27, 2024 08:17
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@sondermanish sondermanish added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 27, 2024
@@ -26,6 +26,10 @@ public Mono<Boolean> addFileLock(String defaultApplicationId) {
}));
}

public Mono<Boolean> addFileLockWithoutRetry(String defaultApplicationId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Approving the PR due to urgency, but please refactor this call to make retry a parameter instead of a separate method.

@sondermanish sondermanish merged commit 6ad9210 into release May 27, 2024
43 checks passed
@sondermanish sondermanish deleted the chore/server-autocommit branch May 27, 2024 13:10
sondermanish added a commit that referenced this pull request May 28, 2024
…rds (#33734)

## Description
- Added fallback implementation for autocommit eligibility helper to
avoid accessing FS for git connected apps when feature flags are
switched off
- Added test cases to verify the same
- modified test cases names to follow standards
- refactored method to follow standard

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9244442582>
> Commit: bb8e141
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9244442582&attempt=1"
target="_blank">Click here!</a>
> It seems like **no tests ran** 😔. We are not able to recognize it,
please check workflow <a
href="https://github.com/appsmithorg/appsmith/actions/runs/9244442582"
target="_blank">here.</a>

<!-- end of auto-generated comment: Cypress test results  -->



## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
@coderabbitai coderabbitai bot mentioned this pull request Dec 12, 2024
2 tasks
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