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

fix: added fix for disabling the autocommit feature without feature flag #34020

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

sondermanish
Copy link
Contributor

@sondermanish sondermanish commented Jun 6, 2024

Description

  • Added @featureFlagged annotation (release_git_autocommit_enabled) to the interface method isAutoCommitRequired for AutocommitEligibilityHelper to disable the autocommit as a feature

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

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/9398022580
Commit: f25b9ef
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a feature flag for auto-commit functionality in the app.
  • Tests

    • Disabled specific auto-commit test methods.

@sondermanish sondermanish requested a review from a team as a code owner June 6, 2024 08:57
@sondermanish sondermanish self-assigned this Jun 6, 2024
Copy link
Contributor

coderabbitai bot commented Jun 6, 2024

Walkthrough

The changes introduce a new feature flag annotation @FeatureFlagged to the isAutoCommitRequired method in the AutoCommitEligibilityHelperImpl class, enabling conditional execution based on the feature flag release_git_autocommit_feature_enabled. Additionally, several test methods in the ApplicationPageServiceAutoCommitTest class have been disabled.

Changes

Files Change Summary
app/.../AutoCommitEligibilityHelperImpl.java Added @FeatureFlagged annotation to isAutoCommitRequired method, changed method signature to include feature flag logic.
app/.../ApplicationPageServiceAutoCommitTest.java Disabled three test methods: testAutoCommit_whenOnlyServerIsEligibleForMigration_commitSuccess, testAutoCommit_whenOnlyClientIsEligibleForMigration_commitSuccess, and testAutoCommit_whenAutoCommitNotEligible_returnsFalse.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant Client
    participant Server
    participant FeatureFlagService

    Client->>Server: Call isAutoCommitRequired()
    Server->>FeatureFlagService: Check release_git_autocommit_feature_enabled
    FeatureFlagService-->>Server: Return feature flag status
    alt Feature Flag Enabled
        Server-->>Client: Perform AutoCommit
    else Feature Flag Disabled
        Server-->>Client: Skip AutoCommit
    end
Loading

Poem

In the code where features bloom,
A flag now whispers in the room,
Auto-commits may come or go,
As the feature flag doth show.
Tests now rest, their work on pause,
Await the flag, without a cause.
🌟✨


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.

@sondermanish sondermanish added the ok-to-test Required label for CI label Jun 6, 2024
@github-actions github-actions bot added the Bug Something isn't working label Jun 6, 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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c380837 and f25b9ef.

Files selected for processing (2)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java (1 hunks)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java (4 hunks)
Files skipped from review due to trivial changes (1)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java
Additional comments not posted (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java (2)

94-94: Ensure the @FeatureFlagged annotation is correctly implemented.


94-94: Verify the integration of the new method signature across the codebase.

Verification successful

The search results show multiple occurrences of the isAutoCommitRequired method across various files, including test files and implementation files. The method appears to be used consistently with three parameters, which aligns with the new method signature.

  • Test Files:

    • app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/ApplicationPageServiceAutoCommitTest.java
    • app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java
  • Implementation Files:

    • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java
    • app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelper.java
    • app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java
    • app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperFallbackImpl.java

The method is used with the new signature (three parameters) in all instances found. Therefore, the integration of the new method signature appears to be consistent across the codebase.

  • : The new method signature isAutoCommitRequired is correctly integrated across the codebase.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the correct integration of the new method signature `isAutoCommitRequired` across the codebase.

# Test: Search for the method usage. Expect: Only occurrences of the new signature.
ast-grep --lang java --pattern $'class $_ { $$$ isAutoCommitRequired($_, $_, $_) { $$$ } $$$ }'

Length of output: 96



Script:

#!/bin/bash
# Description: Search for all occurrences of the `isAutoCommitRequired` method in the codebase.

# Search for the method definition and usage across the codebase.
rg 'isAutoCommitRequired' -t java

Length of output: 3758

@sondermanish sondermanish enabled auto-merge (squash) June 6, 2024 09:10
@sondermanish sondermanish merged commit b9cf770 into release Jun 6, 2024
47 of 48 checks passed
@sondermanish sondermanish deleted the fix/disable-autocommit branch June 6, 2024 09:26
sondermanish added a commit that referenced this pull request Jun 6, 2024
…lag (#34020)

## Description
- Added @featureFlagged annotation `(release_git_autocommit_enabled)` to
the interface method `isAutoCommitRequired` for
`AutocommitEligibilityHelper` to disable the autocommit as a feature

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/9398022580>
> Commit: f25b9ef
> Workflow: `PR Automation test suite`
> Tags: `@tag.Git`

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

- **New Features**
  - Introduced a feature flag for auto-commit functionality in the app.

- **Tests**
  - Disabled specific auto-commit test methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
pedro-santos-rodrigues pushed a commit that referenced this pull request Jun 20, 2024
…lag (#34020)

## Description
- Added @featureFlagged annotation `(release_git_autocommit_enabled)` to
the interface method `isAutoCommitRequired` for
`AutocommitEligibilityHelper` to disable the autocommit as a feature

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/9398022580>
> Commit: f25b9ef
> Workflow: `PR Automation test suite`
> Tags: `@tag.Git`

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

- **New Features**
  - Introduced a feature flag for auto-commit functionality in the app.

- **Tests**
  - Disabled specific auto-commit test methods.
<!-- 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
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants