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 the img uploader API #266

Merged
merged 7 commits into from
Aug 30, 2024
Merged

feat: add the img uploader API #266

merged 7 commits into from
Aug 30, 2024

Conversation

xingwanying
Copy link
Contributor

  • add new env params:
  • AWS_SECRET_NAME
  • AWS_REGION_NAME
  • S3_BUCKET_NAME
  • STATIC_URL

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
petercat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 7:18am

Copy link

Walkthrough

This pull request introduces an image uploader API. It includes new environment parameters for AWS configuration and updates to various files to support the new functionality.

Changes

File Summary
.github/workflows/aws-preview.yml, .github/workflows/aws-prod.yml Added new environment parameters for AWS configuration.
server/.env.example Added new environment variables for AWS configuration.
server/README.zh-CN.md Added code directory structure reference and fastapi best practices link.
server/aws/constants.py Defined constants for AWS configuration and error codes.
server/aws/dependencies.py Added a dependency to get the S3 client.
server/aws/exceptions.py Defined a custom exception for upload errors.
server/aws/router.py Added a new router for the AWS upload API.
server/aws/schemas.py Defined a schema for image metadata.
server/aws/service.py Implemented the service to upload images to S3.
server/github_app/utils.py Updated to use new AWS environment variables.
server/main.py Included the new AWS router.
server/requirements.txt Added new dependencies for AWS and testing.
server/tests/aws/test_upload.py Added tests for the image upload functionality.
template.yml Added new environment parameters for AWS configuration.

Copy link

filepath function passed SUBTOTAL
tests/aws/test_upload.py test_upload_image_success 1 1
tests/aws/test_upload.py test_upload_image_error 1 1
tests/test_main.py test_health_checker 1 1
tests/utils/test_path_to_hunk.py TestPathToHunk.test_basic_covnert 1 1
tests/utils/test_path_to_hunk.py TestPathToHunk.test_parse 1 1
TOTAL 5 5

@RaoHai RaoHai merged commit 5cfca76 into main Aug 30, 2024
4 checks passed
@RaoHai RaoHai deleted the feat_img_upload branch August 30, 2024 07:20
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