Skip to content

Commit df915f0

Browse files
authored
Merge branch 'master' into bdu/r-gate
2 parents 098e012 + d1794c1 commit df915f0

File tree

7 files changed

+113
-7
lines changed

7 files changed

+113
-7
lines changed

dd-smoke-tests/dynamic-config/src/test/groovy/datadog/smoketest/AppSecActivationSmokeTest.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package datadog.smoketest
22

33
import datadog.smoketest.dynamicconfig.AppSecApplication
4+
import datadog.trace.test.util.Flaky
45

56
class AppSecActivationSmokeTest extends AbstractSmokeTest {
67

@@ -22,6 +23,7 @@ class AppSecActivationSmokeTest extends AbstractSmokeTest {
2223
processBuilder.directory(new File(buildDirectory))
2324
}
2425

26+
@Flaky
2527
void 'test activation config change is sent via RC'() {
2628
when:
2729
setRemoteConfig('datadog/2/ASM_FEATURES/asm_features_activation/config', '{"asm":{"enabled":true}}')

dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
4141
private static final String JAVAC_PLUGIN_VERSION = Config.get().ciVisibilityCompilerPluginVersion
4242
private static final String JACOCO_PLUGIN_VERSION = Config.get().ciVisibilityJacocoPluginVersion
4343

44-
private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 400
45-
private static final int PROCESS_TIMEOUT_SECS = 120
44+
private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 120
45+
private static final int PROCESS_TIMEOUT_SECS = 60
4646

4747
private static final int DEPENDENCIES_DOWNLOAD_RETRIES = 5
4848

@@ -293,9 +293,13 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
293293
private void retryUntilSuccessfulOrNoAttemptsLeft(List<String> mvnCommand, Map<String, String> additionalEnvVars = [:]) {
294294
def processBuilder = createProcessBuilder(mvnCommand, false, false, [], additionalEnvVars)
295295
for (int attempt = 0; attempt < DEPENDENCIES_DOWNLOAD_RETRIES; attempt++) {
296-
def exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS)
297-
if (exitCode == 0) {
298-
return
296+
try {
297+
def exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS)
298+
if (exitCode == 0) {
299+
return
300+
}
301+
} catch (TimeoutException e) {
302+
LOGGER.warn("Failed dependency resolution with exception: ", e)
299303
}
300304
}
301305
throw new AssertionError((Object) "Tried $DEPENDENCIES_DOWNLOAD_RETRIES times to execute $mvnCommand and failed")

dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public final class GeneralConfig {
6262
public static final String HEALTH_METRICS_STATSD_PORT = "trace.health.metrics.statsd.port";
6363
public static final String PERF_METRICS_ENABLED = "trace.perf.metrics.enabled";
6464

65+
public static final String TRACE_STATS_COMPUTATION_ENABLED = "trace.stats.computation.enabled";
6566
public static final String TRACER_METRICS_ENABLED = "trace.tracer.metrics.enabled";
6667
public static final String TRACER_METRICS_BUFFERING_ENABLED =
6768
"trace.tracer.metrics.buffering.enabled";

dd-trace-core/src/test/groovy/datadog/trace/common/metrics/MetricsReliabilityTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class MetricsReliabilityTest extends DDCoreSpecification {
5151
agent.start()
5252
def props = new Properties()
5353
props.put("trace.agent.url", agent.getAddress().toString())
54-
props.put("trace.tracer.metrics.enabled", "true")
54+
props.put("trace.stats.computation.enabled", "true")
5555
def config = Config.get(props)
5656
def sharedComm = new SharedCommunicationObjects()
5757
sharedComm.createRemaining(config)

internal-api/src/main/java/datadog/trace/api/Config.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
import static datadog.trace.api.config.GeneralConfig.TRACER_METRICS_MAX_AGGREGATES;
374374
import static datadog.trace.api.config.GeneralConfig.TRACER_METRICS_MAX_PENDING;
375375
import static datadog.trace.api.config.GeneralConfig.TRACE_DEBUG;
376+
import static datadog.trace.api.config.GeneralConfig.TRACE_STATS_COMPUTATION_ENABLED;
376377
import static datadog.trace.api.config.GeneralConfig.TRACE_TAGS;
377378
import static datadog.trace.api.config.GeneralConfig.TRACE_TRIAGE;
378379
import static datadog.trace.api.config.GeneralConfig.TRIAGE_REPORT_DIR;
@@ -1785,7 +1786,9 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins
17851786
&& configProvider.getBoolean(PERF_METRICS_ENABLED, DEFAULT_PERF_METRICS_ENABLED);
17861787

17871788
// Enable tracer computed trace metrics by default for Azure Functions
1788-
tracerMetricsEnabled = configProvider.getBoolean(TRACER_METRICS_ENABLED, azureFunctions);
1789+
tracerMetricsEnabled =
1790+
configProvider.getBoolean(
1791+
TRACE_STATS_COMPUTATION_ENABLED, azureFunctions, TRACER_METRICS_ENABLED);
17891792
tracerMetricsBufferingEnabled =
17901793
configProvider.getBoolean(TRACER_METRICS_BUFFERING_ENABLED, false);
17911794
tracerMetricsMaxAggregates = configProvider.getInteger(TRACER_METRICS_MAX_AGGREGATES, 2048);

repository.datadog.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
schema-version: v1
3+
kind: mergequeue
4+
enable: false

tooling/perform-release.sh

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Ask for confirmation before continuing the release
5+
function confirmOrAbort() {
6+
read -p "Do you want to continue? (y/N): " -n 1 -r
7+
echo
8+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
9+
echo "Aborting."
10+
exit 1
11+
fi
12+
}
13+
14+
# Check if current branch is either 'master' or 'release/v*'
15+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
16+
if [[ "$CURRENT_BRANCH" == "master" ]]; then
17+
MINOR_RELEASE=true
18+
elif [[ "$CURRENT_BRANCH" =~ ^release/v[0-9]+\.[0-9]+\.x$ ]]; then
19+
MINOR_RELEASE=false
20+
else
21+
echo "❌ Please check out either 'master' branch or a 'release/v*' branch to perform a release first."
22+
exit 1
23+
fi
24+
echo -n "✅ Current branch is '$CURRENT_BRANCH'. Performing a "
25+
if [ "$MINOR_RELEASE" = true ]; then
26+
echo "minor release."
27+
else
28+
echo "patch release."
29+
fi
30+
31+
# Check upstream branch is set
32+
if ! git rev-parse --abbrev-ref --symbolic-full-name "@{u}" >/dev/null 2>&1; then
33+
echo "❌ No upstream branch set. Please set the upstream branch for the current branch."
34+
exit 1
35+
fi
36+
37+
# Get the remote name
38+
REMOTE=$(git config --get "branch.$CURRENT_BRANCH.remote")
39+
if [ -z "$REMOTE" ]; then
40+
echo "❌ Unable to determine the remote name. Please ensure you have a remote set."
41+
exit 1
42+
fi
43+
44+
# Check if working copy is clean
45+
if ! git diff-index --quiet HEAD; then
46+
echo "❌ Working copy is not clean. Please commit or stash your changes before performing a release."
47+
exit 1
48+
fi
49+
50+
# Check if clone is up to date
51+
if ! git fetch "$REMOTE" --quiet ; then
52+
echo "❌ Unable to fetch the latest changes from $REMOTE. Please check your network connection."
53+
exit 1
54+
fi
55+
if ! git diff-index --quiet "$REMOTE/$CURRENT_BRANCH"; then
56+
echo "❌ Working copy is not up to date with $REMOTE/$CURRENT_BRANCH. Please pull the latest changes before performing a release."
57+
exit 1
58+
fi
59+
echo "✅ Working copy is clean and up-to-date."
60+
61+
# Check the git log history
62+
LAST_RELEASE_TAG=$(git describe --tags --abbrev=0 --match='v[0-9]*.[0-9]*.[0-9]*')
63+
echo "ℹ️ Last release version: $LAST_RELEASE_TAG"
64+
SUSPICIOUS_COMMITS=$(git log --oneline --first-parent "$LAST_RELEASE_TAG"..HEAD | grep -E -v "Merge pull request #" | grep -E -v "\(#")
65+
if [ -n "$SUSPICIOUS_COMMITS" ]; then
66+
echo "❌ The following commits are not merge commits and may not be suitable for a release:"
67+
echo "$SUSPICIOUS_COMMITS"
68+
echo "Please review these commits before proceeding with the release."
69+
confirmOrAbort
70+
else
71+
echo "✅ All commits since the last release are merge commits."
72+
fi
73+
74+
# Get the next release version
75+
VERSION=$(echo "$LAST_RELEASE_TAG" | grep -E '^v[0-9]+\.[0-9]+\.0$' | sed 's/^v//')
76+
if [ -z "$VERSION" ]; then
77+
echo "❌ Unable to determine the next release version from the last release tag: $LAST_RELEASE_TAG"
78+
exit 1
79+
fi
80+
if [ "$MINOR_RELEASE" = true ]; then
81+
NEXT_RELEASE_VERSION=$(echo "$VERSION" | awk -F. '{printf "v%d.%d.0", $1, $2 + 1}')
82+
else
83+
NEXT_RELEASE_VERSION=$(echo "$VERSION" | awk -F. '{printf "v%d.%d.%d", $1, $2, $3 + 1}')
84+
fi
85+
echo "ℹ️ Next release version: $NEXT_RELEASE_VERSION"
86+
87+
# Create and push the release tag
88+
echo "ℹ️ The release tag will be created and pushed. No abort is possible after this point."
89+
confirmOrAbort
90+
git tag -a -s -m "Release $NEXT_RELEASE_VERSION" "$NEXT_RELEASE_VERSION"
91+
git push "$REMOTE" "$NEXT_RELEASE_VERSION" --no-verify
92+
echo "✅ Release tag $NEXT_RELEASE_VERSION created and pushed to $REMOTE."

0 commit comments

Comments
 (0)