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

File Service Config Environments & Provider Types #166

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

tmthecoder
Copy link
Contributor

  • Adds support for environments in the file service config
  • Adds support for provider types (needed for blob storage support)

@tmthecoder tmthecoder requested a review from UZ9 February 12, 2025 01:47
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: This comment was AI-generated and is not necessarily completely accurate. Please take code comments with a grain of salt.

PR Summary

This PR adds environment support and provider type functionality to the file service configuration, enabling multi-environment configurations and support for different storage providers like S3 and Azure.

  • Added required configEnv field to file operations and composite keys in database schema, with default value 'test' for new configurations
  • Introduced FileProviderType enum (S3, AZURE) with conversion utilities between RPC and Prisma types
  • Missing test coverage for Azure provider type and environment-specific edge cases across multiple services
  • Inconsistent error messages and validation in file bucket operations (particularly in file_bucket.controller.ts)
  • Hardcoded region 'us-east-005' in file_bucket.service.ts should be configurable

Score: 75/100

Backend Checklist Issues:

  • Input validation needs improvement for environment and provider type fields
  • Edge cases for different environments not fully tested
  • Error handling could be more specific for environment-related issues

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

42 file(s) reviewed, 22 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 76 to 82
const fileProviderBody = {
providerName: '',
publicAccessKey: 'Test Public Access Key',
privateAccessKey: 'Test Private Access Key',
baseUrl: 'https://aws.amazon.com/s3',
type: 'S3',
};
Copy link

Choose a reason for hiding this comment

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

logic: Request body structure is inconsistent with the valid test case (lines 218-225) which uses nested accessKey object

Suggested change
const fileProviderBody = {
providerName: '',
publicAccessKey: 'Test Public Access Key',
privateAccessKey: 'Test Private Access Key',
baseUrl: 'https://aws.amazon.com/s3',
type: 'S3',
};
const fileProviderBody = {
providerName: '',
accessKey: {
publicAccessKey: 'Test Public Access Key',
privateAccessKey: 'Test Private Access Key',
},
baseUrl: 'https://aws.amazon.com/s3',
type: 'S3',
};

Copy link
Contributor

Choose a reason for hiding this comment

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

Review was wrong (it should be what you put) but it does seem like we have the wrong access key format in several of the e2e tests (nested)--could you take a look?

Comment on lines 48 to 51
@IsNotEmpty()
@Transform(toEnum)
@ApiProperty({ description: 'File provider type' })
type: FileProviderProto.ProviderType;
Copy link

Choose a reason for hiding this comment

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

style: Consider adding example values to @ApiProperty to show valid provider types (S3, AZURE)

Copy link
Contributor

Choose a reason for hiding this comment

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

valid

packages/proto/definitions/file_bucket.proto Show resolved Hide resolved
packages/proto/definitions/file_bucket.proto Show resolved Hide resolved
packages/proto/definitions/identifiers.proto Show resolved Hide resolved
packages/proto/src/gen/identifiers.ts Show resolved Hide resolved
packages/proto/src/gen/identifiers.ts Show resolved Hide resolved
Copy link
Contributor

@UZ9 UZ9 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@UZ9 UZ9 merged commit c5a431e into main Feb 12, 2025
7 checks passed
@UZ9 UZ9 deleted the tejas/file-service-config-environments-provider-type branch February 12, 2025 19:42
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.

2 participants