Skip to content

Conversation

@calliostro
Copy link
Owner

v4.0.0 - Complete Library Redesign with Clean Parameter API

This release represents a fundamental architectural overhaul, prioritizing developer experience, type safety, and minimal code footprint.

Breaking Changes

  • Class Renaming: DiscogsApiClient → DiscogsClient, ClientFactory → DiscogsClientFactory
  • Method Naming: All 60 methods follow consistent verb-first pattern (getArtist, listArtistReleases, createMarketplaceListing)
  • Clean Parameters: Array parameters eliminated - direct typed parameters with IDE autocomplete support
  • Authentication: Enhanced security with RFC 5849 OAuth 1.0a implementation

Migration Required

All method calls must be updated. See CHANGELOG.md and UPGRADE.md for detailed migration guide.

Features

  • Ultra-lightweight architecture (~750 lines, 2 core classes)
  • Full type safety with automatic parameter validation
  • Perfect IDE autocomplete support
  • PHP 8.1 - 8.5 compatibility
  • Zero bloat, direct API mapping

Documentation

- Consistent method naming with verb-first pattern (get*, create*, update*, delete*)
- RFC 5849 compliant OAuth 1.0a implementation with secure authentication
- Production-grade testing with comprehensive edge cases and security hardening
- Split test suites: unit/integration (CI uses only fast units)
- Make all classes consistently final
- Fix PHPDoc compatibility and deprecations
- Change '@uses DiscogsApiClient' to '@uses \Calliostro\Discogs\DiscogsApiClient'
- Fixes PHPUnit warnings that were causing CI pipeline to fail
- The @uses annotation requires fully qualified class names (FQCN)
- Replace array parameters with positional parameters for all methods
- Rename all methods to consistent verb-first pattern (getArtist, listReleases, etc.)
- Rename classes: DiscogsApiClient -> DiscogsClient, ClientFactory -> DiscogsClientFactory
- Add ConfigCache for performance optimization
- Enhance authentication with proper OAuth 1.0a and personal token support
- Update all tests and documentation for new API design
- Remove redundant test-unit script from composer.json
- Remove flaky timing assertion from rate limiting test to prevent random failures on slower systems
- Update artist example from The Beatles to Billie Eilish
- Streamline integration test execution in CI to use composer scripts
- Improve documentation for running integration tests locally
Copilot AI review requested due to automatic review settings December 1, 2025 15:42
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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 PR represents a complete architectural redesign (v4.0.0) of the PHP Discogs API client library with comprehensive breaking changes. The redesign focuses on developer experience, type safety, and a minimal code footprint (~750 lines, 2 core classes). The PR removes old test fixtures and introduces a comprehensive unit test suite with 2000+ lines of tests covering security, edge cases, and production scenarios.

Key Changes:

  • Complete rewrite with breaking API changes (class/method renaming, clean parameter API)
  • Comprehensive unit test suite with 100% coverage goal
  • Enhanced security with RFC 5849 OAuth 1.0a implementation
  • Removal of legacy test fixtures in favor of mock-based testing

Reviewed changes

Copilot reviewed 51 out of 52 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Unit/UnitTestCase.php Base test class with common helper methods for assertions
tests/Unit/SecurityTest.php Security-focused tests for ReDoS protection and cryptographic nonce generation
tests/Unit/ProductionRealisticTest.php Production edge case tests (502/503 errors, timeouts, SSL issues)
tests/Unit/OAuthHelperTest.php OAuth helper tests covering request/access tokens and error handling
tests/Unit/HeaderSecurityTest.php Tests preventing authorization header override attacks
tests/Unit/DiscogsClientTest.php Comprehensive client tests with 1900+ lines covering all methods and edge cases
tests/Unit/DiscogsClientFactoryTest.php Factory pattern tests for client creation with various auth methods
tests/fixtures/*.json Deleted old fixture files, replaced with mock-based testing approach
.gitignore Added coverage.xml and *.clover to ignore list

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

@calliostro calliostro merged commit 726ace9 into main Dec 1, 2025
24 checks passed
@calliostro calliostro deleted the feature/v4.0.0-oauth-clean-api branch December 1, 2025 15:46
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.

3 participants