Skip to content

Comments

Switch created-* filters to human-readable timestamps#24

Open
stympy wants to merge 7 commits intomainfrom
fix-timestamps
Open

Switch created-* filters to human-readable timestamps#24
stympy wants to merge 7 commits intomainfrom
fix-timestamps

Conversation

@stympy
Copy link
Member

@stympy stympy commented Feb 18, 2026

This aligns timestamp handling with honeybadger-mcp-server and handles the changes in honeybadger-io/api-go#6.

Summary

  • Update deployments list, uptime outages, and uptime checks to accept human-readable --created-after/--created-before values (YYYY-MM-DD or RFC3339).
  • Add shared time parsing/validation helper and return clear errors for invalid timestamp input.
  • Add/expand tests to verify date-string parsing is converted to Unix epoch query params and that empty timestamp filters are omitted.

Breaking change

  • Unix epoch values are no longer accepted for --created-after / --created-before on these commands.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request switches timestamp filter flags from Unix epoch values to human-readable date strings, aligning with the honeybadger-mcp-server conventions. It updates the deployments list, uptime outages, and uptime checks commands to accept --created-after and --created-before flags in YYYY-MM-DD or RFC3339 format. A new shared helper function parseTimeFlag provides consistent time parsing with clear error messages across all affected commands.

Changes:

  • Replaced Unix epoch (int64) timestamp flags with human-readable string timestamps for created-after/created-before filters
  • Added parseTimeFlag helper function supporting RFC3339, date-only (YYYY-MM-DD), and datetime without zone formats
  • Updated api-go dependency to v0.4.1-0.20260218211314-b4dfa5f13e9b to support time.Time instead of int64 for timestamp filters

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go.mod Updated api-go dependency to pre-release version supporting time.Time timestamp filters
go.sum Added checksums for new api-go dependency version
cmd/root.go Added parseTimeFlag helper function for parsing user-provided timestamps in multiple formats
cmd/deployments.go Changed created-after/created-before flags from int64 to string, added parsing logic
cmd/uptime.go Changed created-after/created-before flags from int64 to string for both outages and checks commands
cmd/dataapi_test.go Added integration tests verifying timestamp conversion and empty timestamp handling for deployments
cmd/uptime_test.go Added integration tests verifying timestamp conversion and empty timestamp handling for outages and checks
CHANGELOG.md Documented breaking change for timestamp flag format requirements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

stympy and others added 6 commits February 18, 2026 14:55
- G704 (SSRF): endpoint URL is intentionally user-configurable
- G101 (hardcoded credentials): test fixture data, not real secrets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests RFC3339, date-only, datetime without zone, and error cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move //nolint:gosec from field lines to struct literal opening braces,
which is where G101 is actually reported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pin same version as CI to catch lint issues locally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant