Skip to content

Refactor CI workflows and update dependencies#211

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

Refactor CI workflows and update dependencies#211
mercyblitz merged 14 commits intomicrosphere-projects:dev-1.xfrom
mercyblitz:dev-1.x

Conversation

@mercyblitz
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements across the Maven publishing workflow, dependency management, and Spring context codebase. The most significant update is the automation of release notes generation using GitHub Copilot, streamlining the release process. Additionally, there are minor logging and configuration enhancements, as well as version bumps for parent and dependency artifacts.

CI/CD and Release Automation:

  • Added a new step to the .github/workflows/maven-publish.yml workflow that automatically generates release notes using GitHub Copilot and the Models API, formatting them as markdown and appending to release-notes.md. The generated notes are then used in the GitHub release creation step instead of the default autogenerated notes.
  • Updated workflow permissions to include models: read for accessing the Models API.
  • Modified the commit step to include release-notes.md in version control after publishing.

Dependency and Version Management:

  • Bumped the parent POM version in pom.xml to 0.2.7.
  • Updated microsphere-java and microsphere-logging dependency versions in microsphere-spring-parent/pom.xml to 0.2.8 and 0.1.6 respectively.

Spring Context Improvements:

  • Enhanced error logging in BeanListeners.java to check if error logging is enabled before logging.
  • Changed logging level from debug to info in LoggingSmartLifecycle.java for doStart and doStop methods, making lifecycle events more visible by default.
  • Added the source = APPLICATION_SOURCE property to the @ConfigurationProperty annotation in InterceptingApplicationEventMulticasterProxy.java and imported the constant, improving configuration clarity. [1] [2]

Remove the -Dsurefire.useSystemClassLoader=false JVM property from the GitHub Actions Maven build workflow. This change drops the explicit Surefire system classloader override, relying on the plugin's default behavior and avoiding potential classloader-related issues in CI.
Add -Dsurefire.useSystemClassLoader=false to the Maven invocation in .github/workflows/maven-build.yml. This forces Surefire to not use the system classloader during test runs, addressing potential classloader-related test failures or environment issues in the CI workflow.
Add a GitHub Actions workflow that periodically (every 5 minutes) syncs branches from the upstream repository into a fork. The job detects whether the repo is a fork (using gh api + jq) and only runs for forks; it fetches upstream and origin refs, skips branches that don't exist upstream or are already up to date, and pushes upstream/<branch> to origin/<branch> using --force-with-lease. Uses actions/checkout@v5, write permissions for contents, concurrency to cancel in-progress runs, and exits with failure if any branch push fails.
Delete .github/workflows/sync-branches-from-upstream.yml which provided an automated workflow to sync fork branches from the upstream parent. The workflow ran on a 5-minute cron (and via manual dispatch), checked whether the repository was a fork, added the upstream remote, fetched refs, and iterated origin branches to update those that existed in upstream (pushing with force-with-lease). Removing this file disables the frequent automated branch synchronization that the workflow performed.
Update the parent artifact io.github.microsphere-projects:microsphere-build in pom.xml from version 0.2.6 to 0.2.7 to pick up upstream fixes/updates.
Update microsphere-spring-parent/pom.xml to set <microsphere-java.version> from 0.2.6 to 0.2.8, ensuring the project uses the newer microsphere-java release with its fixes/updates.
Update microsphere-logging.version in microsphere-spring-parent/pom.xml from 0.1.5 to 0.1.6 to pick up the newer microsphere-logging release across the project.
Normalize spacing in the GitHub Actions matrix for Java versions and remove the stray leading space from the '25' entry. This ensures the matrix values are consistent and prevents accidental inclusion of a malformed ' 25' string that could cause mismatched runner configuration.
Add a new workflow step that generates release notes using the GitHub Models API (gpt-4o) via a Python script. The step determines the previous tag, collects commits, requests a concise markdown summary, appends a versioned section to release-notes.md, and writes the current notes to /tmp/current-release-notes.md for the release creation step. Also: grant workflows models: read permission, switch the release creation to use --notes-file /tmp/current-release-notes.md (instead of --generate-notes), and include release-notes.md in the post-publish commit so generated notes are persisted. The script falls back to including raw commits if the model call fails.
Wrap the logger.error call in BeanListeners with an if (logger.isErrorEnabled()) guard. This avoids unnecessary evaluation/side-effects of logging arguments during exception handling and reduces logging overhead in the error path.
Minor formatting change in DependencyAnalysisBeanFactoryListener: add a space between 'if' and '(' when checking logger.isTraceEnabled(). No functional change; improves code readability.
Add a source attribute to the @ConfigurationProperty on RESET_BEAN_NAME_PROPERTY_NAME by importing APPLICATION_SOURCE and setting source = APPLICATION_SOURCE. This provides metadata about the configuration property's origin and includes a minor annotation formatting adjustment.
Change LoggingSmartLifecycle to log lifecycle events at INFO level by replacing logger.isDebugEnabled()/logger.debug(...) with logger.isInfoEnabled()/logger.info(...) in doStart() and doStop(), ensuring start/stop messages are visible at INFO level.
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...icrosphere/spring/context/event/BeanListeners.java 0.00% 2 Missing ⚠️
...t/event/DependencyAnalysisBeanFactoryListener.java 0.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ Complexity Δ
.../InterceptingApplicationEventMulticasterProxy.java 97.05% <ø> (ø) 30.00 <0.00> (ø)
...pring/context/lifecycle/LoggingSmartLifecycle.java 100.00% <100.00%> (ø) 6.00 <4.00> (ø)
...t/event/DependencyAnalysisBeanFactoryListener.java 77.72% <0.00%> (ø) 49.00 <0.00> (ø)
...icrosphere/spring/context/event/BeanListeners.java 90.62% <0.00%> (-1.44%) 25.00 <0.00> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mercyblitz mercyblitz merged commit f147ac5 into microsphere-projects:dev-1.x Apr 13, 2026
3 of 102 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