Add service update notification and version check enhancements
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 9s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
All checks were successful
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 9s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Introduced a front-end mechanism to notify users of available service updates and enhanced the service info page to reflect update status dynamically. Removed backend audit log writes for version checks to streamline operations and improve performance. Updated styling to visually highlight update notifications.
This commit is contained in:
@@ -11,7 +11,6 @@ from app.core.db import get_db
|
||||
from app.core.deps import get_current_user
|
||||
from app.models.models import ServiceInfoSettings, User
|
||||
from app.schemas.service_info import ServiceInfoCheckResult, ServiceInfoOut
|
||||
from app.services.audit import write_audit_log
|
||||
from app.services.service_info import (
|
||||
UPSTREAM_REPO_WEB,
|
||||
fetch_latest_from_upstream,
|
||||
@@ -71,6 +70,7 @@ async def check_service_version(
|
||||
user: User = Depends(get_current_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
) -> ServiceInfoCheckResult:
|
||||
_ = user
|
||||
row = await _get_or_create_service_settings(db)
|
||||
check_time = utcnow()
|
||||
latest, latest_ref, error = await fetch_latest_from_upstream()
|
||||
@@ -85,17 +85,6 @@ async def check_service_version(
|
||||
row.update_available = False
|
||||
await db.commit()
|
||||
await db.refresh(row)
|
||||
await write_audit_log(
|
||||
db,
|
||||
"service.info.check",
|
||||
user.id,
|
||||
{
|
||||
"latest_version": row.latest_version,
|
||||
"latest_ref": row.release_check_url,
|
||||
"update_available": row.update_available,
|
||||
"last_check_error": row.last_check_error,
|
||||
},
|
||||
)
|
||||
return ServiceInfoCheckResult(
|
||||
latest_version=row.latest_version,
|
||||
latest_ref=(row.release_check_url or None),
|
||||
|
||||
Reference in New Issue
Block a user