From 80cc3825e69839dcab35d1c07d1ce37969163046 Mon Sep 17 00:00:00 2001 From: michele Date: Wed, 11 Mar 2026 15:32:10 +0000 Subject: [PATCH] ops: complete day0 restart commands and fix supporto/modifiche flow --- .../Filament/AdminFilamentPanelProvider.php | 58 +++++------- docs/NETGESCON-MODIFICHE.md | 1 + docs/ai/restart/START-HERE-NETGESCON-DAY0.md | 94 ++++++++++++++++++- scripts/ops/netgescon-add-modifica.sh | 58 ++++++++++++ 4 files changed, 178 insertions(+), 33 deletions(-) create mode 100755 scripts/ops/netgescon-add-modifica.sh diff --git a/app/Providers/Filament/AdminFilamentPanelProvider.php b/app/Providers/Filament/AdminFilamentPanelProvider.php index 42d4be2..a6d3045 100644 --- a/app/Providers/Filament/AdminFilamentPanelProvider.php +++ b/app/Providers/Filament/AdminFilamentPanelProvider.php @@ -78,37 +78,31 @@ public function panel(Panel $panel): Panel }), ]) ->discoverResources(in: app_path('Filament/Resources'), for : 'App\\Filament\\Resources') - ->discoverPages(in: app_path('Filament/Pages'), for : 'App\\Filament\\Pages') { - ->pages([ - Dashboard::class, - PrimaNotaDettaglio::class, - PrimaNotaModifica::class, - ContoMastrino::class, - ]) { - ->discoverWidgets(in: app_path('Filament/Widgets'), for : 'App\\Filament\\Widgets') - ->widgets([ - AccountWidget::class, - GoogleWorkspaceOverview::class, - ]) { - ->middleware([ - EncryptCookies::class, - AddQueuedCookiesToResponse::class, - StartSession::class, - AuthenticateSession::class, - ShareErrorsFromSession::class, - VerifyCsrfToken::class, - SubstituteBindings::class, - DisableBladeIconComponents::class, - DispatchServingFilamentEvent::class, - ]) - ->authMiddleware([ - Authenticate::class, - ]); - } - - } - } - + ->discoverPages(in: app_path('Filament/Pages'), for : 'App\\Filament\\Pages') + ->pages([ + Dashboard::class, + PrimaNotaDettaglio::class, + PrimaNotaModifica::class, + ContoMastrino::class, + ]) + ->discoverWidgets(in: app_path('Filament/Widgets'), for : 'App\\Filament\\Widgets') + ->widgets([ + AccountWidget::class, + GoogleWorkspaceOverview::class, + ]) + ->middleware([ + EncryptCookies::class, + AddQueuedCookiesToResponse::class, + StartSession::class, + AuthenticateSession::class, + ShareErrorsFromSession::class, + VerifyCsrfToken::class, + SubstituteBindings::class, + DisableBladeIconComponents::class, + DispatchServingFilamentEvent::class, + ]) + ->authMiddleware([ + Authenticate::class, + ]); } - } diff --git a/docs/NETGESCON-MODIFICHE.md b/docs/NETGESCON-MODIFICHE.md index 226df69..055f714 100644 --- a/docs/NETGESCON-MODIFICHE.md +++ b/docs/NETGESCON-MODIFICHE.md @@ -16,3 +16,4 @@ # Modifiche NetGescon | 08/03/2026 | 0.8.x-dev | QA Database | Nuovo comando `netgescon:qa-unita-nominativi` per controlli consistenza unita/ruoli/nominativi/anni legacy | [U] | | 16/12/2025 | 0.8.0 | Contabilità / Import FE | Creazione fornitore automatica durante import FE e azione manuale in scheda fattura | [U] | | 16/12/2025 | 0.8.0 | Contabilità / Casse e banche | Avvio estratto conto: filtri periodo/gestione, entrate/uscite/saldo progressivo | [U] | +| 11/03/2026 | 0.8.x-dev | Test pipeline | Verifica script aggiornamento changelog Filament | [P] | diff --git a/docs/ai/restart/START-HERE-NETGESCON-DAY0.md b/docs/ai/restart/START-HERE-NETGESCON-DAY0.md index 1cd1d57..9bba455 100644 --- a/docs/ai/restart/START-HERE-NETGESCON-DAY0.md +++ b/docs/ai/restart/START-HERE-NETGESCON-DAY0.md @@ -11,7 +11,13 @@ ## Stato confermato - Repository Day-0 attivo: `/home/michele/netgescon/netgescon-day0` - Remote Git attivo: `ssh://git@192.168.0.53:2222/michele/netgescon-day0.git` - Branch principale: `main` -- Ultimo commit noto: `f52e56d` +- Ultimo commit noto: `13813fe` + +## Stato supporto/modifiche + +- Errore `500` riprodotto e corretto in sessione. +- Causa: errore sintassi in `app/Providers/Filament/AdminFilamentPanelProvider.php`. +- Stato attuale endpoint: redirect login (`302`) se non autenticato. ## Verifica rapida in 30 secondi @@ -23,6 +29,92 @@ ## Verifica rapida in 30 secondi php artisan list | grep -E "netgescon:update|distribution:manage" | head -n 20 ``` +## Sequenza comandi completa (agent + terminale) + +### A. Preflight Day-0 + +```bash +cd /home/michele/netgescon/netgescon-day0 +git pull --rebase origin main +git status --short --branch +bash scripts/ops/netgescon-day0-legacy-sync.sh +``` + +### B. Dipendenze locali (se necessario) + +```bash +cd /home/michele/netgescon/netgescon-day0 +composer install +npm install +``` + +### C. Riavvio server sviluppo (Day-0) + +```bash +# stop eventuali server precedenti su :8000 +pkill -f "php artisan serve --host=0.0.0.0 --port=8000" || true + +cd /home/michele/netgescon/netgescon-day0 +mkdir -p storage/logs +nohup php artisan serve --host=0.0.0.0 --port=8000 --no-reload > storage/logs/dev-server.log 2>&1 & +sleep 2 +curl -I -sS http://127.0.0.1:8000/up | head -n 1 +``` + +### D. Check pagina Filament modifiche + +```bash +curl -I -sS http://127.0.0.1:8000/admin-filament/supporto/modifiche | head -n 1 +``` + +### E. Aggiornare changelog visibile in Filament + +```bash +cd /home/michele/netgescon/netgescon-day0 +bash scripts/ops/netgescon-add-modifica.sh \ + --area "Filament / Supporto" \ + --desc "" \ + --type U +``` + +Nota: + +- Questa azione aggiorna `docs/NETGESCON-MODIFICHE.md`, letto da `/admin-filament/supporto/modifiche`. + +### F. Backup continuita chat/sessione AI + +```bash +cd /home/michele/netgescon/netgescon-day0 +bash scripts/ai/handoff_checkpoint.sh +bash scripts/ai/topic_checkpoint.sh "NetGescon Day-0" "Checkpoint operativo" +bash scripts/ai/save_periodic_summary.sh "NetGescon Day-0" both +bash scripts/ai/archive_heavy_chats.sh --threshold=150 --dry-run +bash scripts/ai/archive_heavy_chats.sh --threshold=150 --apply +bash scripts/ai/continuity_auto.sh --threshold=150 --topic="NetGescon Day-0" --note="Ripartenza sviluppo" +``` + +### G. Ciclo sviluppo -> Git + +```bash +cd /home/michele/netgescon/netgescon-day0 +git add -A +git commit -m "feat: " +git push origin main +``` + +### H. Ciclo update staging + +```bash +cd /var/www/netgescon +php artisan optimize:clear +php artisan config:clear +php artisan route:clear +php artisan netgescon:update --channel=free +php artisan netgescon:update --channel=free --apply +curl -I -sS "https://staging.netgescon.it/up" | head -n 1 +curl -I -sS "https://staging.netgescon.it/fornitore/tickets?fornitore=1" | head -n 1 +``` + ## Documenti da leggere in ordine (ripartenza agent) 1. `docs/ai/restart/START-HERE-NETGESCON-DAY0.md` (questo file) diff --git a/scripts/ops/netgescon-add-modifica.sh b/scripts/ops/netgescon-add-modifica.sh new file mode 100755 index 0000000..081c058 --- /dev/null +++ b/scripts/ops/netgescon-add-modifica.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Append a structured entry to docs/NETGESCON-MODIFICHE.md +# Used by Filament page: /admin-filament/supporto/modifiche + +DATE_VALUE="$(date +%d/%m/%Y)" +VERSION_VALUE="0.8.x-dev" +AREA_VALUE="" +DESC_VALUE="" +TYPE_VALUE="U" +FILE_PATH="docs/NETGESCON-MODIFICHE.md" + +usage() { + cat <<'EOF' +Usage: + bash scripts/ops/netgescon-add-modifica.sh --area "Area" --desc "Descrizione" [options] + +Options: + --date DD/MM/YYYY Override date (default: today) + --version VERSION Version label (default: 0.8.x-dev) + --area TEXT Functional area (required) + --desc TEXT Description (required) + --type U|P|E|E! Change tag (default: U) + --file PATH Changelog file (default: docs/NETGESCON-MODIFICHE.md) + +Examples: + bash scripts/ops/netgescon-add-modifica.sh \ + --area "Filament / Ticket" \ + --desc "Fix upload allegati e validazione priorita" \ + --type U +EOF +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --date) DATE_VALUE="$2"; shift 2 ;; + --version) VERSION_VALUE="$2"; shift 2 ;; + --area) AREA_VALUE="$2"; shift 2 ;; + --desc) DESC_VALUE="$2"; shift 2 ;; + --type) TYPE_VALUE="$2"; shift 2 ;; + --file) FILE_PATH="$2"; shift 2 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown option: $1" >&2; usage; exit 1 ;; + esac +done + +[[ -n "$AREA_VALUE" ]] || { echo "Missing --area" >&2; exit 1; } +[[ -n "$DESC_VALUE" ]] || { echo "Missing --desc" >&2; exit 1; } +[[ "$TYPE_VALUE" =~ ^(U|P|E|E!)$ ]] || { echo "Invalid --type: $TYPE_VALUE" >&2; exit 1; } +[[ -f "$FILE_PATH" ]] || { echo "File not found: $FILE_PATH" >&2; exit 1; } + +entry="| ${DATE_VALUE} | ${VERSION_VALUE} | ${AREA_VALUE} | ${DESC_VALUE} | [${TYPE_VALUE}] |" +printf '%s\n' "$entry" >> "$FILE_PATH" + +echo "OK" +echo "APPENDED: $entry" +echo "FILE: $FILE_PATH"