Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5dc1436
chore: merge release-1.x into dev-1.x [skip ci]
github-actions[bot] Apr 8, 2026
5a8b4b8
Add Spring milestone repository to parent POM
mercyblitz Apr 10, 2026
df44256
Add Copilot-generated release notes
mercyblitz Apr 10, 2026
d658294
Use type-based ConditionalOnBean for MeterRegistry
mercyblitz Apr 10, 2026
bde8838
Add tests for METER_REGISTRY_CLASS_NAME constant
mercyblitz Apr 10, 2026
71dcac9
Bump README branch versions and format
mercyblitz Apr 10, 2026
1b390b5
Remove Spring milestone repository from parent POM
mercyblitz Apr 10, 2026
c9b3be8
Remove explicit contents permission from build job
mercyblitz Apr 10, 2026
34fdb3e
Set workflow permissions for Maven build
mercyblitz Apr 14, 2026
62bd45a
Enhance release workflow notes and permissions
mercyblitz Apr 14, 2026
b89c428
Update Maven distribution to 3.9.14
mercyblitz Apr 14, 2026
02fbe38
Bump parent version to 0.2.7
mercyblitz Apr 14, 2026
d543a58
Bump microsphere-spring version to 0.1.11
mercyblitz Apr 14, 2026
93220d1
Update Maven wrapper to 3.9.15 (Aliyun mirror)
mercyblitz Apr 27, 2026
545c8aa
Switch Maven wrapper to Maven Central
mercyblitz Apr 27, 2026
4770853
Limit Java matrix and set max-parallel
mercyblitz Apr 27, 2026
4a3542e
Bump microsphere-spring to 0.1.13
mercyblitz Apr 27, 2026
33c07fd
Remove exclusions from microsphere-spring-test
mercyblitz Apr 28, 2026
ec0c13d
Bump microsphere-spring to 0.1.14; drop JUnit BOM
mercyblitz Apr 28, 2026
6b50a6a
Import JUnit BOM in dependencyManagement
mercyblitz Apr 28, 2026
8b7b439
Use Version.ofVersion for CURRENT
mercyblitz Apr 28, 2026
bb1f3ba
Register test class in @SpringBootTest classes
mercyblitz Apr 28, 2026
0663ff5
Use MockEnvironment.withProperty in test
mercyblitz Apr 28, 2026
7daa832
Add Java 17, 21, 25 to CI matrix
mercyblitz Apr 28, 2026
e44b49b
Merge pull request #104 from mercyblitz/dev-1.x
mercyblitz Apr 28, 2026
030cf33
Merge branch 'release-1.x' into dev-1.x
mercyblitz Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

name: Maven Build

permissions:
contents: read

on:
push:
branches: [ 'dev-1.x' ]
Expand All @@ -18,6 +21,7 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 7
matrix:
java: [ '8', '11' , '17' , '21' , '25' ]
maven-profile-spring-boot: [ 'spring-boot-2.1' , 'spring-boot-2.2' , 'spring-boot-2.3',
Expand Down
100 changes: 92 additions & 8 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ inputs.revision }}
steps:
- name: Validate version format
Expand Down Expand Up @@ -60,12 +62,12 @@ jobs:
SIGN_KEY: ${{ secrets.OSS_SIGNING_KEY }}
SIGN_KEY_PASS: ${{ secrets.OSS_SIGNING_PASSWORD }}


release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
models: read
steps:
- name: Checkout Source
uses: actions/checkout@v5
Expand All @@ -83,14 +85,96 @@ jobs:
git push origin ${{ inputs.revision }}
fi

- name: Generate Release Notes with Copilot
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_TAG="${{ inputs.revision }}"

# Find the previous tag (the one before the current tag)
PREV_TAG=$(git describe --tags --abbrev=0 --exclude="${CURRENT_TAG}" HEAD 2>/dev/null || echo "")

# Collect commits between the previous tag and HEAD
if [ -n "$PREV_TAG" ]; then
COMMITS=$(git log --oneline "${PREV_TAG}..HEAD" 2>/dev/null || echo "No commits found")
SINCE_LABEL="$PREV_TAG"
else
COMMITS=$(git log --oneline -50 2>/dev/null || echo "No commits found")
SINCE_LABEL="the beginning"
fi

