From 386f0e8ad5cbc84627d7fae7294995161a696b26 Mon Sep 17 00:00:00 2001 From: Maciej Burda Date: Wed, 29 May 2024 12:28:44 +0100 Subject: [PATCH 1/3] Reduce telemetry sampling for method called --- DatadogSessionReplay/Sources/Recorder/Recorder.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DatadogSessionReplay/Sources/Recorder/Recorder.swift b/DatadogSessionReplay/Sources/Recorder/Recorder.swift index bc15a36ca8..a216f7cf3b 100644 --- a/DatadogSessionReplay/Sources/Recorder/Recorder.swift +++ b/DatadogSessionReplay/Sources/Recorder/Recorder.swift @@ -99,7 +99,7 @@ public class Recorder: Recording { snapshotProcessor: SnapshotProcessing, resourceProcessor: ResourceProcessing, telemetry: Telemetry, - methodCallTelemetrySamplingRate: Float = 5 + methodCallTelemetrySamplingRate: Float = 0.1 ) { self.uiApplicationSwizzler = uiApplicationSwizzler self.viewTreeSnapshotProducer = viewTreeSnapshotProducer @@ -123,7 +123,7 @@ public class Recorder: Recording { let methodCalledTrace = telemetry.startMethodCalled( operationName: MethodCallConstants.captureRecordOperationName, callerClass: MethodCallConstants.className, - samplingRate: methodCallTelemetrySamplingRate // Effectively 3% * 5% = 0.15% of calls + samplingRate: methodCallTelemetrySamplingRate // Effectively 3% * 0.1% = 0.003% of calls ) var isSuccessful = true do { From 873ba7afd71310eff81b3720a43fa1d941ec988a Mon Sep 17 00:00:00 2001 From: Maciek Grzybowski Date: Wed, 29 May 2024 16:52:12 +0200 Subject: [PATCH 2/3] Fix accessing repository URL in `Package.resolved` (version 2 and 3) --- tools/distribution/dogfood.py | 2 +- tools/distribution/src/dogfood/package_resolved.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/distribution/dogfood.py b/tools/distribution/dogfood.py index 9820e80bee..98200ce9cd 100755 --- a/tools/distribution/dogfood.py +++ b/tools/distribution/dogfood.py @@ -73,7 +73,7 @@ def dogfood(dry_run: bool, repository_url: str, repository_name: str, repository else: package.add_dependency( package_id=dependency_id, - repository_url=dependency['repositoryURL'], + repository_url=dependency['location'], branch=dependency['state'].get('branch'), revision=dependency['state']['revision'], version=dependency['state'].get('version'), diff --git a/tools/distribution/src/dogfood/package_resolved.py b/tools/distribution/src/dogfood/package_resolved.py index 8381d81177..225e452ce9 100644 --- a/tools/distribution/src/dogfood/package_resolved.py +++ b/tools/distribution/src/dogfood/package_resolved.py @@ -361,7 +361,7 @@ def __get_package(self, package_id: PackageID): class PackageResolvedContentV3(PackageResolvedContentV2): """ - Example of `package.resolved` in version `2` looks this:: + Example of `package.resolved` in version `3` looks this:: { "originHash" : "b47de6af98c4a9811a8d2af11d70b960dfc66b7c8e4944b35bb74c8f8bb9c487", From bf157a1edaef108ee8aa064559328f3130ecb8ce Mon Sep 17 00:00:00 2001 From: Maciek Grzybowski Date: Wed, 29 May 2024 17:06:47 +0200 Subject: [PATCH 3/3] Add smoke test for dogfooding automation --- bitrise.yml | 11 +++++++++++ tools/distribution/dogfood.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/bitrise.yml b/bitrise.yml index 36b7a16629..e1cb0a9620 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -536,6 +536,17 @@ workflows: set -e cd tools/distribution && make venv/bin/python3 -m pytest tests + - script: + title: Smoke test dogfooding (with dry-run) + run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}' + inputs: + - content: |- + #!/usr/bin/env bash + set -e + + export DD_DRY_RUN=yes + cd tools/distribution && make + venv/bin/python3 dogfood.py - script: title: Run tests for nightly-unit-tests tool run_if: '{{enveq "DD_RUN_TOOLS_TESTS" "1"}}' diff --git a/tools/distribution/dogfood.py b/tools/distribution/dogfood.py index 98200ce9cd..1a9eb9dcf1 100755 --- a/tools/distribution/dogfood.py +++ b/tools/distribution/dogfood.py @@ -111,6 +111,8 @@ def dogfood(dry_run: bool, repository_url: str, repository_name: str, repository try: dry_run = os.environ.get('DD_DRY_RUN') == 'yes' + if dry_run: + print(f'ℹ️ Running in dry-run mode') skip_datadog_ios = os.environ.get('DD_SKIP_DATADOG_IOS') == 'yes' skip_shopist_ios = os.environ.get('DD_SKIP_SHOPIST_IOS') == 'yes'