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

feat: add support for Google Cloud Storage in S3 plugin #33938

Conversation

AnnaHariprasad5123
Copy link
Contributor

@AnnaHariprasad5123 AnnaHariprasad5123 commented Jun 4, 2024

Fixes #6877

Screenshots :

image
image
image

Video Demonstration :

Link

Summary by CodeRabbit

  • New Features

    • Added support for Google Cloud Storage as a service provider.
    • Enhanced validation and testing for datasource configurations, including non-Amazon providers.
  • Bug Fixes

    • Improved error handling and connection shutdown logic for various service providers.
  • Tests

    • Introduced new test methods to validate datasource configurations for non-Amazon providers, including Google Cloud Storage.

Copy link
Contributor

coderabbitai bot commented Jun 4, 2024

Walkthrough

The changes introduce support for Google Cloud Storage in the S3 plugin by adding necessary constants, updating logic to handle Google Cloud Storage as a service provider, and adding new test cases to validate these configurations. The changes span across multiple files, including DatasourceUtils.java, AmazonS3Plugin.java, and AmazonS3PluginTest.java.

Changes

File Path Change Summary
.../DatasourceUtils.java Imported additional constants, added GOOGLE_CLOUD_STORAGE enum value, and updated logic to handle Google Cloud Storage as a service provider.
.../AmazonS3PluginTest.java Imported constants using wildcard, added GOOGLE_CLOUD_SERVICE_PROVIDER, and introduced new test methods for validating Google Cloud Storage configurations.
.../AmazonS3Plugin.java Added imports, modified validateDatasource and testDatasource methods to handle Google Cloud Storage, and adjusted error handling and connection shutdown logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Appsmith
    participant GoogleCloudStorage
    participant AmazonS3

    User->>Appsmith: Configure Google Cloud Storage
    Appsmith->>GoogleCloudStorage: Validate Configuration
    GoogleCloudStorage-->>Appsmith: Return Validation Result
    Appsmith-->>User: Show Validation Result

    User->>Appsmith: Configure Amazon S3
    Appsmith->>AmazonS3: Validate Configuration
    AmazonS3-->>Appsmith: Return Validation Result
    Appsmith-->>User: Show Validation Result
Loading

Assessment against linked issues

