Skip to content

chore: Dummy to run CI on external contributor's PR : add support for Google Cloud Storage in S3 plugin#34075

Closed
NilanshBansal wants to merge 11 commits intoreleasefrom
chore/issue-6877/dummy-external-33938-add-gcs
Closed

chore: Dummy to run CI on external contributor's PR : add support for Google Cloud Storage in S3 plugin#34075
NilanshBansal wants to merge 11 commits intoreleasefrom
chore/issue-6877/dummy-external-33938-add-gcs

Conversation

@NilanshBansal
Copy link
Contributor

@NilanshBansal NilanshBansal commented Jun 7, 2024

Description

The original PR is #33938

CI cannot be run on PR which is from a fork other than appsmith. Also, dp and further testing will be done on this PR.

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.All"

🔍 Cypress test results

Tip

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

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Added support for Google Cloud Storage as a service provider.
    • Introduced a new configuration option for setting a default bucket in Google Cloud Storage.
  • Bug Fixes

    • Enhanced validation for default bucket parameters in Google Cloud Storage configurations.
  • Tests

    • Added tests for validating datasource configurations for Google Cloud Storage, including missing regions and default buckets.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 7, 2024

Walkthrough

The recent updates to the AmazonS3Plugin introduce support for Google Cloud Storage. This includes adding constants, validation for default buckets, and splitting Google Cloud-specific logic into separate methods. Additionally, the UI form now has options for Google Cloud Storage, and new tests validate these configurations.

Changes

Files/Paths Change Summary
.../AmazonS3Plugin.java Added handling for Google Cloud Storage, including validation and testing methods.
.../constants/S3PluginConstants.java Introduced constants for Google Cloud Storage and default bucket property index.
.../exceptions/S3ErrorMessages.java Added error messages for non-existent buckets and missing default bucket parameters in Google Cloud Storage.
.../utils/DatasourceUtils.java Enhanced to handle Google Cloud Storage, including setting region to AUTO.
.../resources/form.json Updated form to include Google Cloud Storage option and default bucket configuration.
.../AmazonS3PluginTest.java Added tests for validating Google Cloud Storage datasource configurations and error messages.

Poem

In the land of clouds, where data flows,
A new support now brightly glows.
Google joins the storage spree,
With buckets set by you and me.
Errors caught and tests in place,
Our plugin's ready, full of grace.
🌥️🚀


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 the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jun 7, 2024
@NilanshBansal NilanshBansal added the ok-to-test Required label for CI label Jun 7, 2024
@NilanshBansal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Jun 7, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9414525091.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 34075.
recreate: .

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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7b32f1a and 2761a43.

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 (2 hunks)
Additional comments not posted (14)
app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/constants/S3PluginConstants.java (3)

8-8: LGTM! Ensure DEFAULT_BUCKET_PROPERTY_INDEX correctly corresponds to the actual index used in configurations.


17-17: LGTM! Ensure GOOGLE_CLOUD_SERVICE_PROVIDER is consistently used across the plugin.


18-18: LGTM! Ensure AUTO is used appropriately for automatic region settings in Google Cloud Storage configurations.

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

46-49: LGTM! The addition of "Google Cloud Storage" to the service provider dropdown enhances user options.


115-125: LGTM! The "Default Bucket" configuration is well-integrated with conditional visibility based on the selected service provider.

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

21-22: LGTM! The error message for non-existent buckets in Google Cloud Storage is clear and informative.


133-136: LGTM! The error message for missing default bucket parameters is clear and guides the user on what needs to be corrected.

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

23-23: LGTM! The added constants are necessary for the new Google Cloud Storage functionality.


71-71: LGTM! The addition of GOOGLE_CLOUD_STORAGE to the S3ServiceProvider enum allows for proper handling of this service provider.


173-174: LGTM! Setting the region to AUTO for Google Cloud Storage in getS3ClientBuilder aligns with the intended functionality.

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

106-109: Add constants for Google Cloud Storage support.

This addition of constants is necessary for the integration of Google Cloud Storage, ensuring that the plugin can distinguish between different service providers and handle them appropriately.


1017-1043: Implement a separate method for testing Google Cloud Storage.

This method correctly handles the specific requirements for testing Google Cloud Storage, such as checking for the existence of a default bucket. It's a good practice to isolate provider-specific logic like this.

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

206-226: Ensure proper validation of the default bucket for Google Cloud Storage.

This test method correctly checks for the absence of the default bucket property when using Google Cloud Storage, which aligns with the new requirements. Good use of assertions to validate the expected behavior.


228-250: Validate datasource configuration for Google Cloud Storage with a default bucket.

This test method effectively validates that no errors are thrown when the default bucket is provided for Google Cloud Storage. The use of multiple assertions to check that no error messages related to missing parameters are present is commendable.

@github-actions
Copy link

github-actions bot commented Jun 7, 2024

Deploy-Preview-URL: https://ce-34075.dp.appsmith.com

@NilanshBansal NilanshBansal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jun 11, 2024
@NilanshBansal
Copy link
Contributor Author

/build-deploy-preview skip-tests=true recreate=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9465398248.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 34075.
recreate: true.

@github-actions
Copy link

Deploy-Preview-URL: https://ce-34075.dp.appsmith.com

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2761a43 and c9639a4.

Files selected for processing (1)
  • app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (5 hunks)
Additional comments not posted (4)
app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java (4)

106-109: Constants for Google Cloud Storage have been added correctly.

These constants are essential for distinguishing between different service providers and handling specific cases for Google Cloud Storage.


990-994: Separate testing logic for Google Cloud Storage.

Splitting the testing logic into a separate method (testGoogleCloudStorage) enhances modularity and maintainability, especially as different storage providers may require different handling.


964-974: Validate the default bucket for Google Cloud Storage.

- if (StringUtils.isNullOrEmpty(defaultBucket)) {
+ if (properties == null || StringUtils.isNullOrEmpty(defaultBucket)) {
    invalids.add(S3ErrorMessages.DS_MANDATORY_PARAMETER_DEFAULT_BUCKET_MISSING_ERROR_MSG);
}

Ensure that the properties list is not null before accessing it to prevent potential NullPointerException.

Likely invalid or redundant comment.


774-778: Ensure correct handling of service provider index.

Verification successful

The handling of S3_SERVICE_PROVIDER_PROPERTY_INDEX appears to be consistent and includes necessary null checks and validations to prevent potential issues.

  • AmazonS3Plugin.java and DatasourceUtils.java both import and use S3_SERVICE_PROVIDER_PROPERTY_INDEX.
  • There are multiple instances where null checks are performed before accessing the property using this index.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the service provider index is correctly used throughout the codebase.

# Test: Search for the usage of `S3_SERVICE_PROVIDER_PROPERTY_INDEX`. Expect: Consistent usage across the codebase.
rg --type java $'S3_SERVICE_PROVIDER_PROPERTY_INDEX'

Length of output: 2897

@NilanshBansal
Copy link
Contributor Author

Closing this PR as original contribution from the user has been merged.
Ref: #33938

@NilanshBansal NilanshBansal deleted the chore/issue-6877/dummy-external-33938-add-gcs branch June 13, 2024 02:29
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