diff --git a/code/services/comment-service/src/server.go b/code/services/comment-service/src/server.go index 6eabede..747c049 100644 --- a/code/services/comment-service/src/server.go +++ b/code/services/comment-service/src/server.go @@ -160,6 +160,24 @@ func (s *CommentServer) DeleteComment(ctx context.Context, req *commentpb.Delete return nil, err } + // find all child comments + comments, err := s.ListComments(ctx, &commentpb.ListCommentsRequest{ + ThreadId: &res.Id, + }) + if err != nil { + return nil, err + } + + // delete child comments + for _, comment := range comments.Comments { + _, err = s.DeleteComment(ctx, &commentpb.DeleteCommentRequest{ + Id: comment.Id, + }) + if err != nil { + return nil, err + } + } + // delete comment _, err = s.DBClient.DeleteComment(ctx, &dbpb.DeleteCommentRequest{ Id: req.Id, diff --git a/docs/phases/phase10.md b/docs/phases/phase10.md index d92fb39..5987a88 100644 --- a/docs/phases/phase10.md +++ b/docs/phases/phase10.md @@ -1,3 +1,3 @@ ## 🔍 Phase 10 - Final Report -TODO \ No newline at end of file +The project final report can be found [here](../report/threadit_grupo8_final_report.pdf). \ No newline at end of file diff --git a/docs/phases/phase3.md b/docs/phases/phase3.md index c429869..579a1ff 100644 --- a/docs/phases/phase3.md +++ b/docs/phases/phase3.md @@ -41,4 +41,4 @@ ### 📦 Application Architecture -![Application architecture](../images/architecture.png) \ No newline at end of file +![Application architecture](../images/application-architecture.png) \ No newline at end of file diff --git a/docs/phases/phase6.md b/docs/phases/phase6.md index c67449e..7485b3b 100644 --- a/docs/phases/phase6.md +++ b/docs/phases/phase6.md @@ -2,13 +2,10 @@ ## 1. Planned Improvements -### 1.1 Ingress/API Gateway Configuration +### 1.1 API Gateway Configuration -Currently, we are using Traefik with a basic IngressRoute and minimal configuration. To improve flexibility and take advantage of Kubernetes-native features, we will explore two alternatives: - -- **Kubernetes Ingress with Traefik:** This allows using standard Ingress resources with Traefik's CRDs for fine-grained traffic routing, TLS termination, and middleware chaining. - -- **Kubernetes Gateway API:** A more expressive and extensible alternative to the Ingress API, which decouples traffic routing from infrastructure. We'll experiment with it alongside Traefik's Gateway API support to modernize our networking layer. +The application will use a Traefik instance installed and configured via Helm. +An IngressRoute and some Middlewares will be defined to ensure that Traefik routes the incoming requests to the gRPC Gateway. ### 1.2 Liveness and Readiness Probes To improve fault tolerance and enable better self-healing behavior in Kubernetes, we will define: @@ -22,9 +19,6 @@ We will benchmark services to determine ideal values for: * **CPU and memory resource requests/limits**. * **Horizontal Pod Autoscaling (HPA)** thresholds based on real traffic patterns to ensure scalability. -### 1.4 Authentication & Authorization with Keycloak -We will introduce authentication and authorization by integrating [Keycloak](https://www.keycloak.org/) as the Identity Provider. Keycloak will manage user sessions, tokens (OIDC) and Role-Based Access Control (RBAC) across the services. - ### 1.5 Secret management To further improve security we will explore Google Secret Manager for managing sensitive configuration data such as API keys, credentials and tokens. This approach provides: @@ -49,18 +43,20 @@ A continuous integration and deployment (CI/CD) pipeline will be implemented usi | --------------- | -------------------------------------------------------------------------- | | Scalability | Use HPA to autoscale services based on CPU usage. | | Availability | Configure liveness/readiness probes and multiple replicas where necessary. | -| Security | Enforce authentication and authorization via Keycloak. | | Maintainability | Implement CI/CD for consistent, automated deployments. | ## 3. Deployment Plan -| Step | Tool/Technology | -| ------------------------------- | --------------------- | -| Containerization | Docker | -| Cluster Orchestration | Kubernetes (GKE) | -| Ingress Management | GKE Native Ingress | -| Identity and Access Management | Keycloak (OIDC, RBAC) | -| CI/CD | GitHub Actions + GKE | -| Autoscaling | Kubernetes HPA | +| Step | Tool/Technology | +| ------------------------------- |----------------------------| +| Containerization | Docker | +| Cluster Orchestration | Kubernetes (GKE) | +| Ingress Management | Traefik Ingress Controller | +| CI/CD | GitHub Actions | +| Autoscaling | Kubernetes HPA | ## 4. Architecture Diagram -![application architecture](../images/architecture.png) +![Application architecture](../images/application-architecture.png) + +## 5. Technical Architecture + +![Technical architecture](../images/technical-architecture.png) diff --git a/docs/phases/phase9.md b/docs/phases/phase9.md index 09d3116..c93c96c 100644 --- a/docs/phases/phase9.md +++ b/docs/phases/phase9.md @@ -1,3 +1,3 @@ ## 🔍 Phase 9 - System Testing -TODO \ No newline at end of file +This phase can be found under the chapter 8 of the final [report](../report/threadit_grupo8_final_report.pdf). \ No newline at end of file diff --git a/docs/report/threadit_grupo8_final_report.pdf b/docs/report/threadit_grupo8_final_report.pdf new file mode 100644 index 0000000..202501f Binary files /dev/null and b/docs/report/threadit_grupo8_final_report.pdf differ