Repository navigation
feat(notification): show the capped notification counts - #172
Merged
Merged
Conversation
k8s-stack-manager #654 caps the notification counts: `total` is exact up to offset + 1000 (`total_capped`) and `unread_count` up to 1000 (`unread_count_capped`). - types: PaginatedNotifications gets TotalCapped and UnreadCountCapped, UnreadCountResponse gets UnreadCountCapped. An older server sends neither flag (false). - client: UnreadNotificationCount returns the count and the flag; CountUnreadNotifications keeps its signature. - `notification list` prints "(1000+ unread of 1000+ total)" when capped. - `notification count` keeps stdout a bare integer for scripts and writes a note to stderr when capped; -o json and -o yaml carry the flag. The response contract test does not cover these types yet: add them after the backend change merges and testdata/swagger.json is refreshed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to omattsson/k8s-stack-manager#654 (backend PR omattsson/k8s-stack-manager#697).
Summary
The backend caps the notification counts:
totalis exact up to offset + 1000 (total_capped), andunread_countup to 1000 (unread_count_capped).PaginatedNotificationsgetsTotalCappedandUnreadCountCapped.UnreadCountResponsegetsUnreadCountCapped. An older server sends neither flag, so they read as false.UnreadNotificationCount()returns the count and the flag.CountUnreadNotifications()keeps its signature.notification list: the footer prints "(1000+ unread of 1000+ total)" when the server capped the counts.notification count: stdout stays a bare integer, so[ "$(stackctl notification count)" -gt 0 ]keeps working. A capped count also writes a note to stderr.-o jsonand-o yamlcarryunread_count_capped.Works against old and new servers, so it can merge before or after the backend PR.
Not in this PR
The response contract test does not cover these types yet.
testdata/swagger.jsonis far behind the backendmain, so refreshing it now would pull in unrelated changes. Add the two cases (PaginatedNotifications, andUnreadCountResponseagainstmodels.UnreadNotificationCount) after the backend PR merges.Tests
countin table, JSON, YAML and quiet mode (stdout integer, stderr note).UnreadNotificationCount, including an older server.go vet ./...andgo test ./... -race -count=1pass.🤖 Generated with Claude Code