mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
fix: improve update check logic and UTC log clarity (#587)
This commit is contained in:
@@ -404,7 +404,7 @@ kleinanzeigen_bot/update_checker.py:
|
||||
_get_release_commit:
|
||||
"Could not get release commit: %s": "Konnte Release-Commit nicht ermitteln: %s"
|
||||
check_for_updates:
|
||||
"A new version is available: %s from %s (current: %s from %s, channel: %s)": "Eine neue Version ist verfügbar: %s vom %s (aktuell: %s vom %s, Kanal: %s)"
|
||||
"A new version is available: %s from %s UTC (current: %s from %s UTC, channel: %s)": "Eine neue Version ist verfügbar: %s vom %s UTC (aktuell: %s vom %s UTC, Kanal: %s)"
|
||||
"Could not determine commit dates for comparison.": "Konnte Commit-Daten für den Vergleich nicht ermitteln."
|
||||
"Could not determine local commit hash.": "Konnte lokalen Commit-Hash nicht ermitteln."
|
||||
"Could not determine local version.": "Konnte lokale Version nicht ermitteln."
|
||||
@@ -418,8 +418,8 @@ kleinanzeigen_bot/update_checker.py:
|
||||
"Latest release from GitHub is a prerelease, but 'latest' channel expects a stable release.": "Die neueste GitHub-Version ist eine Vorabversion, aber der 'latest'-Kanal erwartet eine stabile Version."
|
||||
"No prerelease found for 'preview' channel.": "Keine Vorabversion für den 'preview'-Kanal gefunden."
|
||||
"Unknown update channel: %s": "Unbekannter Update-Kanal: %s"
|
||||
? "You are on a different commit than the release for channel '%s' (tag: %s). This may mean you are ahead, behind, or on a different branch. Local commit: %s (%s), Release commit: %s (%s)"
|
||||
: "Sie befinden sich auf einem anderen Commit als das Release für Kanal '%s' (Tag: %s). Dies kann bedeuten, dass Sie voraus, hinterher oder auf einem anderen Branch sind. Lokaler Commit: %s (%s), Release-Commit: %s (%s)"
|
||||
? "You are on a different commit than the release for channel '%s' (tag: %s). This may mean you are ahead, behind, or on a different branch. Local commit: %s (%s UTC), Release commit: %s (%s UTC)"
|
||||
: "Sie befinden sich auf einem anderen Commit als das Release für Kanal '%s' (Tag: %s). Dies kann bedeuten, dass Sie voraus, hinterher oder auf einem anderen Branch sind. Lokaler Commit: %s (%s UTC), Release-Commit: %s (%s UTC)"
|
||||
|
||||
#################################################
|
||||
kleinanzeigen_bot/model/update_check_state.py:
|
||||
|
||||
@@ -198,16 +198,18 @@ class UpdateChecker:
|
||||
return
|
||||
|
||||
if local_commit == release_commit:
|
||||
# If the commit hashes are identical, we are on the latest version. Do not proceed to other checks.
|
||||
logger.info(
|
||||
"You are on the latest version: %s (compared to %s in channel %s)",
|
||||
local_version,
|
||||
self._get_short_commit_hash(release_commit),
|
||||
self.config.update_check.channel
|
||||
)
|
||||
# We cannot reliably determine ahead/behind without git. Use commit dates as a weak heuristic, but clarify in the log.
|
||||
elif local_commit_date < release_commit_date:
|
||||
return
|
||||
# All commit dates are in UTC; append ' UTC' to timestamps in logs for clarity.
|
||||
if local_commit_date < release_commit_date:
|
||||
logger.warning(
|
||||
"A new version is available: %s from %s (current: %s from %s, channel: %s)",
|
||||
"A new version is available: %s from %s UTC (current: %s from %s UTC, channel: %s)",
|
||||
self._get_short_commit_hash(release_commit),
|
||||
release_commit_date.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
local_version,
|
||||
@@ -219,7 +221,7 @@ class UpdateChecker:
|
||||
else:
|
||||
logger.info(
|
||||
"You are on a different commit than the release for channel '%s' (tag: %s). This may mean you are ahead, behind, or on a different branch. "
|
||||
"Local commit: %s (%s), Release commit: %s (%s)",
|
||||
"Local commit: %s (%s UTC), Release commit: %s (%s UTC)",
|
||||
self.config.update_check.channel,
|
||||
release.get("tag_name", "unknown"),
|
||||
self._get_short_commit_hash(local_commit),
|
||||
|
||||
Reference in New Issue
Block a user