Skip to content

Add tag test - #4

Open
miguelRodr1gues wants to merge 26 commits into
mainfrom
add-tag-test
Open

miguelRodr1gues wants to merge 26 commits into
mainfrom
add-tag-test

Conversation

@miguelRodr1gues

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds AWS infrastructure automation and optional SQS-based messaging between product-service (producer) and order-service (consumer), alongside Terraform refactors, containerization, and CI workflows.

Changes:

  • Introduces optional AWS SQS producer/consumer wiring in Java services (Spring Boot config + tests).
  • Adds modular Terraform stacks (Week 8 refactor + reusable infra/terraform) and SQS Terraform (Week 10 lab) plus various helper scripts/Ansible.
  • Adds Dockerfiles/docker-compose and GitHub Actions workflows for CI, image builds, and Terraform.

Reviewed changes

Copilot reviewed 94 out of 172 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/create_resources.py Adds boto3 script to create S3 bucket + EC2 instance
tools/aws_validator.py Adds boto3 script to validate S3/EC2 permissions
terraform weeks/terraform-week8/variables.tf Defines validated inputs for modular Week 8 Terraform stack
terraform weeks/terraform-week8/terraform.tfvars Provides non-secret defaults for Week 8 stack
terraform weeks/terraform-week8/outputs.tf Exposes network/compute/db outputs for Week 8 stack
terraform weeks/terraform-week8/modules/vpc/variables.tf VPC module inputs + validation
terraform weeks/terraform-week8/modules/vpc/outputs.tf VPC module outputs
terraform weeks/terraform-week8/modules/vpc/main.tf VPC module resources (subnets/RTs/IGW)
terraform weeks/terraform-week8/modules/rds/variables.tf RDS module inputs + validation
terraform weeks/terraform-week8/modules/rds/outputs.tf RDS module outputs
terraform weeks/terraform-week8/modules/rds/main.tf RDS instance + SG + subnet group
terraform weeks/terraform-week8/modules/ec2/variables.tf EC2 module inputs + validation
terraform weeks/terraform-week8/modules/ec2/outputs.tf EC2 module outputs
terraform weeks/terraform-week8/modules/ec2/main.tf EC2 instance + SG with dynamic ingress rules
terraform weeks/terraform-week8/main.tf Root composition for Week 8 modules
terraform weeks/terraform-week8/README.md Documents Week 8 modular Terraform usage
terraform weeks/terraform-week7/vpc.tf Adds Week 7 VPC infra (non-modular baseline)
terraform weeks/terraform-week7/variables.tf Adds Week 7 variables
terraform weeks/terraform-week7/terraform.tfvars Adds Week 7 tfvars (includes DB password)
terraform weeks/terraform-week7/security_groups.tf Adds Week 7 EC2/RDS security groups
terraform weeks/terraform-week7/rds.tf Adds Week 7 RDS instance
terraform weeks/terraform-week7/outputs.tf Adds Week 7 outputs
terraform weeks/terraform-week7/main.tf Adds Week 7 provider + AMI data source
terraform weeks/terraform-week7/ec2.tf Adds Week 7 EC2 + EIP
services/user-service/build-and-push.ps1 Adds helper to build/push Docker images
services/user-service/Dockerfile Adds multi-stage build for user-service
services/product-service/src/test/java/pt/ulusofona/productservice/sqs/ProductEventSqsPublisherTest.java Adds unit test for SQS publisher payload
services/product-service/src/main/java/pt/ulusofona/productservice/sqs/ProductSqsProperties.java Adds configuration properties for product SQS integration
services/product-service/src/main/java/pt/ulusofona/productservice/sqs/ProductSqsConfiguration.java Adds conditional wiring for SQS client + publisher
services/product-service/src/main/java/pt/ulusofona/productservice/sqs/ProductEventSqsPublisher.java Adds SQS message publishing logic
services/product-service/src/main/java/pt/ulusofona/productservice/event/ProductCreatedSqsEvent.java Adds SQS event payload record
services/product-service/Dockerfile Adds multi-stage build for product-service
services/order-service/src/test/java/pt/ulusofona/orderservice/sqs/ProductEventSqsPollingConsumerTest.java Adds unit test for SQS polling consumer
services/order-service/src/main/java/pt/ulusofona/orderservice/sqs/ProductEventSqsPollingConsumer.java Adds scheduled SQS long-poll consumer
services/order-service/src/main/java/pt/ulusofona/orderservice/sqs/ProductCreatedSqsPayload.java Adds deserialization payload record
services/order-service/src/main/java/pt/ulusofona/orderservice/sqs/OrderProductEventsSqsProperties.java Adds configuration properties for order-service SQS consumer
services/order-service/src/main/java/pt/ulusofona/orderservice/sqs/OrderProductEventsSqsConfiguration.java Adds conditional wiring for SQS client + consumer
services/order-service/Dockerfile Adds multi-stage build for order-service
services/api-gateway/Dockerfile Adds multi-stage build for api-gateway
scripts/testInstance.sh Adds AWS CLI scripting to create SG + EC2 and print public IP
scripts/launch-ec2.sh Adds simple AWS CLI EC2 launcher script
scripts/deploy-container.sh Adds Docker-based deploy script for user-service
scripts/create-vpc.sh Adds AWS CLI VPC creation script
product-service/src/test/resources/application-test.yml Disables SQS by default in product-service tests
product-service/src/test/java/pt/ulusofona/productservice/service/ProductServiceTest.java Updates unit test wiring to include optional publisher provider
product-service/src/test/java/pt/ulusofona/productservice/service/ProductServiceParameterizedTest.java Updates parameterized test wiring to include optional publisher provider
product-service/src/test/java/pt/ulusofona/productservice/model/ProductTest.java Adds an additional (currently failing) test
product-service/src/main/resources/application.yml Adds optional SQS configuration defaults
product-service/src/main/java/pt/ulusofona/productservice/service/ProductService.java Publishes SQS event after product creation when enabled
product-service/src/main/java/pt/ulusofona/productservice/ProductServiceApplication.java Enables configuration properties for Product SQS settings
product-service/pom.xml Adds AWS SDK BOM + SQS dependency
order-service/src/test/resources/application-test.yml Disables SQS consumer by default in order-service tests
order-service/src/main/resources/application.yml Adds optional SQS consumer configuration defaults
order-service/src/main/java/pt/ulusofona/orderservice/OrderServiceApplication.java Enables scheduling + properties for SQS consumer
order-service/pom.xml Adds AWS SDK BOM + SQS dependency
infra/week9-sqs/variables.tf Adds variables for SQS + DLQ Terraform
infra/week9-sqs/outputs.tf Exposes queue URLs/ARNs
infra/week9-sqs/main.tf Creates standard queue, DLQ, and FIFO queue
infra/week9-sqs/fifo_vs_standard_sqs.txt Documents FIFO vs standard SQS differences
infra/week9-sqs/README.md Documents SQS Terraform usage and env wiring
infra/terraform/variables.tf Adds reusable modular Terraform variables (project infra)
infra/terraform/outputs.tf Adds reusable modular Terraform outputs
infra/terraform/main.tf Adds reusable modular Terraform root composition
infra/terraform/backend.tf Adds commented backend example
infra/terraform/README.md Documents reusable Terraform stack
infra/terraform/modules/vpc/variables.tf VPC module inputs for reusable stack
infra/terraform/modules/vpc/outputs.tf VPC module outputs for reusable stack
infra/terraform/modules/vpc/main.tf VPC module implementation for reusable stack
infra/terraform/modules/rds/variables.tf RDS module inputs for reusable stack
infra/terraform/modules/rds/main.tf RDS module implementation for reusable stack
infra/terraform/modules/ec2/variables.tf EC2 module inputs for reusable stack
infra/terraform/modules/ec2/outputs.tf EC2 module outputs for reusable stack
infra/terraform/modules/ec2/main.tf EC2 module implementation for reusable stack
infra/policies/trust-policy.json Adds EC2 assume-role trust policy
infra/policies/student-policy.json Adds sample least-privilege-ish student policy
infra/ansible/roles/docker/tasks/main.yml Adds Docker install/start and user group management tasks
infra/ansible/roles/docker/handlers/main.yml Adds docker restart handler
infra/ansible/roles/docker/defaults/main.yml Defines default docker_users
infra/ansible/playbook.yml Applies docker role to web servers
infra/ansible/inventory.ini Adds inventory with host + SSH settings
infra/ansible/deploy-app.yml Adds docker-based app deployment playbook
infra/ansible/configure-ec2.yml Adds full EC2 configuration + build + systemd deployment playbook
infra/README.md Adds infra folder index
docker-compose.yml Implements full local stack with Kafka/Zookeeper + services
README.md Updates local run + troubleshooting + SQS lab notes
.github/workflows/terraform.yml Adds Terraform PR plan/apply workflow
.github/workflows/reusable-image.yml Adds reusable workflow for building/pushing Docker images
.github/workflows/release.yml Adds tag-triggered release build using reusable workflow
.github/workflows/image.yml Adds main-branch image build & push (product-service)
.github/workflows/hello.yml Adds hello-world Actions workflow
.github/workflows/deploy.yml Adds placeholder deploy workflow
.github/workflows/ci.yml Adds Maven build/test CI for services/product-service
.github/workflows/build-all.yml Adds Docker build/push matrix for services
.github/workflows/aws-test.yml Adds manual AWS OIDC whoami workflow
Comments suppressed due to low confidence (4)

