docs: documentation for validate/sonar-test-nest4 #21

Merged
andrej merged 2 commits from documentor-validate-sonar-test-nest4-1a23c5f4 into main 2026-05-21 08:08:24 +00:00
Showing only changes of commit e4f1f8c9cb - Show all commits

View File

@@ -1,7 +1,7 @@
--- ---
title: "sonar-test-nest4" title: "sonar-test-nest4"
generated_by: documentor-agent generated_by: documentor-agent
generated_at: "2026-05-18T10:03:38+00:00" generated_at: "2026-05-21T07:55:31+00:00"
human_edited: false human_edited: false
source_entity: "Component/default/sonar-test-nest4" source_entity: "Component/default/sonar-test-nest4"
source_repo: "https://gitea.kyndemo.live/validate/sonar-test-nest4" source_repo: "https://gitea.kyndemo.live/validate/sonar-test-nest4"
@@ -9,9 +9,9 @@ source_repo: "https://gitea.kyndemo.live/validate/sonar-test-nest4"
## Overview ## Overview
`sonar-test-nest4` is a stateless microservice built using the `typescript-nestjs` runtime. It was scaffolded from the **Create Microservice** golden-path template on the Kyndryl Platform. The service provides a REST API for managing items, including CRUD operations, and exposes observability endpoints for health checks and Prometheus metrics. `sonar-test-nest4` is a stateless microservice built using the `typescript-nestjs` runtime. It was scaffolded from the **Create Microservice** golden-path template on the Kyndryl Platform. The service provides a REST API for managing items, including CRUD operations, and is instrumented with OpenTelemetry for observability. It is designed to integrate seamlessly into the platform's CI/CD pipeline, leveraging Humanitec for deployment orchestration and Azure Container Registry for image storage.
This service plays a key role in the broader system by offering a scalable and observable backend for item management. It is deployed using Humanitec's API-driven deployment model, leveraging Azure Kubernetes Service (AKS) and Azure Container Registry (ACR). The CI/CD pipeline automates builds, tests, and deployments across development, staging, and production environments. The service plays a critical role in the demo-apps domain, showcasing best practices for microservice development, deployment, and observability. It is managed by the platform engineering team and adheres to a strict branch promotion model to ensure quality and stability across environments.
## Repository ## Repository
@@ -24,52 +24,54 @@ This service plays a key role in the broader system by offering a scalable and o
## Architecture ## Architecture
`sonar-test-nest4` follows a modern microservice architecture with the following components: `sonar-test-nest4` follows a modern microservice architecture:
- **Runtime**: `typescript-nestjs` - **Runtime**: `typescript-nestjs`
- **Container Port**: `3000` - **Container Port**: `3000`
- **Endpoints**: - **Endpoints**:
- `/api/items` for CRUD operations - `/api/items` for CRUD operations on items.
- `/health` for health checks - `/health` for health checks.
- `/metrics` for Prometheus metrics - `/metrics` for Prometheus-compatible metrics.
- **Deployment Flow**: - **Deployment Flow**:
- Push to `dev`, `staging`, or `prod` triggers CI/CD workflows: - CI/CD pipelines in Gitea Actions handle build, test, and deployment.
- `build-push.yml`: Builds and tests the service, then pushes the container image to Azure Container Registry. - Images are pushed to Azure Container Registry (`bstagecjotdevacr`).
- `deploy-humanitec.yml`: Deploys the service to AKS using Humanitec's Score-based deployment model. - Humanitec orchestrates deployments to AKS using Score files.
- **Branch Model**:
- `dev`: Active development, auto-deploys to the dev environment. The service is designed for scalability and observability, with OpenTelemetry instrumentation and Prometheus metrics exposed at `/metrics`.
- `staging`: Pre-production, promoted from `dev` via PR.
- `prod`: Production, promoted from `staging` via PR.
- `main`: System of record, receives merges from `prod`.
## Configuration ## Configuration
| Config Key | Value | | Config Key | Value |
|------------------|-------------------| |------------------|------------------|
| `runtime` | `typescript-nestjs` | | `runtime` | `typescript-nestjs` |
| `health_path` | `/health` | | `health_path` | `/health` |
| `container_port` | `3000` | | `container_port` | `3000` |
Additional configuration details are managed via `.platform/config.yaml` and Humanitec Score files.
## Operations ## Operations
### Deployment Steps ### Deployment Steps
1. Push changes to the `dev` branch for automatic deployment to the dev environment. 1. Push changes to the `dev` branch for automatic deployment to the development environment.
2. Open a PR to promote changes from `dev` to `staging`. Ensure CI tests pass and obtain one approval. 2. Open a PR for promotion to `staging` or `prod`. Ensure CI tests pass and obtain one approval.
3. Open a PR to promote changes from `staging` to `prod`. Ensure CI tests pass and obtain one approval. 3. Merge PR to trigger deployment to the target environment.
4. Merge changes from `prod` to `main` for system-of-record updates.
### Observability Endpoints ### Runbook Notes
- `/health`: Returns `{"status":"UP"}` for health checks. - **Health Check**: Verify service health at `/health`.
- `/metrics`: Exposes Prometheus metrics for monitoring. - **Metrics**: Monitor Prometheus metrics at `/metrics`.
- **Promotion Flow**:
- `dev → staging`: Requires CI gate and approval.
- `staging → prod`: Requires CI gate and approval.
- `prod → main`: Merge via PR after release.
## Observability ## Observability
- **Grafana Dashboard**: [Opentelemetry Application Observability](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=sonar-test-nest4) - **Grafana Dashboard**: [OpenTelemetry Application Observability](https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=sonar-test-nest4)
- **Prometheus Metrics**: Enabled (`/metrics` endpoint). - **Prometheus Metrics**: Exposed at `/metrics`.
- **Chaos Mesh**: Enabled for resilience testing.
- **K6 Load Testing**: Configured via `k6-test-sonar-test-nest4` in the `dev` namespace. _Chaos Mesh and K6 load testing are enabled for this service._
## Dependencies ## Dependencies