Conversation
…; First attemp at resolving Terraform Cloud errors
…; Second attemp at resolving Terraform Cloud errors
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
…idation - Removed special character validation from client-side password check - Aligned frontend validation with Cognito configuration (require_symbols = false) - Users can now create passwords without special characters as intended
…ng (because I hit S3 free tier limit) - Added unified storage interface supporting both AWS S3 and GCS backends - Enabled seamless switching between storage providers via environment variables - Added comprehensive test suite for both storage backends - Added configuration script for easy backend management - Added detailed documentation for storage adapter usage - Useful for development when hitting AWS free tier limits
- Replaced direct AWS S3 calls with storage adapter functions - Updated import statements to use storage_adapter module - Updated tests to reflect new storage adapter integration - Maintained backwards compatibility with existing functionality
- Added Cognito setup script for creating authentication resources - Added FastAPI backend with health check and image processing endpoints - Added comprehensive backend documentation for local development - Enabled frontend/backend development without the need for Terraform deployment or S3 bucket access
- Added FastAPI and development dependencies to pyproject.toml - Added optional GCS dependencies for storage adapter - Added VS Code task for running FastAPI backend - Updated configuration to support new local development workflow
…development dependencies
TODO: Update test coverage
…mpt 2691 at trying to fix Terraform Cloud run
…d handle wheel events TODO: test coverage
…dity and user attributes
…identity pool creation
This commit refactors the storage adapter and its command-line configuration script. The `configure_storage.py` script has been improved with a more structured command handling and clearer usage instructions. The `storage_adapter.py` has been updated with better error handling and code coverage exclusions for parts that are difficult to test automatically. The tests for the storage adapter have been refactored for better clarity and isolation. New tests have been added to cover the configuration CLI.
This commit introduces several improvements to the Terraform configuration. - Adds a `locals.tf` file to define common tags and file-related locals. - Standardizes the use of common tags across all resources. - Adds variables for Cognito token validity periods with validation. - Updates the API Gateway CORS configuration to be more specific. - Simplifies the data sources in `data.tf`. - Updates the S3 bucket and Lambda function resources to use the common tags.
This commit includes several CSS changes to improve the layout and prevent unwanted wrapping of elements, especially on smaller screens. - The main header and user info bar are now set to `flex-direction: row` and `flex-wrap: nowrap` to ensure they stay on a single line. - The header logo size has been increased. - The header title and subtitle are now set to `white-space: nowrap` to prevent them from wrapping.
This commit adds a new test file for the backend API, `tests/test_app.py`. The new tests cover the following scenarios: - Health check endpoint - Full image processing pipeline - No text detected - Retranslation - Retranslation with language detection - Exception handling
…orage backend switching
There was a problem hiding this comment.
Pull Request Overview
This PR updates Terraform configuration by bumping core and provider versions, introduces new Cognito token validity settings, and standardizes resource tagging. It also refines the AWS Cognito user pool client configuration and adjusts CORS origins.
- Bump Terraform
required_versionand provider versions for AWS, local, and archive. - Add Cognito token validity variables with validation and configure
aws_cognito_user_pool_client. - Consolidate
common_tagsin a local block and apply across resources; adjust CORS and archive settings.
Reviewed Changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| terraform/main.tf | Bumped Terraform core and provider version constraints |
| terraform/variables.tf | Added Cognito token validity variables with validation rules |
| terraform/cognito.tf | Enhanced user pool client with token_validity_units and attributes |
| terraform/locals.tf | Defined local.common_tags for consistent tagging |
| terraform/s3.tf | Replaced inline tags with local.common_tags |
| terraform/frontend.tf | Removed duplicate locals, applied local.common_tags |
| terraform/dynamodb.tf | Replaced inline tags with local.common_tags |
| terraform/api.tf | Updated CORS origins to CloudFront domain, applied local.common_tags |
| terraform/lambda.tf | Changed archive to single file, applied local.common_tags |
Comments suppressed due to low confidence (7)
terraform/cognito.tf:27
- [nitpick] Most other resources use
tags = local.common_tagsfor consistent tagging. Consider adding atagsblock here to help with resource identification and cost allocation.
resource "aws_cognito_user_pool_client" "client" {
backend/README.md:10
- The actual script is named
setup_cognito.py, notsetup-cognito.py. Update the README to reference the correct filename.
python setup-cognito.py
tests/test_main.py:241
- The failure test does not verify that the underlying upload function was called. Add
mock_upload.assert_called_once_with("file.txt", "bucket", "key")to ensure the error path invokes the storage adapter.
assert result is False
terraform/lambda.tf:6
- Using
source_filehere will archive only that single file, omitting any other files or dependencies in thelambdadirectory. If your Lambda function has multiple modules or assets, consider reverting tosource_diror explicitly including the entire directory.
source_file = "../lambda/image_processor.py"
frontend/js/components/UploadQueueComponent.js:307
- If
.querySelector(".image-modal-body")returnsnull, this will throw an exception. Add a null check before registering the event handler.
modalBody.addEventListener("wheel", handleWheel);
frontend/js/auth.js:397
- [nitpick] The removal of the special character requirement weakens password strength. Confirm this change aligns with your security policy or consider reintroducing a stronger validation rule.
console.log("✅ AuthManager: Password validation passed");
frontend/css/styles.css:147
- [nitpick] Applying
flex-wrap: nowrap;on thebodymay cause overflow and layout issues on smaller screens. Verify responsive behavior or allow wrapping where appropriate.
flex-wrap: nowrap;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This PR updates Terraform version constraints and provider versions, and refines the AWS Cognito resource configuration to address a region-related issue in Terraform Cloud.
required_versionto>= 1.8.0and update AWS, local, and archive provider versions.aws_cognito_user_pool_clientwith token validity units and attribute settings.