-
Notifications
You must be signed in to change notification settings - Fork 85
feat(proxy): integrate with CoAPI and refactor proxy components #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Owner
Ahoo-Wang
commented
May 12, 2025
- Replace okhttp3 with CoAPI for HTTP communication
- Refactor ProxyMachineIdDistributor and ProxyIdSegmentDistributor to use CoAPI
- Update CosIdProxyMachineIdDistributorAutoConfiguration and CosIdProxySegmentAutoConfiguration for CoAPI integration
- Rename and repackage ErrorResponse to proxy/api package
- Update ProxyServerLauncher for CoAPI compatibility
- Add loadBalanced property to ProxyProperties
- Replace okhttp3 with CoAPI for HTTP communication - Refactor ProxyMachineIdDistributor and ProxyIdSegmentDistributor to use CoAPI - Update CosIdProxyMachineIdDistributorAutoConfiguration and CosIdProxySegmentAutoConfiguration for CoAPI integration - Rename and repackage ErrorResponse to proxy/api package - Update ProxyServerLauncher for CoAPI compatibility - Add loadBalanced property to ProxyProperties
- Remove unused import for @DeleteMapping - Update @DeleteExchange annotation to use default value
… parameters - Add @RequestParam annotation to long parameters in createDistributor and nextMaxId methods - This change improves API clarity and ensures proper parameter handling in the controller layer
- Extract createApiClient method to generalize API client creation - Use generics to allow creation of different API clients - Refactor createMachineApi and createSegmentApi to use the new method
- Add proxy host and load-balanced configuration to application.yaml - Introduce NestedConfigurationProperty for proxy properties in CosIdProperties class
…ration - Set Redis container version to 7.4.1 - Configure network with specific ID "cosid-proxy-network" - Remove unused import of BeforeAll
…configuration - Add coapi-spring-boot-starter dependency - Simplify network configuration for test containers - Expose redis port in container
- Remove the exposed port 6379 from the Redis container configuration - This change simplifies the test setup by removing unnecessary port exposure
- Add --stacktrace option to the Test CosId-Proxy command in the integration test workflow - This change will provide more detailed error information if the test fails
- Remove unnecessary push and pull_request triggers from various workflow files - Simplify trigger conditions to improve clarity and reduce maintenance overhead - Affected files: - benchmark-test.yml - codecov.yml - document-deploy.yml - example-test.yml - integration-test.yml
- Add paths-ignore for push events to align with pull request settings - Exclude cosid-benchmark, docs, document, documentation, examples, and wiki folders
# Conflicts: # .github/workflows/benchmark-test.yml
- Create ApiClientFactory class to centralize API client creation - Update ProxyIdSegmentDistributorTest and ProxyMachineIdDistributorTest to use ApiClientFactory - Remove createApiClient methods from ProxyServerLauncher
- Reorder imports in MachineController.java for better organization - Update Redis container version to 'latest' in ProxyServerLauncher.java - Remove unnecessary empty lines and improve code formatting
- Replace MachineApi and SegmentApi with MachineClient and SegmentClient - Update client creation and usage in proxy package - Modify spring boot starter configurations for new client classes - Remove load-balanced property from ProxyProperties - Update gradle dependencies and application yaml for coapi integration
- Update log message to include both name and namespace information - Remove unused import of SegmentApi - Adjust spacing and formatting for better readability
- Update GitHub Actions workflow for integration tests - Change the run command for CosId-Proxy to use --debug instead of --stacktrace - This modification aims to provide more detailed output during test execution
- Remove .withReuse(true) from Redis and CosId Proxy containers - Simplify the container initialization code
- Change the log level from --debug to --info for the CosId-Proxy test step
- Enable Gradle build caching, parallel execution, and increase JVM memory - Adjust test timing in MillisecondSnowflakeIdTest to ensure more reliable results
- Disable ProxyIdSegmentDistributorTest and ProxyMachineIdDistributorTest - Add new SegmentClientTest class with a test for creating distributor and getting next max ID - Include necessary imports and setup for the new test class
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #788 +/- ##
============================================
+ Coverage 84.83% 85.33% +0.49%
- Complexity 1312 1318 +6
============================================
Files 212 212
Lines 4241 4172 -69
Branches 425 411 -14
============================================
- Hits 3598 3560 -38
+ Misses 358 340 -18
+ Partials 285 272 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nt distributor - Improve code readability in DistributeConcurrent class - Add timeout annotation to ProxyIdSegmentDistributorTest class - Refactor test verification logic in DistributeConcurrent class
…iguration - Create new test class CosIdProxyMachineIdDistributorAutoConfigurationTest - Add contextLoads test method to verify bean initialization - Update ProxyIdSegmentDistributorTest with placeholder methods for concurrent testing
- Remove `CosIdProperties` from `CosIdProxyMachineIdDistributorAutoConfiguration` - Remove `CosIdProperties` from `CosIdProxySegmentAutoConfiguration` - Add test case for `CosIdProxySegmentAutoConfiguration`
- Uncommented test methods for concurrent ID generation and multi-instance testing - Added `generateConcurrentOfChain` test method - Disabled tests in CI environment to prevent GitHub Actions from hanging
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.