Skip to content

Products Recommendation System#69

Merged
MarJ03 merged 19 commits into
mainfrom
feature/products-recommendation
May 12, 2026
Merged

Products Recommendation System#69
MarJ03 merged 19 commits into
mainfrom
feature/products-recommendation

Conversation

@MarJ03
Copy link
Copy Markdown
Collaborator

@MarJ03 MarJ03 commented May 12, 2026

This pull request introduces several important updates across the backend and CI/CD workflow configurations. The main themes are the standardization and improvement of environment variable usage in GitHub Actions workflows, updates to backend service and repository naming for clarity, the addition of a product recommendations endpoint, and enhancements to test and analysis automation.

Key changes include:

CI/CD Workflow Improvements

  • Standardized environment variable names for MySQL, MongoDB, and MinIO in .github/workflows/full_test_on_pull_request.yml and .github/workflows/sonar_analysis.yml, and updated corresponding service startup steps to use these new names. This includes changing default ports for MySQL (3307), MongoDB (27018), and MinIO (9002/9003), and making MongoDB/MinIO credentials configurable. [1] [2] [3] [4] [5] [6] [7] [8]
  • Added steps to generate SSL certificates for the Angular dev server in both workflows, ensuring secure local development and E2E testing. [1] [2]
  • Improved frontend and backend test automation: now explicitly runs Angular tests with coverage and backend tests in the SonarCloud workflow, and starts Angular for E2E tests in both workflows. [1] [2]

Backend API and Service Layer Updates

  • Renamed UserConnection and UserConnectionRepository to Connection and ConnectionRepository throughout the backend, including all relevant service and controller injections, for clearer and more consistent naming. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated imports and references to match the new naming scheme in various controllers and configuration files. [1] [2]

New Features

  • Added a new endpoint /products/recommendations in ProductRestController to provide paged personalized product recommendations to users.

Build and Project Configuration

  • Updated JaCoCo coverage exclusions in pom.xml to exclude model, DTO, repository, config, and utility classes, improving the accuracy of code coverage metrics.
  • Removed unused SonarQube properties from pom.xml.

MarJ03 added 19 commits May 8, 2026 18:53
Adjust CI workflows, Docker and app configs for local/dev testing: simplify DB credentials, change MySQL port mappings to 3307 for runners, expose real ports in dev compose, and add CORS_ALLOWED_ORIGIN env. Generate short-lived SSL certs in GitHub Actions and start Angular with ng serve (remove proxy-test usage). Make backend CORS origin configurable via app.cors.allowed-origin and update application/test.properties and application.properties accordingly. Switch JWT cookie handling to use Spring ResponseCookie (SameSite=None) and update login/logout methods; improve JWT filter logging to suppress benign missing-cookie errors. Update frontend proxy target to use backend port 8443, remove proxy-test.conf.json, make WebSocket URL protocol/host-aware, add users-management unit tests, and disable Angular CLI analytics.
Replace constructor-based Angular dependency injection with the inject() function in many components. Updated imports to include inject, moved services and tokens to class fields using inject(), removed now-empty constructors, and applied small formatting fixes (e.g. whitespace in admin-home). Changes affect multiple admin, client and common components to reduce constructor boilerplate and centralize DI usage.
Cleanup and reorganization of imports across backend services, controllers, models, repositories and tests; small API/test adjustments; and an update to the admin-home frontend template. Changes include consolidating DTO imports (using wildcard imports where appropriate), reordering and removing unused imports, adding missing model/dto imports (e.g. StatDTO), standardizing Mockito/hamcrest usages in tests, and minor signature/formatter tweaks. The admin-home component template was modified to use conditional @if blocks. No substantial business-logic changes were introduced — mostly cosmetic/import/test updates and minor formatting fixes.
Replace the in-workflow Maven Sonar invocation with the SonarSource/sonarcloud-github-action and add a dedicated backend test step (mvn -B verify -Dspring.profiles.active=test). Add a root sonar-project.properties that centralizes SonarCloud settings (organization, project key, sources/tests, java binaries, exclusions, and coverage report paths for backend/frontend). Remove sonar-specific properties from backend/pom.xml so analysis settings live in the new sonar-project.properties. This centralizes and corrects paths for combined frontend/backend analysis and supplies GITHUB_TOKEN to the action.
Enable code coverage for the frontend test target and add excludes in angular.json, and point the test runner to the karma config. Change Karma's coverage output to 'lcovonly' and add a getter-only property that freezes config.coverageReporter.reporters to prevent Angular 19's esbuild karma builder from overwriting the reporters (preserving LCOV output required by SonarCloud). Update sonar-project.properties exclusions to include the new frontend app and utils paths so Sonar excludes match the coverage config.
Rename and standardize environment variables across workflows, Docker Compose, and Spring config to separate MySQL, MongoDB and MinIO credentials. Key changes:

- GitHub Actions: replace RUNNER_DB_* with RUNNER_MYSQL_*; add RUNNER_MONGODB_USERNAME/PASSWORD and RUNNER_MONGODB_NAME; use these vars in docker run and mongosh invocations; map Mongo to host port 27018 in CI to avoid collisions; add RUNNER_MINIO_BUCKET_NAME.
- Backend configs: application.properties now reads MYSQL_URL/USERNAME/PASSWORD and exposes MONGODB_USERNAME/PASSWORD; application-test.properties updated to use RUNNER_MYSQL_* and to connect to Mongo on localhost:27018 with separate username/password properties.
- Docker Compose (dev, prod, mongo): set MONGO_INITDB_ROOT_USERNAME/PASSWORD to new values, use env refs in Mongo healthchecks, switch DATASOURCE_* to MYSQL_* env names, remove embedded Mongo credentials from MONGODB_URI and add MONGODB_USERNAME/PASSWORD.
- Docs: update .env example to reflect the new variable names and provide example values for MySQL, MongoDB, MinIO and other required variables.

These changes align naming across environments, avoid port conflicts in CI, and centralize credential management via environment variables.
Combine MongoDB username/password into the Spring Data MongoDB URI and adjust docker-compose env values accordingly. application.properties and application-test.properties now build a mongodb://<user>:<pass>@<host> URI using environment variables, and docker-compose.yml / docker-compose-dev.yml provide the host/port/db (without the mongodb:// prefix). This centralizes connection configuration and lets the app assemble the full connection string from separate credential and host env vars.
Add new diagram and QR menu images, and update documentation to include QR scan/show sections. Update SonarQube screenshots and bump reported new-code coverage to 84.77%. Clarify Docker Desktop usage and local DB setup details (MongoDB credentials and MySQL/Mongo tooling), and tweak wording for MinIO certificate step in the development guide.
@MarJ03 MarJ03 linked an issue May 12, 2026 that may be closed by this pull request
@MarJ03 MarJ03 merged commit f57a364 into main May 12, 2026
3 checks passed
@MarJ03 MarJ03 deleted the feature/products-recommendation branch May 12, 2026 12:05
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.

Product Recommendation System

1 participant