# Export for Python (avoids shell-escaping issues with multiline content)
export CURRENT_TAG_DATA="$CURRENT_TAG"
export PREV_TAG_DATA="$SINCE_LABEL"
export COMMITS_DATA="$COMMITS"

# Call GitHub Copilot via GitHub Models API and capture the summary
SUMMARY=$(python3 << 'PYEOF'
import json, os, urllib.request, sys

current_tag = os.environ['CURRENT_TAG_DATA']
prev_tag = os.environ['PREV_TAG_DATA']
commits = os.environ['COMMITS_DATA']
token = os.environ['GH_TOKEN']

prompt = (
f"Generate concise release notes for version {current_tag}.\n\n"
f"Commits since {prev_tag}:\n{commits}\n\n"
"Format the output as markdown with sections if present for New Features, Bug Fixes, "
"Documentations, Dependency Updates, Test Improvements, Build and Workflow Enhancements "
"and Other Changes(excludes Full Changelog).\n\n"
"Be concise and clear."
)

payload = json.dumps({
"model": "gpt-4o",
"messages": [{"role": "user", "content": prompt}]
}).encode()

req = urllib.request.Request(
"https://models.inference.ai.azure.com/chat/completions",
data=payload,
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {token}"
}
)

try:
with urllib.request.urlopen(req) as resp:
data = json.loads(resp.read())
print(data["choices"][0]["message"]["content"])
except Exception as e:
print(f"Failed to generate summary via Copilot: {e}", file=sys.stderr)
print(f"_Release notes generation failed. Raw commits since {prev_tag}:_\n\n```\n{commits}\n```")
PYEOF
)

# Append the summary (with version header) to release-notes.md
NOTES_FILE="release-notes.md"
if [ ! -f "$NOTES_FILE" ]; then
printf "# Release Notes\n\n" > "$NOTES_FILE"
fi

FULL_CHANGELOG="**Full Changelog**: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/$PREV_TAG...$CURRENT_TAG"

printf "## v%s\n\n%s\n\n" "$CURRENT_TAG" "$SUMMARY" >> "$NOTES_FILE"
printf "%s" "$FULL_CHANGELOG" >> "$NOTES_FILE"

# Write the current release notes to a temp file for the Create Release step
printf "%s\n\n" "$SUMMARY" > /tmp/current-release-notes.md
printf "%s" "$FULL_CHANGELOG" >> /tmp/current-release-notes.md

echo "Release notes generated and appended to $NOTES_FILE"

- name: Create Release
run: |
if gh release view "v${{ inputs.revision }}" >/dev/null 2>&1; then
echo "Release v${{ inputs.revision }} already exists, skipping."
if gh release view "${{ inputs.revision }}" >/dev/null 2>&1; then
echo "Release ${{ inputs.revision }} already exists, skipping."
else
gh release create v${{ inputs.revision }} \
--title "v${{ inputs.revision }}" \
--generate-notes \
gh release create ${{ inputs.revision }} \
--title "${{ inputs.revision }}" \
--notes-file /tmp/current-release-notes.md \
--latest
fi
env:
Expand All @@ -111,7 +195,7 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pom.xml
git add pom.xml release-notes.md
git diff --cached --quiet && echo "No changes to commit" || \
git commit -m "chore: bump version to next patch after publishing ${{ inputs.revision }}" && git push