terraform weeks/terraform-week7/terraform.tfvars:1

  • A plaintext database password is committed in terraform.tfvars. This is a secrets leak and will persist in git history. Remove the password from the repo (and rotate it), use TF_VAR_db_password / a secrets manager, and commit a terraform.tfvars.example instead.
    services/product-service/src/main/java/pt/ulusofona/productservice/sqs/ProductEventSqsPublisher.java:1
  • Exposing throws Exception forces callers to handle an overly broad checked exception and makes the API harder to use correctly. Consider narrowing to specific exceptions (e.g., JSON serialization + AWS SDK exceptions) or catching/wrapping internally into an unchecked exception so ProductService can handle failures consistently.
    tools/aws_validator.py:1
  • json is imported but not used anywhere in this file. Remove the unused import to avoid lint issues and reduce noise.
    infra/terraform/modules/vpc/outputs.tf:1
  • Sorting keys(...) sorts strings lexicographically, which can produce unexpected ordering once you have 10+ subnets (e.g., \"10\" comes before \"2\"). If ordering matters, sort numerically (convert keys to numbers for sorting, then index back).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/terraform.yml Outdated
Comment on lines +4 to +8
pull_request:
paths: [ 'terraform/**' ]
push:
branches: [ main ]
paths: [ 'terraform/**' ]
Comment thread .github/workflows/terraform.yml Outdated
Comment on lines +19 to +21
defaults:
run:
working-directory: terraform
state: started
restart_policy: unless-stopped
ports:
- "8080:8080" No newline at end of file
Comment thread README.md
docker-compose up -d zookeeper kafka

# Or install Kafka locally and start it
docker-compose -f docker-compose.yml up -d
Comment on lines +1 to +6
[web_servers]
web1 ansible_host=3.121.207.103 ansible_user=ec2-user ansible_common_remote_group=ansible-deploy

[all:vars]
ansible_ssh_private_key_file=~/.ssh/miguelrodr1_lf.pem
ansible_python_interpreter=/usr/bin/python3 No newline at end of file
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.

3 participants