Skip to content

Commit 11061e5

Browse files
authored
Merge branch 'main' into jb/sigaction_patch_1
2 parents 68279bc + d832348 commit 11061e5

3 files changed

Lines changed: 67 additions & 11 deletions

File tree

.github/scripts/release.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,48 @@ if [ "$TYPE" == "PATCH" ]; then
6464
create_annotated_tag "$BASE" "$TYPE" "$BRANCH"
6565
fi
6666

67+
# RETAG: re-point an existing tag at the current HEAD of a release branch.
68+
# Use when a partial release (tag + branch created, but no Maven artifacts and
69+
# no final GitHub release yet) needs additional commits (e.g. a cherry-picked fix).
70+
if [ "$TYPE" == "RETAG" ]; then
71+
if [[ ! $BRANCH =~ ^release\/[0-9]+\.[0-9]+\._$ ]] && [ -z "$DRYRUN" ]; then
72+
echo "Retag can only be performed from a 'release/*' branch."
73+
exit 1
74+
fi
75+
TAG_NAME="v_${BASE}"
76+
if ! git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
77+
echo "::error::Tag $TAG_NAME does not exist. Use a normal release to create a new tag."
78+
exit 1
79+
fi
80+
81+
# Refuse to retag if the GitHub release is already public
82+
if command -v gh >/dev/null 2>&1; then
83+
IS_DRAFT=$(gh release view "$TAG_NAME" --json isDraft --jq '.isDraft' 2>/dev/null || echo "not-found")
84+
if [ "$IS_DRAFT" == "false" ]; then
85+
echo "::error::GitHub release $TAG_NAME is already public. Retagging is not allowed."
86+
exit 1
87+
fi
88+
fi
89+
90+
if [ -z "$DRYRUN" ]; then
91+
git tag -f -a "$TAG_NAME" -m "Release v_${BASE} (retag) from ${BRANCH}"
92+
git push --force-with-lease origin "$BRANCH"
93+
git push origin :"$TAG_NAME"
94+
git push origin "$TAG_NAME"
95+
else
96+
echo "[DRY-RUN] Would force-move tag $TAG_NAME to $(git rev-parse HEAD)"
97+
echo "[DRY-RUN] Would push $BRANCH with --force-with-lease"
98+
echo "[DRY-RUN] Would delete and re-push remote tag $TAG_NAME"
99+
fi
100+
101+
echo "==================== RETAG SUMMARY ===================="
102+
echo "Release Branch: $BRANCH"
103+
echo "Retagged Version: $BASE"
104+
echo "Tag: $TAG_NAME -> $(git rev-parse HEAD)"
105+
echo "========================================================"
106+
exit 0
107+
fi
108+
67109
if [ "$BRANCH" != "$RELEASE_BRANCH" ]; then
68110
git checkout -b $RELEASE_BRANCH
69111
if ! git diff --quiet; then

.github/workflows/release-validated.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "major"
1212
- "minor"
1313
- "patch"
14+
- "retag"
1415
default: "minor"
1516
dry_run:
1617
description: Perform the release dry-run
@@ -56,14 +57,14 @@ jobs:
5657
echo "Release type: $TYPE"
5758
5859
# Branch validation
59-
if [ "$TYPE" != "patch" ]; then
60-
if [ "$BRANCH" != "main" ]; then
61-
echo "::error::Major or minor releases can only be performed from 'main' branch"
60+
if [ "$TYPE" == "patch" ] || [ "$TYPE" == "retag" ]; then
61+
if [[ ! $BRANCH =~ ^release/[0-9]+\.[0-9]+\._$ ]]; then
62+
echo "::error::${TYPE^} can only be performed from 'release/*' branches (format: release/X.Y._)"
6263
exit 1
6364
fi
6465
else
65-
if [[ ! $BRANCH =~ ^release/[0-9]+\.[0-9]+\._$ ]]; then
66-
echo "::error::Patch releases can only be performed from 'release/*' branches (format: release/X.Y._)"
66+
if [ "$BRANCH" != "main" ]; then
67+
echo "::error::Major or minor releases can only be performed from 'main' branch"
6768
exit 1
6869
fi
6970
fi
@@ -104,6 +105,19 @@ jobs:
104105
else
105106
RELEASE_VERSION="$BASE"
106107
fi
108+
elif [ "$TYPE" == "retag" ]; then
109+
# Retag reuses the current version; tag must already exist
110+
RELEASE_VERSION="$BASE"
111+
if ! git rev-parse "v_${RELEASE_VERSION}" >/dev/null 2>&1; then
112+
echo "::error::Tag v_${RELEASE_VERSION} does not exist. Use a normal release to create a new tag."
113+
exit 1
114+
fi
115+
# Refuse if the GitHub release is already public
116+
IS_DRAFT=$(gh release view "v_${RELEASE_VERSION}" --json isDraft --jq '.isDraft' 2>/dev/null || echo "not-found")
117+
if [ "$IS_DRAFT" == "false" ]; then
118+
echo "::error::GitHub release v_${RELEASE_VERSION} is already public. Retagging is not allowed."
119+
exit 1
120+
fi
107121
else
108122
# PATCH always increments
109123
RELEASE_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
@@ -112,8 +126,8 @@ jobs:
112126
# Compute release branch
113127
RELEASE_BRANCH="release/${RELEASE_VERSION%.*}._"
114128
115-
# Check if tag already exists
116-
if git rev-parse "v_${RELEASE_VERSION}" >/dev/null 2>&1; then
129+
# Check if tag already exists (skip for retag, which requires it to exist)
130+
if [ "$TYPE" != "retag" ] && git rev-parse "v_${RELEASE_VERSION}" >/dev/null 2>&1; then
117131
echo "::error::Tag v_${RELEASE_VERSION} already exists"
118132
exit 1
119133
fi
@@ -137,7 +151,7 @@ jobs:
137151
138152
pre-release-tests:
139153
needs: validate-inputs
140-
if: ${{ inputs.dry_run != true && inputs.skip_tests != true }}
154+
if: ${{ inputs.dry_run != true && inputs.skip_tests != true && inputs.release_type != 'retag' }}
141155
uses: ./.github/workflows/test_workflow.yml
142156
with:
143157
configuration: '["debug", "asan"]'
@@ -148,7 +162,7 @@ jobs:
148162
runs-on: ubuntu-latest
149163
steps:
150164
- name: Check test results
151-
if: ${{ inputs.dry_run != true && inputs.skip_tests != true && needs.pre-release-tests.result != 'success' }}
165+
if: ${{ inputs.dry_run != true && inputs.skip_tests != true && inputs.release_type != 'retag' && needs.pre-release-tests.result != 'success' }}
152166
run: |
153167
echo "::error::Pre-release tests failed. Cannot proceed with release."
154168
exit 1

ddprof-stresstest/src/jmh/java/com/datadoghq/profiler/stresstest/scenarios/counters/GraphMutation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public static class GraphNode {
1616
public void link(GraphNode node) {
1717
nodes.add(node);
1818

19-
// Switch to new data structure every 100,000 operations
19+
// Switch to new data structure every 1,000 operations
2020
// Other threads can finish with the old one
21-
if (linkCount.incrementAndGet() % 100000 == 0) {
21+
if (linkCount.incrementAndGet() % 1000 == 0) {
2222
nodes = new ConcurrentLinkedQueue<>();
2323
}
2424
}

0 commit comments

Comments
 (0)