Objective Addressed Explanation
Add Google Cloud Storage as a service provider in S3 plugin (#6877)
Remove region field and add default bucket for Google Cloud Storage (#6877)
Add test case testValidateDatasourceWithMissingRegionWithNonAmazonProvider (#6877)

Poem

In a cloud of code, a rabbit hopped,
To Google's storage, it never stopped.
Buckets and regions, all aligned,
In Appsmith's plugin, perfectly designed.
Tests were written, changes were made,
Now data flows, no need to be afraid! 🌟


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.

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

Outside diff range and nitpick comments (1)
app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (1)

103-103: Review the static imports for clarity and necessity.

The static imports from S3PluginConstants are extensive. Consider importing only the necessary constants to improve code readability and maintainability.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3c38ca9 and dd2158456c5eccb270f4c5e9bcda6837b5ca68f1.

Files selected for processing (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (4 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (6 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (3 hunks)
Additional comments not posted (11)
app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (1)

Line range hint 8-19: The new constants for Google Cloud Storage are correctly defined and align with the PR's objectives to support GCS in the S3 plugin.

app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json (2)

46-49: The addition of "Google Cloud Storage" to the service provider dropdown is correctly implemented.


115-125: The new "Default Bucket" field is correctly added and configured to be visible only when Google Cloud Storage is selected. This aligns with the PR's objectives to handle GCS-specific configurations.

app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java (2)

21-23: The new error message for non-existent buckets in Google Cloud Storage is appropriately detailed and will enhance error reporting.


133-137: The error message for missing "Default Bucket" parameter is clear and necessary for ensuring that all required parameters are provided for Google Cloud Storage.

app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (2)

23-23: The addition of GOOGLE_CLOUD_STORAGE to the S3ServiceProvider enum and the import adjustments are correctly implemented to support the new functionality.

Also applies to: 68-68


157-163: The modifications in the getS3ClientBuilder method to handle Google Cloud Storage are correctly implemented. The use of the AUTO region setting aligns with GCS's requirements.

app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (2)

1016-1042: Review the method testGoogleCloudStorage.

The method testGoogleCloudStorage is well-implemented with clear error handling and resource management. It correctly handles different scenarios such as missing default bucket and potential S3 exceptions.


952-962: Validate the handling of the DEFAULT_BUCKET_PROPERTY_INDEX.

Ensure that the DEFAULT_BUCKET_PROPERTY_INDEX is being handled correctly across the codebase, especially in contexts where it might affect the configuration or operation of the plugin.

Verification successful

The handling of DEFAULT_BUCKET_PROPERTY_INDEX is consistent and correct in the codebase. The property is retrieved and validated appropriately in both occurrences within AmazonS3Plugin.java.

  • AmazonS3Plugin.java:
    • Lines 952-962: Retrieves and validates defaultBucket.
    • testGoogleCloudStorage method: Retrieves and validates defaultBucket.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the handling of the DEFAULT_BUCKET_PROPERTY_INDEX in other parts of the codebase.

# Test: Search for the usage of DEFAULT_BUCKET_PROPERTY_INDEX. Expect: Proper handling in all occurrences.
rg --type java 'DEFAULT_BUCKET_PROPERTY_INDEX'

Length of output: 589



Script:

#!/bin/bash
# Extract lines around the second occurrence of DEFAULT_BUCKET_PROPERTY_INDEX in AmazonS3Plugin.java
rg --type java --context 10 'DEFAULT_BUCKET_PROPERTY_INDEX' app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java

Length of output: 2324

app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (2)

202-222: The test method testValidateDatasourceWithMissingRegionWithNonAmazonProvider effectively checks for the mandatory default bucket parameter when using a non-Amazon provider. This aligns with the PR objectives to handle Google Cloud Storage configurations differently.


73-73: Ensure that the wildcard import from S3PluginConstants is necessary and used efficiently.

Verification successful

Ensure that the wildcard import from S3PluginConstants is necessary and used efficiently.


The wildcard import from S3PluginConstants is necessary and used efficiently, as evidenced by the significant number of constant usages in the test file.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that all constants from S3PluginConstants are used in the test file.

# Test: Search for the usage of constants from S3PluginConstants. Expect: Multiple usages.
rg --type java --count 'S3PluginConstants\.\w+' app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

Length of output: 151



Script:

#!/bin/bash
# Description: Verify that all constants from S3PluginConstants are used in the test file.

# Test: Search for the usage of constants from S3PluginConstants without the class prefix. Expect: Multiple usages.
rg --type java --count '\b(CONSTANT_NAME_1|CONSTANT_NAME_2|CONSTANT_NAME_3|...)\b' app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

Length of output: 190

@AnnaHariprasad5123 AnnaHariprasad5123 force-pushed the Issue-#6877/feat-google-cloud-storage-support branch from dd21584 to cdfc64f Compare June 4, 2024 09:38
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 dd2158456c5eccb270f4c5e9bcda6837b5ca68f1 and cdfc64f.

Files selected for processing (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (3 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (6 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (3 hunks)
Files skipped from review as they are similar to previous changes (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

@AnnaHariprasad5123
Copy link
Contributor Author

Hi @nidhi-nair, Could you review this pr.

@nidhi-nair
Copy link
Contributor

Thanks for the contribution @AnnaHariprasad5123 ! @NilanshBansal will be picking up the review for this PR, I have assigned it to him.

@AnnaHariprasad5123 AnnaHariprasad5123 force-pushed the Issue-#6877/feat-google-cloud-storage-support branch from cdfc64f to 6a3599e Compare June 6, 2024 07:40
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 cdfc64f and 6a3599e806ba6d8038f614eeab597ed90ca615f9.

Files selected for processing (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (6 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (3 hunks)
Files skipped from review as they are similar to previous changes (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 spotless checks are failing on the PR.
Can you please run mvn spotless:apply from /app/server directory and commit the changes.

@AnnaHariprasad5123
Copy link
Contributor Author

Hi @NilanshBansal, I run it. Everything is passed on my side. This is the screenshot :
image

@AnnaHariprasad5123 AnnaHariprasad5123 force-pushed the Issue-#6877/feat-google-cloud-storage-support branch from 6a3599e to 4844aed Compare June 6, 2024 08:09
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 6a3599e806ba6d8038f614eeab597ed90ca615f9 and 4844aed.

Files selected for processing (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (6 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json (2 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (3 hunks)
Files skipped from review as they are similar to previous changes (6)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/exceptions/S3ErrorMessages.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java
  • app/server/appsmith-plugins/amazons3Plugin/src/main/resources/form.json
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

@NilanshBansal
Copy link
Contributor

Hi @NilanshBansal, I run it. Everything is passed on my side. This is the screenshot : image

@AnnaHariprasad5123 after running mvn spotless:apply, can you please commit the formatted files. This command is mandatory before committing any changes to appsmith.
The spotless check is failing here for the cloned PR.

If I run mvn spotless:apply on your changes locally, it shows changes in the following 3 files. We need to commit these 3 file changes also for the spotless check to pass. Can you pls check this?
image

@AnnaHariprasad5123
Copy link
Contributor Author

HI @NilanshBansal Sorry for this, Could you check again. Is it fine?

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 4844aed and c27feca.

Files selected for processing (2)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (5 hunks)
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java
  • app/server/appsmith-plugins/amazons3Plugin/src/test/java/com/external/plugins/AmazonS3PluginTest.java

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 c27feca and 64dbbd0.

Files selected for processing (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/utils/DatasourceUtils.java

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Jun 7, 2024

@AnnaHariprasad5123 thanks for your contribution 🙏 , the code LGTM.
The next tasks that I will perform before merging this PR will be:

  • PR Code Review [done]
  • Design Copy testing
  • PR deploy preview and usability testing on all the different scenarios

Further checks, will be tested on this dummy PR. Once the checks pass, we will merge your original PR to appsmith!!
If there is anything required from your end, I will let you know. Again, thanks a lot for your patience and perseverance ❤️

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 the Delete multiple files option is not working. Please check the screenshots below.

image image

@AnnaHariprasad5123
Copy link
Contributor Author

Hi @NilanshBansal, please review all the issues and let me know. I will make all the necessary changes at once.

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 I have reviewed. Everything else LGTM from your PR perspective.
The Delete Multiple files is the only blocker found.

@AnnaHariprasad5123
Copy link
Contributor Author

AnnaHariprasad5123 commented Jun 10, 2024

Hi @NilanshBansal,

Did you check the IAM permissions for the bucket? Have you tried performing the same operation with the AmazonS3 provider? I didn't make any changes to the query code, but it seems that the deleteMultipleFiles method is the only one not working. So, can we merge this PR and raise an issue on this?. I am currently occupied with other work and unable to continue this investigation. Please let me know what's your opinion.

Thank you.

@AnnaHariprasad5123
Copy link
Contributor Author

I have already checked this issue. The exception is being raised from this try block, and I have already debugged the issue. I am confused because the single delete operation works, but deleting multiple files is not allowed. If this issue persists for all service providers, then I think we should create a new issue for this.
image

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Jun 10, 2024

Hi @NilanshBansal,

Did you check the IAM permissions for the bucket? Have you tried performing the same operation with the AmazonS3 provider? I didn't make any changes to the query code, but it seems that the deleteMultipleFiles method is the only one not working. So, can we merge this PR and raise an issue on this?. I am currently occupied with other work and unable to continue this investigation. Please let me know what's your opinion.

Thank you.

Hey @AnnaHariprasad5123,
This is not an issue with IAM permissions because I am able to delete single objects only delete multi is failing.
I have tested the same functionality with the AmazonS3 provider and it works perfectly fine. This is only failing for Google Cloud Storage. Below is the screenshot for AWS S3 provider.
image

So, can we merge this PR and raise an issue on this?
Let me discuss this internally and get back, but as of now we would like to treat this as a blocker, which means we cannot proceed forward until this is resolved as we cannot ship a buggy feature. I hope you understand.

@AnnaHariprasad5123
Copy link
Contributor Author

@NilanshBansal , I believe there is an alternative approach for handling batch deletions in GCS, different from Amazon S3. We could iterate through each file in listOfFiles and perform individual deletions, as single deletions are working. Do you think this is a good approach? If so, I will implement it and push the changes. Please share your opinion.

@NilanshBansal
Copy link
Contributor

NilanshBansal commented Jun 10, 2024

@NilanshBansal , I believe there is an alternative approach for handling batch deletions in GCS, different from Amazon S3. We could iterate through each file in listOfFiles and perform individual deletions, as single deletions are working. Do you think this is a good approach? If so, I will implement it and push the changes. Please share your opinion.

@AnnaHariprasad5123 Thanks for this analysis, yes completely agreed with you, handling batch deletions in GCS is different from AWS S3.
As to not increase the scope of this PR, lets just focus on removing the option for Deleting multiple files from the dropdown in case of Google Cloud Storage and let it work for other providers.
If you can make that change I will take this PR forward as to not delay this feature for our users further.

Saying that, we can take up the implementation of Delete Multiple Files option for GCS as a separate issue. We would love to get your contributions on the same in a separate PR.
Until then, we can just not show the option for Delete Multiple files in GCS.

cc: @rohan-arthur @trishaanand

@AnnaHariprasad5123
Copy link
Contributor Author

AnnaHariprasad5123 commented Jun 11, 2024

Hi @NilanshBansal, I'm trying to hide the deleteMultipleFiles label in root.json, located in the editor folder. However, the changes I made aren't showing up. Can you help me understand why?

           {
              "label": "Delete multiple files",
              "value": "DELETE_MULTIPLE_FILES",
              "hidden": {
                "path": "datasourceConfiguration.properties[1].value",
                "comparison": "EQUALS",
                "value": "google-cloud-storage"
              }
            } 

"hidden": "{{datasourceConfiguration.properties[1].value}} == 'google-cloud-storage'"

Even when I try to add a new label, it's still not showing up.

@NilanshBansal
Copy link
Contributor

"hidden": {
"path": "datasourceConfiguration.properties[1].value",
"comparison": "EQUALS",
"value": "google-cloud-storage"
}

@AnnaHariprasad5123 to view the change you may need to run this command before starting the server to compile the amazonS3Plugin, then only the changes will show up.
mvn -B clean compile && ./build.sh -DskipTests

@AnnaHariprasad5123
Copy link
Contributor Author

Yes I do it every time. Even though not reflected. If you don't mind. Could you put that code snippet in that file and observe if change is reflected or not.

@AnnaHariprasad5123
Copy link
Contributor Author

AnnaHariprasad5123 commented Jun 11, 2024

Hi @NilanshBansal, Is it working from your side? Please let me know.

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 on debugging, I have found that we do not have the hidden option implemented for DROP_DOWN.options internally.
I am trying to figure out ways on how to hide this only for a particular scenario. I am trying to use evaluations to get this to work.

@NilanshBansal
Copy link
Contributor

@AnnaHariprasad5123 until I am figuring out how to hide an option from the dropdown.
Can you invest in the above approach for adding the Delete Multiple Objects for Google Cloud Storage if that does not take much effort. If we can implement that, it would be the best approach. I am okay with the approach you suggested in this comment.
#33938 (comment)

@AnnaHariprasad5123
Copy link
Contributor Author

AnnaHariprasad5123 commented Jun 11, 2024

Hi @NilanshBansal , It works for every S3 provider, Could you check for GCS and amazon S3. Let me know if any changes required.
image

We can create an issue to optimize this operation further if this approach is not ok. This is my opinion.

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 e73a14b and 294d18f.

Files selected for processing (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java

@AnnaHariprasad5123 AnnaHariprasad5123 force-pushed the Issue-#6877/feat-google-cloud-storage-support branch from 294d18f to baae8b6 Compare June 11, 2024 11:18
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 294d18f and baae8b6.

Files selected for processing (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java

@AnnaHariprasad5123
Copy link
Contributor Author

Hi @NilanshBansal, Is this ok now. Let me know.

@NilanshBansal NilanshBansal self-requested a review June 11, 2024 12:25
@AnnaHariprasad5123
Copy link
Contributor Author

Hi @NilanshBansal Good morning, I've completed the necessary changes. Kindly consider merging my pull request when you get a chance.

@sharat87 sharat87 merged commit 387e6a5 into appsmithorg:release Jun 12, 2024
15 checks passed
@sharat87
Copy link
Member

Thank you for your contribution and patience @AnnaHariprasad5123! 🙏

@NilanshBansal
Copy link
Contributor

All checks (spotless and ci) have passed on this code. Verified by creating draft CE and EE PRs with the same changes.

SCR-20240612-huu SCR-20240612-huk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]-[90]:Add support for Google Cloud Storage in S3 plugin
4 participants