Skip to content

Commit e1555a5

Browse files
committed
feat: Add report section "Micrometer binders"
1 parent 02bbccd commit e1555a5

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

components/sbm-recipes-boot-upgrade/src/main/resources/recipes/27_30/report/sbu30-report.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,39 @@
635635
# - Your Name[@your-gh-handle]
636636

637637

638+
#
639+
# Generated from https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#micrometer-binders
640+
#
641+
- title: "Micrometer binders"
642+
helper:
643+
type: org.springframework.sbm.boot.upgrade_27_30.report.helper.ConditionOnlyHelper
644+
condition:
645+
type: org.springframework.sbm.build.migration.conditions.AnyEffectiveDependencyExistMatchingRegex
646+
dependencies:
647+
- 'io\.micrometer\:micrometer-.*'
648+
649+
change: |-
650+
The Micrometer team moved the binders to a separate micrometer module named `micrometer-binders`.
651+
To prevent split packages, the imports have changed, too. If you are using the old binders, please adjust your imports from `io.micrometer.core.instrument.binder` to `io.micrometer.binder`.
652+
653+
affected: |-
654+
Actually, we don't know if the scanned application is really affected by this change.
655+
But we found a dependency matching regex `io\.micrometer\:micrometer-.*`.
656+
This indicates that the scanned application might be affected.
657+
remediation:
658+
description: |-
659+
[IMPORTANT]
660+
====
661+
This section has been automatically generated from the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#micrometer-binders[Spring Boot 3.0 Migration Guide^, role="ext-link"]. +
662+
**Please consider contributing to issue https://github.com/spring-projects-experimental/spring-boot-migrator/issues/628[#628^, role="ext-link"]**
663+
====
664+
projects:
665+
- spring-observability
666+
gitHubIssue: 628
667+
# contributors:
668+
# - Your Name[@your-gh-handle]
669+
670+
638671
footer: |-
639672
We want to say thank you to all Contributors:
640673
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright 2021 - 2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.sbm.boot.upgrade_27_30.report.helper;
17+
18+
import org.junit.jupiter.api.Test;
19+
import org.junit.jupiter.api.DisplayName;
20+
import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportTestSupport;
21+
import org.springframework.sbm.engine.context.ProjectContext;
22+
import org.springframework.sbm.project.resource.TestProjectContext;
23+
24+
class MicrometerBindersReportSectionTest {
25+
@Test
26+
@DisplayName("Micrometer binders should render")
27+
void withSingleModuleApplicationShouldRender() {
28+
ProjectContext context = TestProjectContext
29+
.buildProjectContext()
30+
.withSpringBootParentOf("2.7.5")
31+
.withBuildFileHavingDependencies("io.micrometer:micrometer-core:1.10.2")
32+
.build();
33+
34+
SpringBootUpgradeReportTestSupport.generatedSection("Micrometer binders")
35+
.fromProjectContext(context)
36+
.shouldRenderAs("""
37+
=== Micrometer binders
38+
39+
==== What Changed
40+
The Micrometer team moved the binders to a separate micrometer module named `micrometer-binders`.
41+
To prevent split packages, the imports have changed, too. If you are using the old binders, please adjust your imports from `io.micrometer.core.instrument.binder` to `io.micrometer.binder`.
42+
43+
==== Why is the application affected
44+
Actually, we don't know if the scanned application is really affected by this change.
45+
But we found a dependency matching regex `io\\.micrometer\\:micrometer-.*`.
46+
This indicates that the scanned application might be affected.
47+
48+
==== Remediation
49+
[IMPORTANT]
50+
====
51+
This section has been automatically generated from the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#micrometer-binders[Spring Boot 3.0 Migration Guide^, role="ext-link"]. +
52+
**Please consider contributing to issue https://github.com/spring-projects-experimental/spring-boot-migrator/issues/628[#628^, role="ext-link"]**
53+
====
54+
55+
56+
""");
57+
}
58+
59+
@Test
60+
@DisplayName("Micrometer binders should not render")
61+
void shouldNotRender() {
62+
ProjectContext context = TestProjectContext
63+
.buildProjectContext()
64+
.build();
65+
66+
SpringBootUpgradeReportTestSupport.generatedSection("Micrometer binders")
67+
.fromProjectContext(context)
68+
.shouldNotRender();
69+
}
70+
}

0 commit comments

Comments
 (0)