Skip to content

Add Spring milestone repository and update release notes generation#104

Merged
mercyblitz merged 23 commits intomicrosphere-projects:dev-1.xfrom
mercyblitz:dev-1.x
Apr 28, 2026
Merged

Add Spring milestone repository and update release notes generation#104
mercyblitz merged 23 commits intomicrosphere-projects:dev-1.xfrom
mercyblitz:dev-1.x

Conversation

@mercyblitz
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the Maven publishing workflow and refines the actuator auto-configuration logic. The most significant changes are the automation of release notes generation using GitHub Copilot, improvements to conditional bean creation for better compatibility, and enhancements to the test suite for stronger type checks. Additionally, a new repository is added to the Maven parent POM to support milestone dependencies.

Workflow and Release Automation

  • The Maven publishing workflow (.github/workflows/maven-publish.yml) now automatically generates release notes using GitHub Copilot by summarizing commits between tags and formatting them into markdown sections. The generated notes are appended to release-notes.md and used in the GitHub release step.
  • Workflow permissions are updated: the build job now explicitly requests contents: read, and the publish job requests both contents: write and models: read for Copilot API access. [1] [2]
  • After publishing, both pom.xml and release-notes.md are staged and committed for version bumping.

Spring Boot Actuator Auto-Configuration

  • The actuator auto-configuration now uses a string-based type for the @ConditionalOnBean check (METER_REGISTRY_CLASS_NAME) instead of a direct class reference, improving compatibility with optional dependencies. [1] [2]
  • The METER_REGISTRY_CLASS_NAME constant is introduced for this purpose, and relevant imports are adjusted. [1] [2]

Testing Improvements

  • The test suite for actuator auto-configuration is updated to verify the new METER_REGISTRY_CLASS_NAME constant, including a strong type check against MeterRegistry.class.getName(). [1] [2] [3]

Maven Parent POM Updates

  • The Spring Portfolio Milestone Repository is added to the repositories section in microsphere-spring-boot-parent/pom.xml to enable resolving milestone dependencies. [1] [2]

