diff --git a/api/scripts/generate-release-notes.sh b/api/scripts/generate-release-notes.sh index e253e6ba..337c5a2a 100644 --- a/api/scripts/generate-release-notes.sh +++ b/api/scripts/generate-release-notes.sh @@ -2,22 +2,27 @@ set -e # Sürüm notlarını git tag'lerinden üretir: -# api/src/Sozsoft.Platform.HttpApi.Host/release-notes.json +# api/release-notes/release-notes.json # -# Bu dosya API imajına gömülür; uygulama açılışında ReleaseNoteStartupService onu -# `Sas_H_ReleaseNote` tablosuna senkronize eder (yeni tag eklenir, mesajı değişen -# tag güncellenir). Yani YENİ SÜRÜM İÇİN DbMigrator ÇALIŞTIRMAK GEREKMEZ; API'yi -# deploy etmek yeterlidir. İstemci sürüm numarasını ve changelog'u -# application-configuration yanıtındaki `extraProperties.changeLogs` alanından okur. +# Bu dosya API konteynerine /etc/api/release-notes altına MOUNT edilir (imaja +# GÖMÜLMEZ). Uygulama açılışında ReleaseNoteStartupService onu `Sas_H_ReleaseNote` +# tablosuyla eşitler. Yani yeni bir sürüm tag'i için ne DbMigrator ne de imaj +# derlemesi gerekir; deploy sırasında bu script koşar ve konteyner yeniden +# başlar. İstemci sürüm numarasını ve changelog'u application-configuration +# yanıtındaki `extraProperties.changeLogs` alanından okur. # -# Deploy akışında build/api.sh tarafından otomatik çağrılır; elle de -# çalıştırılabilir. Git deposu gerektiği için imajın içinde değil, imaj -# oluşturulmadan ÖNCE build sunucusunda koşar. +# Kaynak ağacının DIŞINDA bir klasöre yazılmasının sebebi Docker katman cache'i: +# dosya `src/` altında olsaydı Dockerfile'daki `COPY . .` her tag'de geçersizleşip +# tüm `dotnet publish` adımını yeniden çalıştırırdı. +# +# Deploy akışında deploy/app.sh tarafından otomatik çağrılır; elle de +# çalıştırılabilir. Çıktı git'e commit EDİLMEZ (.gitignore). # # Dış bağımlılığı yoktur (jq/node gerekmez): JSON kaçışları sed ile yapılır. cd "$(dirname "$0")/.." -OUTPUT="src/Sozsoft.Platform.HttpApi.Host/release-notes.json" +OUTPUT="release-notes/release-notes.json" +mkdir -p "$(dirname "$OUTPUT")" if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then echo "> git deposu yok, ${OUTPUT} güncellenmedi." >&2 diff --git a/api/src/Sozsoft.Platform.Application.Contracts/ReleaseNotes/ReleaseNoteDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/ReleaseNotes/ReleaseNoteDto.cs index 58acfc15..898a19ac 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/ReleaseNotes/ReleaseNoteDto.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/ReleaseNotes/ReleaseNoteDto.cs @@ -7,7 +7,6 @@ public class ReleaseNoteDto : EntityDto { public string Version { get; set; } public DateTime ReleaseDate { get; set; } - public string Commit { get; set; } /// Sürüm notu maddeleri (entity'de satır satır saklanır). public string[] ChangeLog { get; set; } diff --git a/api/src/Sozsoft.Platform.Application/ReleaseNotes/ReleaseNoteAppService.cs b/api/src/Sozsoft.Platform.Application/ReleaseNotes/ReleaseNoteAppService.cs index 5532b2fc..82966175 100644 --- a/api/src/Sozsoft.Platform.Application/ReleaseNotes/ReleaseNoteAppService.cs +++ b/api/src/Sozsoft.Platform.Application/ReleaseNotes/ReleaseNoteAppService.cs @@ -38,7 +38,6 @@ public class ReleaseNoteAppService : PlatformAppService Id = note.Id, Version = note.Version, ReleaseDate = note.ReleaseDate, - Commit = note.Commit, ChangeLog = note.GetChangeLog() }) .ToList(); diff --git a/api/src/Sozsoft.Platform.HttpApi.Host/Extensions/PlatformApplicationConfigurationContributor.cs b/api/src/Sozsoft.Platform.HttpApi.Host/Extensions/PlatformApplicationConfigurationContributor.cs index 5c6f7722..0c2c951a 100644 --- a/api/src/Sozsoft.Platform.HttpApi.Host/Extensions/PlatformApplicationConfigurationContributor.cs +++ b/api/src/Sozsoft.Platform.HttpApi.Host/Extensions/PlatformApplicationConfigurationContributor.cs @@ -40,7 +40,6 @@ public class PlatformApplicationConfigurationContributor : IApplicationConfigura context.ApplicationConfiguration.SetProperty("changeLogs", new { uiVersion = latest?.Version, - buildDate = latest?.ReleaseDate.ToString("yyyy-MM-dd"), tags = latest?.GetChangeLog() ?? [] }); diff --git a/ui/src/services/releaseNote.service.ts b/ui/src/services/releaseNote.service.ts index 5ad4d1d6..16a006e7 100644 --- a/ui/src/services/releaseNote.service.ts +++ b/ui/src/services/releaseNote.service.ts @@ -5,7 +5,6 @@ export interface ReleaseNoteDto { id: string version: string releaseDate: string - commit?: string changeLog: string[] } diff --git a/ui/src/sw.ts b/ui/src/sw.ts index be887671..f5c6d9d4 100644 --- a/ui/src/sw.ts +++ b/ui/src/sw.ts @@ -548,7 +548,6 @@ self.addEventListener('activate', (event) => { (async () => { await cleanup() await self.clients.claim() - await broadcast({ type: 'SW_ACTIVATED' }) })(), ) }) diff --git a/ui/src/views/version/mountAppUpdateDialog.tsx b/ui/src/views/version/mountAppUpdateDialog.tsx index e6e88077..dd72a120 100644 --- a/ui/src/views/version/mountAppUpdateDialog.tsx +++ b/ui/src/views/version/mountAppUpdateDialog.tsx @@ -9,7 +9,7 @@ import AppUpdateDialog from './AppUpdateDialog' */ let root: Root | undefined -export const mountAppUpdateDialog = async () => { +export const mountAppUpdateDialog = () => { if (root) return const host = document.createElement('div') host.id = 'app-update-root' @@ -17,5 +17,3 @@ export const mountAppUpdateDialog = async () => { root = createRoot(host) root.render() } - -export default mountAppUpdateDialog diff --git a/ui/src/views/version/swRegistration.ts b/ui/src/views/version/swRegistration.ts index 31e74278..7bf272f0 100644 --- a/ui/src/views/version/swRegistration.ts +++ b/ui/src/views/version/swRegistration.ts @@ -98,7 +98,6 @@ export type AppUpdateState = { export type VersionInfo = { /** Uygulamanın (UI) çalışan sürümü. */ uiVersion: string - buildDate?: string /** Son sürümün notları. */ tags?: string[] } @@ -244,7 +243,7 @@ function recalculate( * Sürüm bilgisini application-configuration yanıtından alır. * * Store, config'i her yüklediğinde bunu çağırır; ayrı bir sürüm isteği yoktur. - * Yük şekli: `extraProperties.changeLogs = { uiVersion, buildDate, tags[] }`. + * Yük şekli: `extraProperties.changeLogs = { uiVersion, tags[] }`. */ export const setAppVersionInfo = (raw: unknown) => { const data = raw as Partial | undefined @@ -289,7 +288,6 @@ let initialization: Promise | undefined let activating = false let reloading = false let lastCheckAt = 0 -let lastVersionCheckAt = 0 let pollTimer: number | undefined let activationRetryTimer: number | undefined let activationTimeoutTimer: number | undefined @@ -623,7 +621,7 @@ async function showUpdateDialog(status: AppUpdateStatus) { try { const { mountAppUpdateDialog } = await import('./mountAppUpdateDialog') - await mountAppUpdateDialog() + mountAppUpdateDialog() } catch (error) { dialogMountRequested = false console.warn('Güncelleme penceresi yüklenemedi.', error)