Conversation
…age for StorageAwareAuthenticationPlugin
There was a problem hiding this comment.
Pull request overview
This PR prepares the SDK for the v4.0.0 release by raising the minimum PHP version to 8.2, adding new observability/reliability capabilities (HTTP logging, retry strategies, circuit breaker), updating documentation, and expanding the PHPUnit test suite to cover new behavior and enums.
Changes:
- Added HTTP request/response logging and reliability plugins (retry + circuit breaker), plus supporting docs.
- Added/updated PHPUnit tests and test infrastructure (including PHPUnit attribute data providers).
- Updated package/tooling metadata (composer constraints, CI workflow matrix, phpstan/rector config) and added v4 upgrade notes + changelog entry.
Reviewed changes
Copilot reviewed 71 out of 72 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| UPGRADE-4.0.md | New v4 upgrade guide and breaking-change notes. |
| tests/UtilsTest.php | Migrates data providers to PHPUnit attributes. |
| tests/TestCase.php | Renames base test namespace for new autoload-dev mapping. |
| tests/StatisticsClientTest.php | Adds existence/return-type test for statistics method. |
| tests/Plugin/StorageAwareAuthenticationPluginTest.php | Adds tests for token-from-storage auth plugin. |
| tests/Plugin/GeocachingHttpLoggerPluginTest.php | Adds detailed tests for logger plugin behavior. |
| tests/OptionsTest.php | Adds tests around Options logging + base URI setup. |
| tests/OptionsHttpLoggingTest.php | Smoke-test enableHttpLogging() doesn’t throw. |
| tests/OptionsCreateConfiguredLoggerTest.php | Tests Options logging plugin insertion. |
| tests/OptionsCreateConfiguredLoggerEdgeCasesTest.php | Tests logging with a custom Monolog logger. |
| tests/GeocachingSdkTest.php | Adds SDK surface/return-type existence tests. |
| tests/GeocachingSdkIntegrationRealTest.php | Adds “real” integration-ish assertions around SDK wiring. |
| tests/GeocachingHttpLoggerPluginTest.php | Adds basic “returns same response” plugin test. |
| tests/GeocachingAdventureSdkTest.php | Removes old adventure test fixture. |
| tests/Exception/UtilsExceptionTest.php | Adds test coverage for UtilsException context. |
| tests/Enum/TrackableLogTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/MembershipTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/ListTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/GeocacheTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/GeocacheStatusTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/GeocacheSizeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/GeocacheLogUpvoteTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/GeocacheLogTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/EnvironmentTest.php | Adds tests for Environment enum values. |
| tests/Enum/EnumTraitTest.php | Adds tests for EnumTrait helpers across enums. |
| tests/Enum/BaseUriTest.php | Adds tests for BaseUri enum values. |
| tests/Enum/AttributeTest.php | Adds tests for new Attribute enum behavior. |
| tests/Enum/AdditionalWaypointVisibilityTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/Enum/AdditionalWaypointTypeTest.php | Adds enum + EnumTrait behavior tests. |
| tests/ClientBuilderTest.php | Adds tests for base URI storage behavior. |
| test.php | Removes local/manual test script from repo root. |
| src/Reliability/RetryStrategy.php | Introduces retry strategy interface. |
| src/Reliability/RetryHandler.php | Adds retry execution helper. |
| src/Reliability/FixedDelayStrategy.php | Adds fixed-delay retry strategy. |
| src/Reliability/ExponentialBackoffStrategy.php | Adds exponential backoff retry strategy. |
| src/Reliability/CircuitBreaker.php | Adds circuit breaker implementation. |
| src/Plugin/StorageAwareAuthenticationPlugin.php | Adds auth plugin that prefers stored tokens. |
| src/Plugin/RetryPlugin.php | Adds HTTPlug retry plugin wrapper. |
| src/Plugin/ReliabilityPlugin.php | Adds combined reliability plugin (circuit + retry). |
| src/Plugin/GeocachingHttpLoggerPlugin.php | Adds structured HTTP logger plugin with masking/truncation. |
| src/Plugin/CircuitBreakerPlugin.php | Adds HTTPlug circuit breaker plugin wrapper. |
| src/Options.php | Extends Options with logging, token refresh, and reliability helpers. |
| src/GeocachingSdkInterface.php | Removes SDK interface per v4 breaking changes. |
| src/Exception/UtilsException.php | Adds context payload support to UtilsException. |
| src/Exception/CircuitBreakerOpenException.php | Adds dedicated exception for open circuit state. |
| src/Enum/TrackableLogType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/MembershipType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/ListType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/GeocacheType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/GeocacheStatus.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/GeocacheSize.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/GeocacheLogUpvoteType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/GeocacheLogType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/AdditionalWaypointVisibilityType.php | Applies EnumTrait consistently (minor cleanup). |
| src/Enum/AdditionalWaypointType.php | Applies EnumTrait consistently (minor cleanup). |
| src/ClientBuilderInterface.php | Adds interface for mocking/swapping client builder. |
| src/ClientBuilder.php | Makes builder non-final; returns HttpMethodsClientInterface; stores baseUri. |
| rector.php | Updates Rector level set for PHP 8.2. |
| README.md | Updates requirements and adds documentation/logging section. |
| phpstan.neon.dist | Tweaks phpstan config (parallel + ignore pattern). |
| docs/reliability.md | Adds reliability/observability documentation page. |
| docs/README.md | Adds docs index/landing page. |
| docs/getting-started.md | Adds install + first-call documentation. |
| docs/configuration.md | Adds configuration + custom HTTP client docs. |
| docs/authentication.md | Adds token refresh documentation and examples. |
| docs/api-usage.md | Adds domain-by-domain API usage documentation. |
| composer.json | Raises PHP min version and updates dev constraints/autoload-dev. |
| CLAUDE.md | Adds repo-level documentation for contributors/agents. |
| CHANGELOG.md | Adds v4.0.0 changelog entry and notes. |
| .gitignore | Ignores test.php (removed from repo). |
| .github/workflows/ci.yml | Updates CI matrix/actions versions; removes Codecov step. |
Comments suppressed due to low confidence (1)
src/Options.php:89
- Options currently hard-requires a concrete ClientBuilder (setAllowedTypes('client_builder', ClientBuilder::class) and getClientBuilder(): ClientBuilder). This prevents using the newly introduced ClientBuilderInterface for swapping/mocking, and conflicts with the UPGRADE/README guidance about ClientBuilderInterface being available for mocking.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- static $successCount in CircuitBreaker → private property $successCount, reset properly in reset() - Raw level string passed to GeocachingHttpLoggerPlugin → normalized in enableHttpLoggingWithLogger() before use - UPGRADE-4.0.md token refresh section → corrected to distinguish token_storage+reference_code (storage-aware auth) from enableTokenRefresh() (actual 401 auto-refresh) - UPGRADE-4.0.md reliability examples → updated to use the real configureRetry() / configureFixedRetry() / enableCircuitBreaker() / enableReliability() array API
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.
No description provided.