quality / commitlint (push) Skipped
quality / changes (push) Successful in 9s
quality / docker-check (push) Skipped
quality / openapi (push) Successful in 46s
quality / web (push) Successful in 1m16s
quality / go (push) Successful in 2m42s
quality / bird2 (push) Successful in 16s
CD / quality (push) Successful in 5m19s
CD / publish (push) Successful in 7m19s
- Deleted unused components: `DashboardActivityTimeline`, `DashboardFramePanel`, `DashboardModulesGrid`, `DashboardRecentJobsGrid`, and `DashboardRecentRevisionsGrid` to streamline the dashboard. - Updated `DashboardKpiGrid` to improve KPI display logic, including progress indicators and enhanced badge functionality. - Refactored `DashboardNetworkHealth` to provide better status representation based on loading states and network conditions. - Introduced new properties for KPI cards to support progress tracking and improved visual feedback. This cleanup aims to enhance performance and maintainability of the dashboard while providing a better user experience.
51 lines
1.5 KiB
Go
51 lines
1.5 KiB
Go
package pipeline
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"evobgp/internal/store"
|
|
)
|
|
|
|
// moduleIngestInputHash fingerprints module config and child entries so snapshots invalidate on CRUD.
|
|
func moduleIngestInputHash(st store.Backend, tenantID string, mod *store.Module) (string, error) {
|
|
return store.ComputeModuleInputHash(st, tenantID, mod)
|
|
}
|
|
|
|
func persistModuleSnapshot(st store.Backend, tenantID string, mod *store.Module, rows []store.PrefixRow) error {
|
|
if st == nil || mod == nil {
|
|
return nil
|
|
}
|
|
hash, err := moduleIngestInputHash(st, tenantID, mod)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err := st.SetModulePrefixSnapshot(tenantID, mod.ID, hash, rows); err != nil {
|
|
return err
|
|
}
|
|
_ = st.SetModuleInputHash(tenantID, mod.ID, hash)
|
|
return nil
|
|
}
|
|
|
|
func moduleRowsFromSnapshot(st store.Backend, tenantID string, mod *store.Module) ([]store.PrefixRow, bool, error) {
|
|
snap, ok, err := st.GetModulePrefixSnapshot(tenantID, mod.ID)
|
|
if err != nil || !ok || snap == nil {
|
|
return nil, false, err
|
|
}
|
|
if h := strings.TrimSpace(mod.InputHash); h != "" {
|
|
if snap.InputHash != h {
|
|
return nil, false, nil
|
|
}
|
|
return append([]store.PrefixRow(nil), snap.Prefixes...), true, nil
|
|
}
|
|
// Fallback for rows written before module.input_hash existed: recompute and backfill.
|
|
hash, err := moduleIngestInputHash(st, tenantID, mod)
|
|
if err != nil {
|
|
return nil, false, err
|
|
}
|
|
if snap.InputHash != hash {
|
|
return nil, false, nil
|
|
}
|
|
_ = st.SetModuleInputHash(tenantID, mod.ID, hash)
|
|
return append([]store.PrefixRow(nil), snap.Prefixes...), true, nil
|
|
}
|