Expand All @@ -127,4 +211,4 @@ jobs:
echo "::error::Merge conflict detected when merging release-1.x into dev-1.x. Manual intervention required."
exit 1
fi
git push origin dev-1.x
git push origin dev-1.x
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://dlcdn.apache.org/maven/maven-3/3.9.14/binaries/apache-maven-3.9.14-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
![Maven](https://img.shields.io/maven-central/v/io.github.microsphere-projects/microsphere-spring-boot.svg)
![License](https://img.shields.io/github/license/microsphere-projects/microsphere-spring-boot.svg)


Microsphere Spring Boot is a collection of libraries that extends Spring Boot's capabilities with additional features
focused on configuration management, application diagnostics, and enhanced monitoring. The project is structured as a
multi-module Maven project that follows Spring Boot's conventions while providing value-added functionality.
Expand Down Expand Up @@ -41,6 +40,7 @@ The easiest way to get started is by adding the Microsphere Spring Boot BOM (Bil
pom.xml:

```xml

<dependencyManagement>
<dependencies>
...
Expand All @@ -61,12 +61,13 @@ pom.xml:

| **Branches** | **Purpose** | **Latest Version** |
|--------------|--------------------------------------------------|--------------------|
| **0.2.x** | Compatible with Spring Boot 3.0.x - 3.5.x, 4.0.x | 0.2.10 |
| **0.1.x** | Compatible with Spring Boot 2.0.x - 2.7.x | 0.1.10 |
| **0.2.x** | Compatible with Spring Boot 3.0.x - 3.5.x, 4.0.x | 0.2.11 |
| **0.1.x** | Compatible with Spring Boot 2.0.x - 2.7.x | 0.1.11 |

Then add the specific modules you need:

```xml

<dependencies>
<!-- Microsphere Spring Boot Core -->
<dependency>
Expand Down Expand Up @@ -131,7 +132,8 @@ We welcome your contributions! Please read [Code of Conduct](./CODE_OF_CONDUCT.m

## Reporting Issues

* Before you log a bug, please search the [issues](https://github.com/microsphere-projects/microsphere-spring-boot/issues)
* Before you log a bug, please search
the [issues](https://github.com/microsphere-projects/microsphere-spring-boot/issues)
to see if someone has already reported the problem.
* If the issue doesn't already
exist, [create a new issue](https://github.com/microsphere-projects/microsphere-spring-boot/issues/new).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package io.microsphere.spring.boot.actuate.autoconfigure;

import io.micrometer.core.instrument.MeterRegistry;
import io.microsphere.annotation.ConfigurationProperty;
import io.microsphere.spring.boot.actuate.MonitoredThreadPoolTaskScheduler;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -87,6 +86,12 @@ public class ActuatorAutoConfiguration {
*/
public static final String ACTUATOR_TASK_SCHEDULER_SERVICE_BEAN_NAME = "actuatorTaskScheduler";

/**
* The class name of {@link io.micrometer.core.instrument.MeterRegistry}
* @see io.micrometer.core.instrument.MeterRegistry
*/
static final String METER_REGISTRY_CLASS_NAME = "io.micrometer.core.instrument.MeterRegistry";

/**
* Creates a {@link MonitoredThreadPoolTaskScheduler} bean for actuator tasks, configured
* with the given pool size and thread name prefix.
Expand All @@ -103,7 +108,7 @@ public class ActuatorAutoConfiguration {
* @param threadNamePrefix the prefix for thread names created by the scheduler
* @return a configured {@link ThreadPoolTaskScheduler} instance
*/
@ConditionalOnBean(MeterRegistry.class)
@ConditionalOnBean(type = METER_REGISTRY_CLASS_NAME)
@Bean(name = ACTUATOR_TASK_SCHEDULER_SERVICE_BEAN_NAME, destroyMethod = "shutdown")
public ThreadPoolTaskScheduler actuatorTaskScheduler(
@Value(TASK_SCHEDULER_POOL_SIZE_VALUE_EXPRESSION) int poolSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.microsphere.spring.boot.actuate.autoconfigure;

import io.micrometer.core.instrument.MeterRegistry;
import org.junit.jupiter.api.ClassOrderer.OrderAnnotation;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
Expand All @@ -31,6 +32,7 @@

import static io.microsphere.spring.boot.actuate.autoconfigure.ActuatorAutoConfiguration.ACTUATOR_TASK_SCHEDULER_SERVICE_BEAN_NAME;
import static io.microsphere.spring.boot.actuate.autoconfigure.ActuatorAutoConfiguration.DEFAULT_TASK_SCHEDULER_POOL_SIZE;
import static io.microsphere.spring.boot.actuate.autoconfigure.ActuatorAutoConfiguration.METER_REGISTRY_CLASS_NAME;
import static io.microsphere.spring.boot.actuate.autoconfigure.ActuatorAutoConfiguration.TASK_SCHEDULER_POOL_SIZE_PROPERTY_NAME;
import static io.microsphere.spring.boot.actuate.autoconfigure.ActuatorAutoConfiguration.TASK_SCHEDULER_THREAD_NAME_PREFIX_PROPERTY_NAME;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -53,6 +55,9 @@ void testConstants() {
assertEquals("1", DEFAULT_TASK_SCHEDULER_POOL_SIZE);
assertEquals("microsphere.spring.boot.actuator.task-scheduler.pool-size", TASK_SCHEDULER_POOL_SIZE_PROPERTY_NAME);
assertEquals("microsphere.spring.boot.actuator.task-scheduler.thread-name-prefix", TASK_SCHEDULER_THREAD_NAME_PREFIX_PROPERTY_NAME);
assertEquals("io.micrometer.core.instrument.MeterRegistry", METER_REGISTRY_CLASS_NAME);
// test for strong type check
assertEquals(MeterRegistry.class.getName(), METER_REGISTRY_CLASS_NAME);
}

@Order(1)
Expand All @@ -61,7 +66,8 @@ void testConstants() {
@SpringBootTest(
webEnvironment = NONE,
classes = {
MeterRegistryPresent.class
MeterRegistryPresent.class,
ActuatorAutoConfigurationTest.class
}, properties = {
"microsphere.spring.boot.actuator.task-scheduler.pool-size=2",
"microsphere.spring.boot.actuator.task-scheduler.thread-name-prefix=my-prefix",
Expand Down Expand Up @@ -104,7 +110,8 @@ void testActuatorTaskScheduler() {
@SpringBootTest(
webEnvironment = NONE,
classes = {
MeterRegistryAbsent.class
MeterRegistryAbsent.class,
ActuatorAutoConfigurationTest.class
}, properties = {
// Spring Boot [2.x,3.x]
"microsphere.autoconfigure.exclude[0]=org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration",
Expand Down
14 changes: 0 additions & 14 deletions microsphere-spring-boot-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static io.microsphere.constants.SymbolConstants.DOT_CHAR;
import static io.microsphere.constants.SymbolConstants.UNDER_SCORE_CHAR;
import static io.microsphere.util.Version.of;
import static io.microsphere.util.Version.ofVersion;

/**
* The enumeration for the released Spring Boot versions since 2.0
Expand Down Expand Up @@ -292,7 +293,7 @@ public enum SpringBootVersion {

SPRING_BOOT_2_7_18,

CURRENT(of(org.springframework.boot.SpringBootVersion.getVersion()));
CURRENT(ofVersion(org.springframework.boot.SpringBootVersion.class));

private final Version version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void testLog() {

void testGetLoggingLevel(String level) {
MockEnvironment environment = new MockEnvironment();
environment.setProperty(MICROSPHERE_SPRING_BOOT_LOGGING_LEVEL_PROPERTY_NAME, level);
environment.withProperty(MICROSPHERE_SPRING_BOOT_LOGGING_LEVEL_PROPERTY_NAME, level);
assertEquals(level, getLoggingLevel(environment));
}

Expand Down
4 changes: 1 addition & 3 deletions microsphere-spring-boot-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<description>Microsphere Spring Boot Parent</description>

<properties>
<microsphere-spring.version>0.1.9</microsphere-spring.version>
<microsphere-spring.version>0.1.14</microsphere-spring.version>
<jolokia.version>1.7.2</jolokia.version>
<!-- Testing -->
<junit-jupiter.version>5.14.3</junit-jupiter.version>
Expand Down Expand Up @@ -57,7 +57,6 @@
</dependencyManagement>

<profiles>

<profile>
<id>spring-boot-2.1</id>
<properties>
Expand Down Expand Up @@ -109,6 +108,5 @@
<spring-boot.version>2.7.18</spring-boot.version>
</properties>
</profile>

</profiles>
</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-build</artifactId>
<version>0.2.6</version>
<version>0.2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading