Address code review feedback: improve logging, fix redundant check, clarify docs

- Log exceptions at warning level in ConfigService (not debug)
- Include exc_info=True for startup seed failure logging
- Remove redundant `is_secret is not None` guard
- Clarify ★ markers in README environment variables docs

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/ce88d4a8-d8c2-49b3-95a1-30592105a769
This commit is contained in:
copilot-swe-agent[bot]
2026-03-23 13:43:11 +00:00
parent 71a97379a1
commit 2d3b1065b5
3 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
async with async_session_maker() as db:
await ConfigService.seed_defaults(db)
except Exception as exc:
logger.warning("Could not seed default settings: %s", exc)
logger.warning("Could not seed default settings: %s", exc, exc_info=True)
yield
# Shutdown
+9 -6
View File
@@ -190,8 +190,12 @@ class ConfigService:
setting.value, # type: ignore[arg-type]
setting.value_type or "string", # type: ignore[arg-type]
)
except Exception:
logger.debug("DB lookup failed for key=%s, falling back to env", key)
except Exception as exc:
logger.warning(
"DB lookup failed for key=%s, falling back to env: %s",
key,
exc,
)
env_val = os.getenv(key)
if env_val is not None:
@@ -216,8 +220,8 @@ class ConfigService:
setting.value, # type: ignore[arg-type]
setting.value_type or "string", # type: ignore[arg-type]
)
except Exception:
logger.debug("DB bulk lookup failed, falling back to env")
except Exception as exc:
logger.warning("DB bulk lookup failed, falling back to env: %s", exc)
for key in keys:
if key not in result:
@@ -253,8 +257,7 @@ class ConfigService:
existing.value_type = value_type # type: ignore[assignment]
if description is not None:
existing.description = description # type: ignore[assignment]
if is_secret is not None:
existing.is_secret = is_secret # type: ignore[assignment]
existing.is_secret = is_secret # type: ignore[assignment]
if category is not None:
existing.category = category # type: ignore[assignment]
await db.commit()