diff --git a/AGENTS.md b/AGENTS.md index 9c089229..16215e2e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,94 +1,22 @@ -# CI to Local Workflow Guide +# MAPO-CORE Agent Instructions -This document describes how the GitLab CI pipeline in this repository translates to local commands that can be run on your machine. It also contains helper scripts and environment variables used by the CI. +## Core Context +- **Primary Goal**: Optimization and refactoring of the `MP-SPEC.sln` solution, focusing on migrating legacy Redis/DB caching to `FusionCache` (Memory + Redis + DB) in `MP.SPEC\Data\MpDataService.cs`. +- **Language**: C# (primary), PowerShell (scripts). +- **Documentation/Comments**: MUST be in **Italiano**. +- **Code Style**: Maintain existing region organization (`#region Public Methods`, etc.). -## Environment Variables -All variables listed below are interpolated in the CI templates. When running locally you can set them in a PowerShell profile or via `dotnet` arguments. +## Development Workflow +- **Build & Verification**: + - Use a PowerShell script to build the solution to ensure continuous compilability. + - Always verify that changes do not leave partial traces of old classes that break compilation. +- **Refactoring Strategy (`MpDataService.cs`)**: + - Use `GetOrFetchAsync(string operationName, string cacheKey, Func> fetchFunc, TimeSpan expiration, params string[] tags)` as the standard for all data access. + - Target methods currently using manual `redisDb.StringGetAsync` / `StringSetAsync` patterns. +- **Testing**: + - Check the codebase for existing testing patterns before proposing new ones. -| Variable | Description | Typical value | -|----------|--------------|---------------| -| `SOL_NAME` | Solution name to restore | **MP-STATS.sln** | -| `PROJ_PATH` | Directory containing the main project | **MP.Stats** | -| `APP_NAME` | Main project file name (without `.csproj`) | **MP.Stats** | -| `NUGET_PATH` | NuGet credential file | **`C:\\Users\\samuele.steamw\AppData\Roaming\NuGet\Credentials.config`** | -| `NEXUS_PATH` | Nexus host URL | **https://nexus.steamware.net** | -| `DEST` | Artifacts output folder | **bin\publish** | -| `VERS_MAIN`, `VERS_MAIN_APP`, `VERSSUB` | Version strings used in packaging | **1.0.0** / -| `NEXUS_PASSWD` | Nexus password (secure via CI secret) | *Secret* | - -## Build Pipeline (`buildjob`) – Local Equivalent - -The CI first restores NuGet packages and then builds the solution for the selected `APP_NAME`. - -```powershell -# 1. Restore -#$env:SOL_NAME.sln is resolved by the .nuget-fix script -# In PowerShell: dotnet restore "MP-STATS.sln" - -# 2. Build -# $env:APP_NAME/$env:APP_NAME.csproj points to the project file -# In PowerShell: dotnet build "MP.Stats/MP.Stats.csproj" -``` - -### Helper: `.nuget-fix` -The `.nuget-fix` PowerShell script removes any stale NuGet sources that conflict with the Nexus proxy and re‑adds the latest proxy source with credentials. Ensure this script runs *before* `dotnet restore`. - -## Deploy Pipeline (`deployjob`) – Local Equivalent - -Deployment in CI rebuilds the project, publishes it, hashes the output, and uploads it to Nexus. The same steps can be executed locally. - -```powershell -# 1. Rebuild (same as Build) -# dotnet build "MP.Stats/MP.Stats.csproj" - -# 2. Publish to a local folder -# The `dotnet publish` command mimics the CI publish step. The `-c Release` ensures a Release build. -# In PowerShell: -# dotnet publish "MP.Stats/MP.Stats.csproj" -c Release -o publish - -# 3. Create hashes (MD5 & SHA1) -# The .hashBuild template generates .md5 and .sha1 files alongside the ZIP. A simple replacement can be -# 1. Zip the folder: `Compress-Archive -Path publish -DestinationPath $(APP_NAME).zip` -# 2. Generate hashes: -# (Get-FileHash -Algorithm MD5 "$(APP_NAME).zip").Hash | Out-File "$(APP_NAME).md5" -# (Get-FileHash -Algorithm SHA1 "$(APP_NAME).zip").Hash | Out-File "$(APP_NAME).sha1" - -# 4. Upload to Nexus (requires `curl`) -# Example curl command (CI uses `nexus-curl` script): -# $curl -u $(NUGET_USER):$(NEXUS_PASSWD) "$(NEXUS_PATH)/repository/$(APP_NAME)" -T "$(APP_NAME).zip" -``` - -## Installer & Release -The **installer** template copies the published artifacts to a staging folder and optionally creates installers. The **release** template bumps version numbers, updates the `nuspec`, generates a changelog, and pushes the packages to Nexus. - -Generally these steps are CI‑only, but you can repeat the same `dotnet pack` / `nuget push` commands locally if needed. - -## Common Issues & Fixes - -* _NuGet authentication errors_: Run `.nuget-fix` to reset the sources. -* _Missing SDK_: Verify `dotnet --list-sdks` includes at least one SDK. -* _Hashes not matching_: Ensure the ZIP file is identical to the one CI produced (same path, no hidden files). - -## Quick Start -```powershell -# Restore -.\.nuget-fix - -# Build - -dotnet restore "MP-STATS.sln" -dotnet build "MP.Stats/MP.Stats.csproj" - -# Publish & run - -dotnet publish "MP.Stats/MP.Stats.csproj" -c Release -o publish -dotnet run --project "MP.Stats/MP.Stats.csproj" - -# For hot‑reload during development - -dotnet watch run --project "MP.Stats/MP.Stats.csproj" -``` - ---- - -Feel free to adjust paths or environment variable names if your local setup differs. +## Architecture Notes +- **Multi-Layer Caching**: The system is transitioning from a dual-layer (Redis + DB) to a triple-layer approach via `IFusionCache`. +- **Service Responsibility**: `MpDataService` is the central hub for data access, interacting with `MpSpecController` (EFCore) and `MpMongoController` (MongoDB). +- **Key Management**: Cache keys are heavily managed via `Utils.redis...` constants. diff --git a/AGENTS.pdf b/AGENTS.pdf new file mode 100644 index 00000000..be4b911e Binary files /dev/null and b/AGENTS.pdf differ diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index bbf38c07..5cae1802 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 8.16.2605.2712 + 8.16.2605.2714 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Pages/Articoli.razor b/MP.SPEC/Pages/Articoli.razor index c6c7fb6c..e20b654c 100644 --- a/MP.SPEC/Pages/Articoli.razor +++ b/MP.SPEC/Pages/Articoli.razor @@ -19,10 +19,10 @@
- + - @if (ListAziende != null) { foreach (var item in ListAziende) @@ -31,6 +31,8 @@ } } + +
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 5cc963d2..f9337c57 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 8.16.2605.2712

+

Versione: 8.16.2605.2714


Note di rilascio: