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

Added Oracle Object Storage adapter #91

Conversation

SaketKaswa20
Copy link

@SaketKaswa20 SaketKaswa20 commented Oct 5, 2023

Added Oracle Object Storage Adapter

Solving Issue #6415

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

Great PR! 🤯 We left some comments during the review, please check them out.

Please also make sure to:

  1. to run the formatter to fix the lint errors
  2. attach a screenshot of successful tests

* @var string
*/
protected string $root = 'oracle-object';

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be region constants?

Comment on lines 21 to 24
public function __construct(string $root = '')
{
$this->root = $root;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There should definitely be more parameters than this like some sort of key and bucket.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks!
Will solve the mentioned things and push the changes.

@SaketKaswa20
Copy link
Author

I am facing problem in phpunit test. It is showing could not read phpunit.xml when using phpunit --configuration phpunit.xml and when running vendor/bin/phpunit --configuration phpunit.xml I get the error zsh: no such file or directory: vendor/bin/phpunit.

@gewenyu99
Copy link

@stnguyen90 take a peek at the comment here

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

Please see my comments and make sure to run the formatter to fix the lint problems.

public function __construct(string $root = '', array $config = [])
{
$this->root = $root;
$this->config = $config;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not use a config array like this. Please take a look at how similar adapters are implemented in this repo to see how the configuration should be implemented.

use Utopia\Storage\Device;
use Utopia\Storage\Storage;

class OracleObject extends Device
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably extend the S3 adapter because Oracle Object is an S3-compatible storage provider.

Comment on lines +155 to +177
public function uploadFileToOracleObjectStorage(string $localFilePath, string $remoteFilePath): bool
{
// Implement logic to upload a file to Oracle Object Storage
// Return true on success, false on failure
// You should use the Oracle Object Storage SDK or API for this operation
return true; // Example: always return true for the sake of testing
}

public function downloadFileFromOracleObjectStorage(string $remoteFilePath, string $localFilePath): bool
{
// Implement logic to download a file from Oracle Object Storage
// Return true on success, false on failure
// You should use the Oracle Object Storage SDK or API for this operation
return true; // Example: always return true for the sake of testing
}

public function deleteFileFromOracleObjectStorage(string $remoteFilePath): bool
{
// Implement logic to delete a file from Oracle Object Storage
// Return true on success, false on failure
// You should use the Oracle Object Storage SDK or API for this operation
return true; // Example: always return true for the sake of testing
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These custom functions should be added because this should implement Device such that you would use the same methods from the Device class (like upload and delete).

@@ -21,6 +21,8 @@ class Storage

const DEVICE_LINODE = 'linode';

const DEVICE_ORACLEOBJECT = 'oracleobject';
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be DEVICE_ORACLE_OBJECT just like DEVICE_DO_SPACES:

Suggested change
const DEVICE_ORACLEOBJECT = 'oracleobject';
const DEVICE_ORACLE_OBJECT = 'oracleobject';

@gewenyu99
Copy link

Hey,

Due to time constraints, I'm going to mark this PR hacktoberfest-accepted for now so you get DO's Hacktoberfest rewards. We'll continue to work with you on this issue for review and merge.

When it is merged, we'll contact you for Appwrite-specific Hacktoberfest swag.

Thanks for helping us improve Appwrite!

@stnguyen90
Copy link
Contributor

Unfortunately, I'm going to need to remove the hacktoberfest-accepted label as what's done so far doesn't actually implement anything.

@SaketKaswa20
Copy link
Author

No worries! It was great working with you all!

@iSuslov
Copy link

iSuslov commented Dec 1, 2023

Well, kind of sad. Are there any plans to support it afterall? Oracle Cloud is undervalued for sure.

@gewenyu99
Copy link

@iSuslov We'd still love a valid implementation of the Oracle Object Storage adapter. I just think the existing PR wasn't quite ready for merge.

We could also see a generic S3 adapter in the future, which would also solve the same issue.

TL;DR: We'd love to support it, this PR just wasn't ready for merge :)

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.

4 participants