FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Sprint 1 (#2) · Sentia/vistar_client@a448547 · GitHub

Repository navigation

Commit a448547

Browse files
authored
Sprint 1 (#2)
* feat: implement error hierarchy (Day 1) - Add 4 custom error classes: Error, AuthenticationError, APIError, ConnectionError - APIError stores status_code and response_body for debugging - Comprehensive test suite with 30 examples, 100% coverage - Full YARD documentation for all error classes - All errors inherit from VistarClient::Error for easy rescue Sprint 1, Day 1 complete * feat: implement Client class with Faraday connection (Sprint 1, Day 2-3) - Add Client class with initialization and validation - Configure Faraday connection with JSON middleware - Add retry logic for transient failures (429, 5xx) - Set Authorization, Accept, and Content-Type headers - Support conditional debug logging via VISTAR_DEBUG env var - Add comprehensive unit tests (31 examples) - Achieve 100% test coverage (62 total examples) - Update RuboCop config to allow connection method complexity * feat: add error handler middleware * chore: add manual test script and update gitignore (Sprint 1, Day 5) * Refactor to modular architecture with Connection and API modules - Extract Connection class to manage HTTP client configuration - Wraps Faraday::Connection with method delegation pattern - Provides clean separation between HTTP layer and business logic - Maintains backward compatibility via method_missing - Create API module structure for feature organization - Add API::Base module with shared functionality - Add API::AdServing module with request_ad and submit_proof_of_play - Enable clean extension pattern for Sprint 2+ features - Refactor Client class from monolithic to modular design - Reduce from 238 to 89 lines via composition - Include API::AdServing for endpoint methods - Delegate connection management to Connection class - Add comprehensive test coverage for new architecture - Create Connection test suite (22 examples) - Update Client tests for new structure (96 examples) - Maintain 98.73% code coverage (155/157 lines) - Achieve RuboCop compliance on all new/modified files - Use modern Ruby arguments forwarding syntax (...) - Follow memoization naming conventions - Add complexity exceptions for validation methods Sprint 1, Days 6-7: 118 tests passing, ready for Sprint 2 expansion * Add comprehensive YARD documentation (100% coverage) - Document main VistarClient module with usage examples - Add API namespace documentation for endpoint organization - Document Middleware namespace for Faraday components - Add version constant documentation - Document SERVER_ERROR_RANGE constant - Fix YARD warnings for method_missing and middleware params - Update Connection#method_missing documentation - Update ErrorHandler#call parameter documentation YARD stats: 100% documented (8 files, 5 modules, 7 classes, 11 methods) Sprint 1, Day 8: Complete YARD documentation * Update README with comprehensive documentation - Add Quick Start section with actual API examples - Document modular architecture (Connection + API modules) - Add detailed API method documentation: * request_ad with all parameters and examples * submit_proof_of_play with all parameters and examples - Expand error handling section with all error classes - Add 'Extending the Client' guide with step-by-step instructions - Update configuration examples with correct defaults - Add debug logging instructions (VISTAR_DEBUG) - Document architecture benefits and design decisions - Update feature list to reflect current implementation Sprint 1, Day 9: Complete README documentation * Bump version to 0.2.0 and update CHANGELOG - Update version from 0.1.0 to 0.2.0 - Add comprehensive v0.2.0 release notes to CHANGELOG: * Complete error hierarchy * Client class with API methods * Modular architecture (Connection + API modules) * 118 tests, 98.73% coverage * 100% YARD documentation * request_ad and submit_proof_of_play methods * Comprehensive README and extension guide Sprint 1, Day 10: Ready for release * Update Gemfile.lock for v0.2.0
1 parent 9e355ba commit a448547

20 files changed

Lines changed: 2168 additions & 25 deletions

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
# Internal documentation and instructions
1717
/docs/internal/*
1818
.github/copilot-instructions.md
19+
*.gem

‎.rubocop.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Metrics/MethodLength:
3434
Max: 15
3535
Exclude:
3636
- 'spec/**/*.rb'
37+
AllowedMethods:
38+
- connection
39+
40+
Metrics/AbcSize:
41+
AllowedMethods:
42+
- connection
3743

3844
Layout/LineLength:
3945
Max: 120
@@ -48,3 +54,15 @@ RSpec/NestedGroups:
4854

4955
RSpec/ExampleLength:
5056
Max: 15
57+
58+
RSpec/VerifiedDoubles:
59+
Enabled: false
60+
61+
RSpec/StubbedMock:
62+
Enabled: false
63+
64+
RSpec/MessageSpies:
65+
Enabled: false
66+
67+
MultipleDescribes:
68+
Enabled: false

‎CHANGELOG.md‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Fixed
1717
- Nothing yet
1818

19+
## [0.2.0] - 2025-10-31
20+
21+
### Added
22+
- Sprint 1: Core Vistar Media API Client Implementation
23+
- Complete error hierarchy (Error, AuthenticationError, APIError, ConnectionError)
24+
- Client class with credential validation and configuration
25+
- HTTP connection management with Faraday
26+
- Custom error handler middleware with intelligent error parsing
27+
- Automatic retry logic with exponential backoff (3 retries, 429/5xx status codes)
28+
- `request_ad` method for programmatic ad requests
29+
- `submit_proof_of_play` method for ad display confirmation
30+
- Comprehensive parameter validation with descriptive error messages
31+
- Optional debug logging via VISTAR_DEBUG environment variable
32+
- Full test coverage: 118 test examples, 98.73% code coverage
33+
- 100% YARD documentation coverage (8 files, 5 modules, 7 classes, 11 methods)
34+
35+
### Changed
36+
- Refactored to modular architecture for extensibility
37+
- Connection class for HTTP client abstraction
38+
- API::Base module for shared API functionality
39+
- API::AdServing module for ad serving endpoints
40+
- Client class uses composition pattern (reduced from 238 to 89 lines)
41+
- Updated README with:
42+
- Architecture documentation
43+
- Comprehensive API method documentation
44+
- Error handling guide
45+
- Extension guide for adding new API modules
46+
- Improved error messages with HTTP status codes and response bodies
47+
48+
### Technical Details
49+
- Faraday-based HTTP client with middleware stack
50+
- JSON request/response encoding and parsing
51+
- Method delegation pattern for backward compatibility
52+
- WebMock integration for comprehensive API testing
53+
- RuboCop compliant code style
54+
1955
## [0.1.0] - 2025-10-31
2056

2157
### Added
@@ -31,5 +67,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3167
- Development environment setup (.env, bin/setup, bin/console)
3268
- Release and contribution documentation
3369

34-
[Unreleased]: https://github.com/Sentia/vistar_client/compare/v0.1.0...HEAD
70+
[Unreleased]: https://github.com/Sentia/vistar_client/compare/v0.2.0...HEAD
71+
[0.2.0]: https://github.com/Sentia/vistar_client/compare/v0.1.0...v0.2.0
3572
[0.1.0]: https://github.com/Sentia/vistar_client/releases/tag/v0.1.0

‎Gemfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ gem 'rubocop', '~> 1.50'
2020
gem 'rubocop-performance', '~> 1.19'
2121
gem 'rubocop-rspec', '~> 2.22'
2222
gem 'simplecov', '~> 0.22'
23+
gem 'webmock', '~> 3.19'
2324
gem 'yard', '~> 0.9'

‎Gemfile.lock‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
PATH
22
remote: .
33
specs:
4-
vistar_client (0.1.0)
4+
vistar_client (0.2.0)
55
faraday (~> 2.7)
66
faraday-retry (~> 2.2)
77

88
GEM
99
remote: https://rubygems.org/
1010
specs:
11+
addressable (2.8.7)
12+
public_suffix (>= 2.0.2, < 7.0)
1113
ast (2.4.3)
14+
bigdecimal (3.3.1)
1215
cgi (0.5.0)
1316
coderay (1.1.3)
17+
crack (1.0.1)
18+
bigdecimal
19+
rexml
1420
date (3.5.0)
1521
diff-lcs (1.6.2)
1622
docile (1.4.1)
@@ -24,6 +30,7 @@ GEM
2430
net-http (>= 0.5.0)
2531
faraday-retry (2.3.2)
2632
faraday (~> 2.0)
33+
hashdiff (1.2.1)
2734
io-console (0.8.1)
2835
irb (1.15.2)
2936
pp (>= 0.6.0)
@@ -50,6 +57,7 @@ GEM
5057
psych (5.2.6)
5158
date
5259
stringio
60+
public_suffix (6.0.2)
5361
racc (1.8.1)
5462
rainbow (3.1.1)
5563
rake (13.3.1)
@@ -60,6 +68,7 @@ GEM
6068
regexp_parser (2.11.3)
6169
reline (0.6.2)
6270
io-console (~> 0.5)
71+
rexml (3.4.4)
6372
rspec (3.13.2)
6473
rspec-core (~> 3.13.0)
6574
rspec-expectations (~> 3.13.0)
@@ -117,6 +126,10 @@ GEM
117126
unicode-emoji (~> 4.1)
118127
unicode-emoji (4.1.0)
119128
uri (1.1.0)
129+
webmock (3.25.2)
130+
addressable (>= 2.8.0)
131+
crack (>= 0.3.2)
132+
hashdiff (>= 0.4.0, < 2.0.0)
120133
yard (0.9.37)
121134

122135
PLATFORMS
@@ -134,6 +147,7 @@ DEPENDENCIES
134147
rubocop-rspec (~> 2.22)
135148
simplecov (~> 0.22)
136149
vistar_client!
150+
webmock (~> 3.19)
137151
yard (~> 0.9)
138152

139153
BUNDLED WITH

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL