-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: add kubernetes initial config #62 #63
Conversation
italopessoa
commented
May 16, 2024
- add aggregate root
- add initial kubernetes configuration
- refactor mysql docker image
- add serilog
- add seq for log collection
- add aggregate root - add initial kubernetes configuration - refactor mysql docker image - add serilog - add seq for log collection
WalkthroughThe recent updates encompass enhancements across various components of the project. Key changes include the addition of Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (2)
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs (2)
Line range hint
9-20
: Initialize theCpf
property in all constructors.- public Customer() - : base(Guid.NewGuid()) - { - } + public Customer() + : base(Guid.NewGuid()) + { + Cpf = new Cpf(); + } - public Customer(Guid id) - : base(id) - { - } + public Customer(Guid id) + : base(id) + { + Cpf = new Cpf(); + }
Line range hint
56-56
: Fix the potential null reference issue inValidateEmail
.- if (!Regex.IsMatch(email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")) + if (email != null && !Regex.IsMatch(email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (23)
- .docker/setup.sql (4 hunks)
- FIAP.TechChallenge.ByteMeBurger.sln (2 hunks)
- database/Dockerfile (1 hunks)
- database/init.sql (1 hunks)
- docker-compose.yml (3 hunks)
- kubernetes/configmap-api.yaml (1 hunks)
- kubernetes/configmap-db.yaml (1 hunks)
- kubernetes/deployment-api.yaml (1 hunks)
- kubernetes/pod-api.yaml (1 hunks)
- kubernetes/pod-mysql.yaml (1 hunks)
- kubernetes/pv-db.yaml (1 hunks)
- kubernetes/pvc-db.yaml (1 hunks)
- kubernetes/replicaset-api.yaml (1 hunks)
- kubernetes/svc-api-lb.yaml (1 hunks)
- kubernetes/svc-api.yaml (1 hunks)
- kubernetes/svc-mysql.yaml (1 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Api/FIAP.TechChallenge.ByteMeBurger.Api.csproj (1 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Api/Program.cs (3 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Api/appsettings.json (2 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Domain/Base/IAggregateRoot.cs (1 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs (2 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Order.cs (1 hunks)
- src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs (2 hunks)
Files skipped from review due to trivial changes (15)
- .docker/setup.sql
- database/Dockerfile
- kubernetes/configmap-api.yaml
- kubernetes/configmap-db.yaml
- kubernetes/deployment-api.yaml
- kubernetes/pod-api.yaml
- kubernetes/pod-mysql.yaml
- kubernetes/pv-db.yaml
- kubernetes/pvc-db.yaml
- kubernetes/replicaset-api.yaml
- kubernetes/svc-api-lb.yaml
- kubernetes/svc-api.yaml
- kubernetes/svc-mysql.yaml
- src/FIAP.TechChallenge.ByteMeBurger.Api/FIAP.TechChallenge.ByteMeBurger.Api.csproj
- src/FIAP.TechChallenge.ByteMeBurger.Api/appsettings.json
Additional Context Used
GitHub Check Runs (1)
build success (11)
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs: [warning] 15-15:
Non-nullable property 'Cpf' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs: [warning] 20-20:
Non-nullable property 'Cpf' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs: [warning] 56-56:
Possible null reference argument for parameter 'input' in 'bool Regex.IsMatch(string input, string pattern)'.
Path-based Instructions (5)
src/FIAP.TechChallenge.ByteMeBurger.Domain/Base/IAggregateRoot.cs (1)
Pattern
**/*.cs
: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs (1)
Pattern
**/*.cs
: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs (1)
Pattern
**/*.cs
: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Order.cs (1)
Pattern
**/*.cs
: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.src/FIAP.TechChallenge.ByteMeBurger.Api/Program.cs (1)
Pattern
**/*.cs
: Validate all files and structures against Domain Driven Design principles and Ports & Adapters architecture pattern.
Additional comments not posted (10)
src/FIAP.TechChallenge.ByteMeBurger.Domain/Base/IAggregateRoot.cs (1)
1-3
: LGTM! The interfaceIAggregateRoot
is correctly defined.database/init.sql (1)
1-43
: LGTM! The SQL scripts correctly useIF NOT EXISTS
to prevent errors if tables already exist.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Customer.cs (1)
Line range hint
1-7
: LGTM! TheCustomer
class correctly implementsIAggregateRoot
.docker-compose.yml (1)
67-67
: LGTM! The network is correctly defined.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Product.cs (1)
6-6
: The addition of theIAggregateRoot
interface is consistent with Domain Driven Design principles. The rest of the class appears to be well-structured and follows best practices.src/FIAP.TechChallenge.ByteMeBurger.Domain/Entities/Order.cs (1)
6-6
: The addition of theIAggregateRoot
interface is consistent with Domain Driven Design principles. The rest of the class appears to be well-structured and follows best practices.src/FIAP.TechChallenge.ByteMeBurger.Api/Program.cs (3)
23-24
: The Serilog configuration appears to be correctly implemented.
50-71
: The Swagger configuration enhancements appear to be correctly implemented.
97-97
: The Serilog request logging appears to be correctly implemented.FIAP.TechChallenge.ByteMeBurger.sln (1)
39-53
: The addition of Kubernetes configuration files appears to be correctly implemented.
container_name: restaurant_db | ||
build: | ||
context: ./database | ||
dockerfile: Dockerfile | ||
tags: | ||
- techchallenge/db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using mysql_native_password
for the database
service.
- command: --default-authentication-plugin=mysql_native_password
+ # command: --default-authentication-plugin=mysql_native_password
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
container_name: restaurant_db | |
build: | |
context: ./database | |
dockerfile: Dockerfile | |
tags: | |
- techchallenge/db | |
container_name: restaurant_db | |
build: | |
context: ./database | |
dockerfile: Dockerfile | |
tags: | |
- techchallenge/db | |
# command: --default-authentication-plugin=mysql_native_password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for local testing only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@italopessoa Thank you for the clarification. While it's understandable to use mysql_native_password
for local testing, it's important to ensure that this configuration is not used in production environments due to security concerns. If you have any specific reasons for using it locally, please make sure to document them clearly to avoid any accidental usage in production.
If you need any further assistance or have other questions, feel free to ask!