Update gem to latest Umami API + add full Minitest test suite#3
Merged
Update gem to latest Umami API + add full Minitest test suite#3
Conversation
This is a comprehensive update aligning the gem with the current Umami API documentation at https://umami.is/docs/api. ## New Endpoints (v0.2.0) - Me: `me`, `my_teams`, `my_websites` - Admin: `admin_users`, `admin_websites`, `admin_teams` - Sessions: 8 new methods for session data and analytics - Realtime: `realtime` for live stats - Links: `links`, `link`, `update_link`, `delete_link` - Pixels: `pixels`, `pixel`, `update_pixel`, `delete_pixel` - Reports: 13 methods including specialized report types - Events: 7 new event data methods ## Bug Fixes (v0.2.1) - Fixed `send_event` to use correct Umami Cloud URL - Added mandatory User-Agent header to send requests - Fixed event data endpoint paths ## Documentation Improvements - Added `request_timeout=` setter to Configuration - Added `type` parameter to `reports()` documentation - Fixed `website_event_data_stats` return type (Array<Hash>) - Added Configuration Options table to README - Added Report Types reference table Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move unreleased changes to v0.2.2 section in CHANGELOG - Update VERSION constant Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 152 tests (unit + integration) with 72% coverage - Add VCR cassettes for all read API endpoints - Add CI workflow for Ruby 3.3, 3.4, 4.0 - Standardize Gemfile, .gitignore, .simplecov to match gem ecosystem - Update README with standard badges and header format - Use Minitest 6+ with minitest-mock gem Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
🧪 Test Suite AddedThis commit adds a comprehensive Minitest test suite with VCR cassettes. Test Structure
Running Testsbundle exec rake testCoverage
Known Testing GapsThe following areas are intentionally not covered by integration tests: Write/Destructive Operations - These require a dedicated test Umami instance:
Reports API - Requires complex parameter combinations:
Additional Metric Types - Only common types are tested:
Recording New Cassettesexport UMAMI_ACCESS_TOKEN="your_token"
export UMAMI_URI_BASE="https://your-umami-instance.com"
VCR_RECORD_MODE=new_episodes bundle exec rake testImportant: After recording, anonymize any sensitive data in the cassettes before committing. Files Added
|
Consolidate 0.2.0, 0.2.1, 0.2.2 entries into single 0.2.0 release. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add claude-code-review.yml for automatic PR reviews - Add claude.yml for @claude mentions in issues/comments - Add CLAUDE.md with project guidance for Claude Code - Remove stale [Unreleased] header from CHANGELOG - Update Gemfile.lock to v0.2.0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Major update to sync the umami-ruby gem with the latest Umami API specifications. This release includes critical bug fixes, 40+ new endpoints, comprehensive test suite, and documentation improvements.
Fixes #2 - Added mandatory
User-Agentheader tosend_eventrequests (events were being rejected without it)What's Changed
Critical Fixes
send_eventto use correct Umami Cloud URL (https://cloud.umami.is/api/send)User-Agentheader tosend_eventrequests (fixes Valid User-Agent required for events API #2)send_eventto not send unnecessaryAuthorizationheaderverify_tokento use POST method per API docs/api/event-data/...to/api/websites/:websiteId/event-data/...website_event_data_statsreturn type documentationNew Endpoints (40+ methods)
me,my_teams,my_websitesadmin_users,admin_websites,admin_teams(self-hosted only)realtimefor live stats (last 30 minutes)links,link,update_link,delete_linkpixels,pixel,update_pixel,delete_pixelConfiguration
request_timeout=setter for custom timeout configurationUMAMI_CLOUD_SEND_URLconstant for Cloud send endpointuser_agent:parameter tosend_eventfor custom User-Agent stringsTest Suite (New)
Documentation
Test Coverage
```
COVERAGE SUMMARY
Line Coverage: 71.95%
Branch Coverage: 71.95%
```
Testing Details
Test Suite Stats:
Running Tests:
```bash
bundle install
bundle exec rake test
```
Record New Cassettes:
```bash
VCR_RECORD_MODE=new_episodes bundle exec rake test
```
Known Gaps (require write access):
API Coverage
Total: 76 endpoints, 100% coverage
🤖 Generated with Claude Code