Update dependencies, improve CI, and release version 0.2.1#103
Closed
mercyblitz wants to merge 347 commits intodev-1.xfrom
Closed
Update dependencies, improve CI, and release version 0.2.1#103mercyblitz wants to merge 347 commits intodev-1.xfrom
mercyblitz wants to merge 347 commits intodev-1.xfrom
Conversation
Changed the 'current' field in WeightedRoundRobin from private to package-private to allow access from other classes within the package.
Introduces WeightedRoundRobinTest to verify the behavior of WeightedRoundRobin, including ID, weight, current value manipulation, selection logic, last update, and string representation.
Removed the exception thrown in the private constructor of LoadBalancerUtils, making it an empty constructor. This change improves code clarity for this utility class.
Introduces LoadBalancerUtilsTest to verify the calculateWarmupWeight method, ensuring correct weight calculation during warmup periods.
Introduced a new test to verify RegistrationMetaData handles null keys and values in registration metadata. Ensures that null values are correctly managed and do not cause unexpected behavior.
Introduced a new unit test to verify behavior when MultipleRegistration.special returns null during registration. This enhances test coverage for edge cases in MultipleServiceRegistry.
Simplified logging by removing the redundant isTraceEnabled() check before calling logger.trace in WebMvcServiceRegistryAutoConfiguration.
Replaces explicit enum reference with a static import for SpringBootTest.WebEnvironment.RANDOM_PORT in WebMvcServiceRegistryAutoConfigurationTest for improved readability.
Introduces SimpleAutoServiceRegistrationTest to verify the behavior of SimpleAutoServiceRegistration, including configuration retrieval, enablement, and registration access methods.
Replaces direct provider access with ifAvailable callback and uses ValueHolder to track mapping result. Also replaces Arrays.equals with arrayEquals for pattern comparison, improving code clarity and consistency.
Replaces array syntax with direct class reference for the 'classes' attribute in @SpringBootTest, improving code clarity in WebMvcServiceRegistryAutoConfigurationTest.
Bumps the Testcontainers dependency version from 2.0.0 to 2.0.1 in the parent POM to include the latest fixes and improvements.
Moved Testcontainers dependencies above Spring Boot and shifted Microsphere Spring Boot dependencies below Spring Cloud Alibaba for improved logical grouping and clarity in pom.xml.
Enhanced MultipleRegistration to map each registration to all assignable Registration types using ultimateTargetClass and findAllClasses. This allows for more flexible type-based lookups in the registration map.
Added logic to initialize ServiceInstance for Registration objects of type ServiceInstanceRegistration. This ensures that Zookeeper-specific service instances are properly initialized during RegistrationMetaData construction.
Added Testcontainers setup to CI workflow and introduced a Docker Compose file for service registry servers. Updated integration tests to use Testcontainers and enabled them conditionally. Moved service registry dependencies from test to optional scope and added a Maven profile for Testcontainers support.
Replaces direct reference to ServiceInstanceRegistration with reflection-based initialization using class name and method name constants. This improves decoupling from Zookeeper-specific classes and avoids compile-time dependencies.
Reordered and updated test dependencies: replaced 'junit-jupiter' with 'testcontainers-junit-jupiter' for Testcontainers, and moved 'spring-boot-starter-test' to the end of the test dependencies list for better organization.
Moved the spring-boot-starter-test dependency higher in the dependencies list for improved organization and clarity in the pom.xml file.
Deleted profiles for Eureka, Nacos, Zookeeper, Consul, and Kubernetes from the parent POM. This streamlines the configuration and removes test dependencies for these service discovery solutions.
Deleted the application.yaml file from test resources in microsphere-spring-cloud-commons. This file contained various Spring Cloud service discovery and configuration profiles for testing purposes.
Introduces a test.yaml file with default and profile-specific settings for Nacos, Eureka, Zookeeper, Consul, and Kubernetes. This enables testing with different Spring Cloud service discovery and configuration backends by activating corresponding profiles.
Introduces UnionDiscoveryClientIntegrationTest to verify the integration of UnionDiscoveryClient with multiple service registries using Testcontainers and Docker Compose. The test ensures correct composition and service discovery behavior.
Moved UnionDiscoveryClientIntegrationTest and UnionDiscoveryClientTest from 'discovery.autoconfigure' to 'discovery' package. Changed test classes from public to package-private. Removed unnecessary imports and updated test configuration references for improved clarity and organization.
Updated the definition and usage of ENABLED_PROPERTY_NAME to use @ConfigurationProperty annotation and PropertyConstants. Adjusted imports and @ConditionalOnProperty usage for improved clarity and consistency.
Introduced a protected Logger instance to AbstractServiceRegistrationEndpoint using microsphere logging. This enables logging capabilities for subclasses and improves observability.
Removed conditional checks for logger levels and directly log info and warning messages during service deregistration. This streamlines the logging logic in the endpoint.
Eliminated the unused Logger instance and related imports. Logging statements now use the logger directly without level checks, streamlining the code in ServiceRegistrationEndpoint.
Introduces AbstractServiceRegistrationEndpointTest to provide a foundation for testing service registration endpoints using Spring Boot and JUnit. Sets up application context with relevant properties and autowires required beans for further test development.
…to-classes-methods Add JavaDoc with Example Usage to classes and non-private methods
Add .github/dependabot.yml to enable daily Dependabot version updates for the Maven ecosystem at the repository root. Limits open pull requests to 10 and includes documentation comments for configuration.
Introduce a GitHub Actions workflow that automatically merges changes from main into dev and release when main receives a push. The workflow runs two jobs (merge-to-dev and merge-to-release), checks out the repo, attempts a --no-ff merge of origin/main with a chore commit message containing [skip ci], and pushes the target branch. If the target branch is missing or a merge conflict occurs, the job errors and exits so manual intervention is required. A concurrency group prevents overlapping runs.
Bumps [org.testcontainers:testcontainers-bom](https://github.com/testcontainers/testcontainers-java) from 2.0.1 to 2.0.4. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](testcontainers/testcontainers-java@2.0.1...2.0.4) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-bom dependency-version: 2.0.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….testcontainers-testcontainers-bom-2.0.4 Bump org.testcontainers:testcontainers-bom from 2.0.1 to 2.0.4
Update GitHub Actions workflow to invoke ./mvnw instead of system mvn to ensure a consistent Maven version on runners. Removed the maven cache setting and adjusted the run step to call the wrapper with the existing flags (--batch-mode, --update-snapshots, --file pom.xml) for more reproducible builds.
Upgrade CI actions and add automated release flow. Updated actions/checkout and actions/setup-java from v4 to v5 in both maven-build.yml and maven-publish.yml. In maven-publish.yml changed the default revision placeholder, added a validation step to ensure inputs.revision matches major.minor.patch, and introduced a release job that checks out full history, creates a git tag, creates a GitHub release (using gh), increments the patch version in pom.xml to the next -SNAPSHOT, and commits/pushes the bumped version. These changes modernize the workflows and automate tagging, release creation, and post-release version bumping.
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsphere-projects/microsphere-spring-cloud/sessions/e48e837d-515a-41bc-82ca-62cba0ba78a9
Update parent io.github.microsphere-projects:microsphere-build version from 0.2.2 to 0.2.5 in pom.xml to pick up recent build fixes and updates. No other changes in this commit.
Update dependency BOM versions and add a new Spring Cloud profile. Changes: - Bump microsphere-spring-boot.version 0.2.5 -> 0.2.6. - Update spring-cloud-alibaba.version in 2023 profile 2023.0.3.2 -> 2023.0.3.4. - spring-cloud-2024 profile: spring-boot 3.4.7 -> 3.4.12, spring-cloud 2024.0.2 -> 2024.0.3, spring-cloud-alibaba 2023.0.3.2 -> 2023.0.3.4. - spring-cloud-2025 profile: spring-boot 3.5.0 -> 3.5.8, spring-cloud 2025.0.0 -> 2025.0.1, spring-cloud-alibaba 2023.0.3.2 -> 2025.0.0.0. - Add new profile spring-cloud-2025.1 with spring-boot 4.0.2, spring-cloud 2025.1.1, and spring-cloud-alibaba 2025.1.0.0. These updates align BOM versions with newer Spring Boot / Spring Cloud releases and introduce a profile for the 2025.1 line.
Update CI workflow to run on pushes to both `main` and `dev` branches (was only `dev`). This ensures the Maven build runs for direct pushes to main as well; pull_request triggers already cover `main`, `dev`, and `release`. Changed .github/workflows/maven-build.yml accordingly.
Remove the committed maven-wrapper.jar and switch the Maven Wrapper to script-only form (wrapperVersion=3.3.4). Update .mvn/wrapper/maven-wrapper.properties to use distributionType=only-script and point distributionUrl to an aliyun mirror for apache-maven-3.9.9. Add platform wrappers mvnw (unix, executable) and mvnw.cmd (Windows) to download and install the Maven distribution at runtime. This reduces committed binary artifacts and updates the wrapper and Maven versions.
Add a Python script (.github/scripts/generate-wiki-docs.py) that parses Java source files and Javadoc to generate Markdown wiki pages (per-component pages, Home.md and _Sidebar.md) including examples, version info and API summaries. Add a GitHub Actions workflow (.github/workflows/wiki-publish.yml) to run the generator on push or manual dispatch, copy the output into the repository's wiki, and commit/push updates. This enables automated generation and publication of project API documentation to the GitHub wiki.
Bump parent POM and dependency versions; update CI workflow
Annotate multiple test classes with @SpringLoggingTest to enable consistent test logging and add a new FeignClientSpecificationPostProcessorTest. Adjust Feign auto-refresh code: simplify ConditionalOnBean to use Marker, statically import NoOpRequestInterceptor.INSTANCE, and make AUTO_REFRESH_CAPABILITY_CLASS, FEIGN_CLIENT_SPECIFICATION_CLASS and injectAutoRefreshCapability package-private to allow testing. Update parent POM to add junit-jupiter.version and import the JUnit BOM for consistent test dependency management.
Change testStart() to testStart(int index) and wrap its assertions in an if (index == 0) block so the assertions only run for index 0. This adapts the test for parameterized or repeated invocations while preserving the original assertion behavior.
Change excludeMappings from private(Set) to package-private(Collection) so it can be accessed within the package and accept any Collection<WebEndpointMapping>. Iteration logic remains unchanged.
Remove the final newline character from microsphere-spring-cloud-commons/src/test/java/io/microsphere/spring/cloud/client/service/registry/autoconfigure/WebMvcServiceRegistryAutoConfigurationTest.java. This is a non-functional whitespace/formatting change.
Replace @SpringLoggingTest with @LoggingLevelsTest and update imports. Add a new test (testExcludeMappings) that constructs a WebEndpointMapping, injects WebServiceRegistryAutoConfiguration, and verifies excludeMappings removes the mapping. Also add static imports for newLinkedList, ofList and GET, and adjust references to use this.registration for clarity.
Delete the unused import and the @SpringLoggingTest annotation from BaseServiceRegistrationEndpointTest, cleaning up the test class by removing the SpringLoggingTest extension usage.
Replace the previous conditional/parameterized testStart with a simpler test annotated with @LoggingLevelsTest(levels = "ERROR"). The test now asserts that start() returns the same value as isRunning(), called twice, removing redundant true/false assertions and unused static imports. Added the LoggingLevelsTest import and cleaned up imports accordingly.
Replace class-level @SpringLoggingTest with the more granular @LoggingLevelsTest. Updated import to io.microsphere.logging.test.jupiter.LoggingLevelsTest, removed the @SpringLoggingTest annotation on the class, and added @LoggingLevelsTest(levels = "ERROR") to the testAttachMetadata method to scope logging level for that test.
Replace assertFalse/assertTrue with assertEquals assertions that compare endpoint.isRunning() to stop()/start() results for clearer intent. Add import and annotate testStop with @LoggingLevelsTest(levels = "ERROR"). Remove unused static imports of assertFalse/assertTrue.
Clean up import ordering and duplicates in test classes. Move the static getLogger import to a consistent location, add or relocate the Logger import as needed, and tidy blank lines in BaseTest.java and ObservableFeignInvocationHandler.java. No functional changes.
Move the static import of LoggerFactory.getLogger to be grouped with other imports and add a blank line for improved import formatting in the test AQueryMapEncoder. No functional changes; only import ordering/formatting.
Adjust import ordering in BQueryMapEncoder test: move the static import of LoggerFactory.getLogger below other imports and add spacing. No functional changes; only formatting/organizing imports.
…gging-to-check-trace-enabled Refactor: guard all logger calls with isXxxEnabled() checks
|
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.



This pull request introduces significant improvements to project automation, documentation, and build configuration for the Microsphere Spring Cloud project. The changes modernize CI/CD workflows, add new automation for version management and documentation publishing, improve multi-branch support, and update dependencies and documentation for better usability and maintainability.
Key changes include:
CI/CD Workflow Enhancements
merge-main-to-branches.yml) to automatically merge themainbranch intodevandreleasebranches after every push tomain, reducing manual effort and keeping branches synchronized.maven-build.yml) to:main,dev, andreleasebranches../mvnw) for builds.maven-publish.yml) to:wiki-publish.yml) to automatically generate and publish wiki documentation to the GitHub wiki repository whenever Java source files or documentation scripts change.dependabot.yml) to automate dependency update PRs for Maven dependencies.Dependency and Build Configuration Updates
microsphere-spring-cloud-commons/pom.xml, improving compatibility with various service discovery systems. Also includedmicrosphere-spring-boot-actuatoras a dependency.Documentation and Community
README.mdto provide clear project purpose, module descriptions, setup instructions, branch/versioning information, and links to documentation resources. Added badges for build status, code coverage, and documentation.CODE_OF_CONDUCT.mdto establish community standards and encourage a welcoming environment for contributors.These changes collectively improve the project's automation, developer experience, and documentation, making it easier to contribute, maintain, and use across different environments.