-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implement warnings as notices (#486)
This deletes the legacy warnings code and re-implements `pebble warnings` and `pebble okay` using notices as warnings (as we originally intended). The `/v1/warnings` endpoints have been removed, and `pebble warnings` now hits `/v1/notices?types=warning`. On every request, instead of returning the count of warnings and the latest timestamp, we only return the timestamp of the latest (most recent last-repeated time). This way the server doesn't have to track which notices have been okayed -- the client can compare against its stored timestamp and see if the server-reported timestamp is later. So there are a few breaking changes in this PR: * `Client.WarningsSummary() (count int, timestamp time.Time)` is now `Client.LatestWarningTime() time.Time`, as there's no count anymore * `GET /v1/warnings` (list warnings) is gone: `pebble warnings` now uses `GET /v1/notices?types=warning` * `POST /v1/warnings` (okay warnings) are gone: `pebble okay` now just updates the local state file, and doesn't use the API/client at all * Similarly, `Client.Warnings()` and `Client.Okay()` are gone; use `Client.Notices()` and maintain local client-side state, respectively * `State.Warnf` is still around, but it's now just a helper that calls `State.AddNotice` with the right type (warning) and key (message) Fixes #475.
- Loading branch information
Showing
26 changed files
with
292 additions
and
1,345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.