-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add 48h delay for the upgrade cli warning #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add 48h delay for the upgrade cli warning #105
Conversation
Parse the published_at timestamp from GitHub API response and only prompt users to update if the release is at least 48 hours old. This prevents excessive update notifications for very recent releases. Changes the getLatestTag return type from (string, string, error) to (string, time.Time, error) to properly handle timestamp parsing.
Add support for marking releases as urgent via "#urgent" tag in release notes. Urgent releases will trigger update prompts regardless of the 48-hour release age threshold.
Greptile SummaryImproves CLI update notification UX by adding a 48-hour delay before prompting users about new releases. This prevents notification fatigue from very recent releases while maintaining awareness of updates. Includes an Key changes:
Security note: The Confidence Score: 3/5
Important Files Changed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 2 comments
- Extract published_at fetching into separate getReleasePublishedAt function - Check current version age instead of latest version to avoid nagging users who recently updated - Simplify control flow by inverting early return condition - Unwrap message formatting from version check condition
Description 📣
Reduces CLI update notification frequency by only prompting users when a new release is at least 48 hours old. This prevents excessive notifications for very recent releases while still keeping users informed about updates.
Additionally, adds support for urgent releases via a
#urgenttag in the release notes body, which bypasses the 48-hour delay for critical updates that need immediate user attention.Changes
published_attimestamp from GitHub API response#urgenttag detection in release body to bypass the delaygetLatestTagreturn signature to include parsed timestamp and urgency flagdaysSinceDatefunctionType ✨
Tests 🛠️
Manual testing:
The update prompt correctly appears because the latest release (v0.43.47) is more than 48 hours old. Urgent release behavior can be tested by adding
#urgentto a release's body.