Add a <repositories> section to microsphere-spring-boot-parent/pom.xml registering the Spring Portfolio milestone repository (id: spring-milestone, url: https://repo.spring.io/milestone). This enables resolving Spring milestone artifacts from the parent POM.
Update maven-publish workflow to generate release notes via a Copilot/Models API step. Adds limited permissions (contents: read for build and models: read for the publish job), a Python-based step that collects commits since the previous tag, calls the model to produce concise markdown release notes, appends them to release-notes.md and writes /tmp/current-release-notes.md for the release step. The Create Release step now uses --notes-file and the job also stages release-notes.md so it gets committed after publishing.
Avoid a direct compile-time dependency on Micrometer by replacing @ConditionalOnBean(MeterRegistry.class) with @ConditionalOnBean(type = METER_REGISTRY_CLASS_NAME). Added a string constant METER_REGISTRY_CLASS_NAME (with javadoc) and removed the MeterRegistry import so the conditional is resolved by class name at runtime.
Import MeterRegistry and add assertions in ActuatorAutoConfigurationTest to verify the METER_REGISTRY_CLASS_NAME constant equals the expected fully-qualified name ("io.micrometer.core.instrument.MeterRegistry") and matches MeterRegistry.class.getName(). This strengthens the test by ensuring the constant correctly references the MeterRegistry class name.
Update README: bump branch table versions for 0.2.x and 0.1.x to 0.2.11 and 0.1.11, respectively. Apply minor formatting fixes (adjust blank lines around badges and code blocks, and wrap the 'Before you log a bug' line) to improve readability.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...tuate/autoconfigure/ActuatorAutoConfiguration.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
.../io/microsphere/spring/boot/SpringBootVersion.java 100.00% <100.00%> (ø) 18.00 <0.00> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Delete the <repositories> section from microsphere-spring-boot-parent/pom.xml, removing the spring-milestone repository entry (id: spring-milestone, url: https://repo.spring.io/milestone). This cleans up the parent POM to avoid relying on the Spring milestone repository during builds.
Remove the `permissions: contents: read` block from the build job in the maven-publish workflow. This simplifies the workflow by relying on repository/default permissions instead of an explicit read permission; no other functional changes were made.
Add explicit GitHub Actions permissions block to the Maven workflow, granting read-only access to repository contents. This limits the workflow's token scope and ensures the job has the necessary read access for checkout and related steps.
Give the build job read access to repo contents and improve release notes generation. The AI prompt was expanded to include more structured sections (New Features, Bug Fixes, Documentations, Dependency Updates, Test Improvements, Build and Workflow Enhancements, Other Changes). A Full Changelog link is now generated and appended to the repository NOTES file and the temporary release notes file. Also normalize newlines and use the raw inputs.revision (no implicit "v" prefix) when checking/creating GitHub releases, plus small whitespace/end-of-file fixes.
Change .mvn/wrapper/maven-wrapper.properties to point to Apache's official distribution URL and upgrade the Maven binary from 3.9.9 to 3.9.14 (dlcdn.apache.org). This ensures the wrapper fetches the official Apache Maven 3.9.14 release instead of the previous mirror.
Update the parent POM version from 0.2.6 to 0.2.7 to pick up the latest changes from io.github.microsphere-projects:microsphere-build (build fixes/dependency updates).
Update the <microsphere-spring.version> property in the parent POM from 0.1.9 to 0.1.11 so child modules use the newer microsphere-spring release.
Bump Maven distribution from 3.9.14 to 3.9.15 and update the wrapper distributionUrl to use the Maven Aliyun mirror in .mvn/wrapper/maven-wrapper.properties. This ensures the project uses Maven 3.9.15 and can fetch the binary from an alternate mirror.
Update .mvn/wrapper/maven-wrapper.properties to point distributionUrl to repo1.maven.org (Maven Central) instead of the previous aliyun mirror. Ensures the Maven wrapper downloads the official Apache Maven distribution from Maven Central.
Reduce the GitHub Actions build matrix to Java 8 and 11 and add strategy.max-parallel: 7 to cap concurrent jobs. This lowers CI resource usage and shortens run time by removing additional Java versions and limiting parallelism.
Update microsphere-spring.version in microsphere-spring-boot-parent/pom.xml from 0.1.11 to 0.1.13 to pick up the latest microsphere-spring fixes and improvements.
Delete exclusion entries for org.apache.zookeeper:zookeeper and org.apache.curator (curator-recipes, curator-test) from the io.github.microsphere-projects:microsphere-spring-test test dependency in pom.xml. This allows the previously excluded Curator/Zookeeper test artifacts to be pulled in transitively and available on the test classpath.
Update <microsphere-spring.version> from 0.1.13 to 0.1.14 and remove the junit-bom import from dependencyManagement. Keeps Spring Boot dependency imports intact; no other functional changes.
Add an import for org.junit:junit-bom to the parent POM's dependencyManagement, using ${junit-jupiter.version} to centrally manage JUnit/Jupiter dependency versions across modules. This ensures consistent test dependency versions alongside the existing Spring Boot BOM imports.
Replace the CURRENT enum initialization to use Version.ofVersion(SpringBootVersion.class) instead of parsing the runtime version string. Adds a static import for ofVersion and switches from org.springframework.boot.SpringBootVersion.getVersion() to class-based resolution, making version detection more robust and consistent with Version utilities.
Include ActuatorAutoConfigurationTest.class in the classes arrays for the MeterRegistryPresent and MeterRegistryAbsent @SpringBootTest cases so the test class is loaded into the application context during those tests. This ensures the test's configuration/beans are available when running the actuator-related test scenarios.
Replace MockEnvironment.setProperty with withProperty in SpringApplicationUtilsTest.testGetLoggingLevel to set the logging level. This updates the test to use the current MockEnvironment API (avoids deprecated call and supports fluent usage).
Expand the GitHub Actions maven-build workflow matrix to include JDK 17, 21, and 25 in addition to existing 8 and 11. This updates CI to build and test the project against newer Java releases to ensure compatibility.
@sonarqubecloud
Copy link
Copy Markdown

@mercyblitz mercyblitz merged commit e44b49b into microsphere-projects:dev-1.x Apr 28, 2026
37 checks passed
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.

1 participant