Skip to content

Commit 94686e8

Browse files
Merge branch '1.13.x' into 1.14.x
2 parents e44147a + 9e4dfbf commit 94686e8

File tree

5 files changed

+57
-262
lines changed

5 files changed

+57
-262
lines changed
+21-105
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,28 @@
1-
name: Post Release Workflow
1+
name: Post Release Tasks
22

33
on:
4-
workflow_dispatch: # Enables manual trigger
4+
workflow_dispatch:
5+
inputs:
6+
github_ref_name:
7+
description: "Current release tag in this train (e.g., v1.15.3)"
8+
required: true
9+
previous_ref_name:
10+
description: "Previous release tag in this train (e.g., v1.14.8)"
11+
required: false
512

613
jobs:
7-
generate-release-notes:
8-
name: Generate Release Notes
14+
post_release:
915
runs-on: ubuntu-latest
1016

1117
steps:
12-
- name: Check out the repository
13-
uses: actions/checkout@v3
14-
15-
- name: Download Changelog Generator
16-
run: |
17-
curl -L -o github-changelog-generator.jar https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.11/github-changelog-generator.jar
18-
19-
- name: Generate release notes
20-
id: generate_notes
21-
run: |
22-
java -jar github-changelog-generator.jar \
23-
${GITHUB_REF_NAME#v} \
24-
changelog.md \
25-
--changelog.repository="${{ github.repository }}" \
26-
--github.token="${{ secrets.GITHUB_TOKEN }}"
27-
28-
- name: Run script to process Markdown file
29-
run: python .github/workflows/process_changelog.py
30-
31-
- name: Update release text
32-
run: |
33-
echo -e "::Info::Original changelog\n\n"
34-
cat changelog.md
35-
36-
echo -e "\n\n"
37-
echo -e "::Info::Processed changelog\n\n"
38-
cat changelog-output.md
39-
gh release edit ${{ github.ref_name }} --notes-file changelog-output.md
40-
env:
41-
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
42-
43-
close-milestone:
44-
name: Close Milestone
45-
runs-on: ubuntu-latest
46-
needs: generate-release-notes
47-
steps:
48-
- name: Close milestone
49-
run: |
50-
# Extract version without 'v' prefix
51-
milestone_name=${GITHUB_REF_NAME#v}
52-
53-
echo "Closing milestone: $milestone_name"
54-
55-
# List milestones and find the ID
56-
milestone_id=$(gh api "/repos/${{ github.repository }}/milestones?state=open" \
57-
--jq ".[] | select(.title == \"$milestone_name\").number")
58-
59-
if [ -z "$milestone_id" ]; then
60-
echo "::error::Milestone '$milestone_name' not found"
61-
exit 1
62-
fi
63-
64-
# Close the milestone
65-
gh api --method PATCH "/repos/${{ github.repository }}/milestones/$milestone_id" \
66-
-f state=closed
67-
68-
echo "Successfully closed milestone: $milestone_name"
69-
env:
70-
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
71-
72-
notify:
73-
name: Send Notifications
74-
runs-on: ubuntu-latest
75-
needs: close-milestone
76-
77-
steps:
78-
- name: Announce Release on `Spring-Releases` space
79-
run: |
80-
milestone_name=${GITHUB_REF_NAME#v}
81-
curl --location --request POST '${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}' \
82-
--header 'Content-Type: application/json' \
83-
--data-raw '{ text: "${{ github.event.repository.name }}-announcing ${milestone_name}"}'
84-
85-
- name: Post on Bluesky
86-
env:
87-
BSKY_IDENTIFIER: ${{ secrets.BLUESKY_HANDLE }}
88-
BSKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
89-
run: |
90-
# First get the session token
91-
SESSION_TOKEN=$(curl -s -X POST https://bsky.social/xrpc/com.atproto.server.createSession \
92-
-H "Content-Type: application/json" \
93-
-d "{\"identifier\":\"$BSKY_IDENTIFIER\",\"password\":\"$BSKY_PASSWORD\"}" | \
94-
jq -r .accessJwt)
95-
96-
# Create post content
97-
VERSION=${GITHUB_REF_NAME#v}
98-
POST_TEXT="${{ github.event.repository.name }} ${VERSION} has been released!\n\nCheck out the changelog: https://github.com/${GITHUB_REPOSITORY}/releases/tag/${GITHUB_REF_NAME}"
99-
100-
# Create the post
101-
curl -X POST https://bsky.social/xrpc/com.atproto.repo.createRecord \
102-
-H "Content-Type: application/json" \
103-
-H "Authorization: Bearer ${SESSION_TOKEN}" \
104-
-d "{
105-
\"repo\": \"$BSKY_IDENTIFIER\",
106-
\"collection\": \"app.bsky.feed.post\",
107-
\"record\": {
108-
\"\$type\": \"app.bsky.feed.post\",
109-
\"text\": \"$POST_TEXT\",
110-
\"createdAt\": \"$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")\"
111-
}
112-
}"
18+
- uses: actions/checkout@v4
19+
20+
- name: Run Post Release Tasks
21+
uses: marcingrzejszczak/[email protected]
22+
with:
23+
gh_token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
24+
github_ref_name: ${{ github.event.inputs.github_ref_name }}
25+
previous_ref_name: ${{ github.event.inputs.previous_ref_name }}
26+
spring_release_gchat_webhook_url: ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
27+
bluesky_handle: ${{ secrets.BLUESKY_HANDLE }}
28+
bluesky_password: ${{ secrets.BLUESKY_PASSWORD }}

.github/workflows/process_changelog.py

-148
This file was deleted.

implementations/micrometer-registry-dynatrace/src/test/java/io/micrometer/dynatrace/DynatraceMeterRegistryTest.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,23 @@ void shouldTrackPercentilesWhenDynatraceSummaryInstrumentsNotUsed() throws Throw
171171
DistributionSummary distributionSummary = DistributionSummary.builder("my.ds")
172172
.publishPercentiles(trackedPercentiles)
173173
.register(registry);
174-
CountDownLatch lttCountDownLatch = new CountDownLatch(1);
175174
LongTaskTimer longTaskTimer = LongTaskTimer.builder("my.ltt")
176175
.publishPercentiles(trackedPercentiles)
177176
.register(registry);
178177

179178
timer.record(Duration.ofMillis(100));
180179
distributionSummary.record(100);
181180

181+
CountDownLatch lttCountDownLatch1 = new CountDownLatch(1);
182+
CountDownLatch lttCountDownLatch2 = new CountDownLatch(1);
183+
182184
ExecutorService executorService = Executors.newSingleThreadExecutor();
183185
executorService.submit(() -> longTaskTimer.record(() -> {
184186
clock.add(Duration.ofMillis(100));
187+
lttCountDownLatch1.countDown();
185188

186189
try {
187-
assertThat(lttCountDownLatch.await(300, MILLISECONDS)).isTrue();
190+
assertThat(lttCountDownLatch2.await(300, MILLISECONDS)).isTrue();
188191
}
189192
catch (InterruptedException e) {
190193
throw new RuntimeException(e);
@@ -193,9 +196,10 @@ void shouldTrackPercentilesWhenDynatraceSummaryInstrumentsNotUsed() throws Throw
193196

194197
clock.add(dynatraceConfig.step());
195198

199+
assertThat(lttCountDownLatch1.await(100, MILLISECONDS)).isTrue();
196200
registry.publish();
197201
// release long task timer
198-
lttCountDownLatch.countDown();
202+
lttCountDownLatch2.countDown();
199203

200204
verify(httpClient).send(
201205
assertArg((request -> assertThat(request.getEntity()).asString()

micrometer-jetty12/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies {
2121
testImplementation project(":micrometer-test")
2222

2323
testImplementation libs.httpcomponents.client
24+
testImplementation 'org.awaitility:awaitility'
2425
}
2526

2627
java {

micrometer-jetty12/src/test/java/io/micrometer/jetty12/client/JettyClientMetricsWithObservationTest.java

+28-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@
1616
package io.micrometer.jetty12.client;
1717

1818
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
19+
import io.micrometer.core.instrument.LongTaskTimer;
1920
import io.micrometer.core.instrument.observation.DefaultMeterObservationHandler;
2021
import io.micrometer.observation.ObservationRegistry;
2122
import io.micrometer.observation.tck.TestObservationRegistry;
2223
import org.junit.jupiter.api.BeforeEach;
2324
import org.junit.jupiter.api.Test;
2425

26+
import java.time.Duration;
27+
2528
import static com.github.tomakehurst.wiremock.client.WireMock.*;
2629
import static java.util.concurrent.TimeUnit.SECONDS;
2730
import static org.assertj.core.api.Assertions.assertThat;
31+
import static org.awaitility.Awaitility.await;
2832

2933
class JettyClientMetricsWithObservationTest extends JettyClientMetricsTest {
3034

@@ -47,13 +51,31 @@ protected void addInstrumentingListener() {
4751

4852
@Test
4953
void activeTimer(WireMockRuntimeInfo wmRuntimeInfo) throws Exception {
50-
stubFor(get("/ok").willReturn(ok()));
54+
stubFor(get("/ok").willReturn(ok().withFixedDelay(100)));
55+
56+
Thread thread = new Thread(() -> {
57+
try {
58+
httpClient.GET("http://localhost:" + wmRuntimeInfo.getHttpPort() + "/ok");
59+
}
60+
catch (Exception ex) {
61+
throw new RuntimeException(ex);
62+
}
63+
});
64+
thread.start();
65+
66+
await().atMost(Duration.ofMillis(100))
67+
.pollDelay(Duration.ofMillis(10))
68+
.pollInterval(Duration.ofMillis(10))
69+
.untilAsserted(() -> {
70+
LongTaskTimer longTaskTimer = registry.find("jetty.client.requests.active")
71+
.tags("uri", "/ok", "method", "GET")
72+
.longTaskTimer();
73+
assertThat(longTaskTimer).isNotNull();
74+
assertThat(longTaskTimer.activeTasks()).isOne();
75+
});
76+
77+
thread.join();
5178

52-
httpClient.GET("http://localhost:" + wmRuntimeInfo.getHttpPort() + "/ok");
53-
assertThat(registry.get("jetty.client.requests.active")
54-
.tags("uri", "/ok", "method", "GET")
55-
.longTaskTimer()
56-
.activeTasks()).isOne();
5779
httpClient.stop();
5880

5981
assertThat(singleRequestLatch.await(10, SECONDS)).isTrue();

0 commit comments

Comments
 (0)