Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ async def _create_mobile_version(self, _id: str, resource: Dict) -> Tuple[str, s
app_size = sys.getsizeof(blob)
self.config.logger.debug(f"app_size: {app_size}")

# chunk size, 5 MB is the minimum or googleapis throws errors
chunk_size = 1024 * 1024 * 5
# chunk size, 5 MB is the minimum or googleapis throws errors, 10 MB recommended by synthetics team
chunk_size = 1024 * 1024 * 10

# calculate parts
parts = {
"appSize": app_size,
"parts": [],
}
num_of_parts = max(app_size // chunk_size, 1)
num_of_parts = app_size // chunk_size + 1
self.config.logger.debug(f"num_of_parts: {num_of_parts}")
for part_number in list(range(0, num_of_parts)):
start = part_number * chunk_size
Expand Down Expand Up @@ -192,5 +192,6 @@ async def delete_resource(self, _id: str) -> None:
self.resource_config.base_path + f"/{self.config.state.destination[self.resource_type][_id]['id']}"
)


# def connect_id(self, key: str, r_obj: Dict, resource_to_connect: str) -> Optional[List[str]]:
# pass
21 changes: 8 additions & 13 deletions datadog_sync/model/synthetics_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class SyntheticsTests(BaseResource):
],
"roles": ["options.restricted_roles"],
"rum_applications": ["options.rumSettings.applicationId"],
"synthetics_mobile_applications": ["options.mobileApplication.referenceId"],
"synthetics_mobile_applications": [
"options.mobileApplication.referenceId",
"options.mobileApplication.applicationId",
],
},
base_path="/api/v1/synthetics/tests",
excluded_attributes=[
Expand All @@ -47,12 +50,14 @@ class SyntheticsTests(BaseResource):
"options.monitor_options.notify_audit",
"options.monitor_options.new_host_delay",
"options.monitor_options.include_tags",
"steps",
],
null_values={
"on_missing_data": ["show_no_data"],
"notify_audit": [False],
"new_host_delay": [300],
"include_tags": [True],
"steps": [[]],
},
tagging_config=TaggingConfig(path="tags"),
)
Expand Down Expand Up @@ -97,7 +102,8 @@ async def pre_apply_hook(self) -> None:

async def create_resource(self, _id: str, resource: Dict) -> Tuple[str, Dict]:
destination_client = self.config.destination_client
resp = await destination_client.post(self.resource_config.base_path, resource)
test_type = resource["type"]
resp = await destination_client.post(self.resource_config.base_path + f"/{test_type}", resource)

return _id, resp

Expand Down Expand Up @@ -140,16 +146,5 @@ def connect_id(self, key: str, r_obj: Dict, resource_to_connect: str) -> Optiona
if not found:
failed_connections.append(r_obj[key])
return failed_connections
elif resource_to_connect == "synthetics_mobile_applications":
resources = self.config.state.destination[resource_to_connect]
found = False
for k, v in resources.items():
if k.startswith(r_obj[key]):
r_obj[key] = v["id"]
found = True
break
if not found:
failed_connections.append(r_obj[key])
return failed_connections
else:
return super(SyntheticsTests, self).connect_id(key, r_obj, resource_to_connect)
2 changes: 1 addition & 1 deletion datadog_sync/utils/resource_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def check_diff(resource_config, resource, state):
exclude_paths=resource_config.excluded_attributes,
**resource_config.deep_diff_config,
)
#log.info(f"diff: {diff}") # this debug statement will break tests that look for diffs
# log.info(f"diff: {diff}") # this debug statement will break tests that look for diffs
return diff


Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-19T13:47:31.894471-04:00
2025-09-09T14:14:39.997645-04:00
10,183 changes: 5,167 additions & 5,016 deletions tests/integration/cassettes/test_cli/TestCli.test_cleanup.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-19T13:46:56.959314-04:00
2025-09-09T14:14:06.218230-04:00
5,944 changes: 3,029 additions & 2,915 deletions tests/integration/cassettes/test_cli/TestCli.test_import.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-19T13:47:10.082599-04:00
2025-09-09T14:14:19.075968-04:00

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-19T13:47:24.208485-04:00
2025-09-09T14:14:32.371056-04:00
15,214 changes: 7,769 additions & 7,445 deletions tests/integration/cassettes/test_cli/TestCli.test_migrate.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-19T13:47:17.355884-04:00
2025-09-09T14:14:25.793492-04:00
Loading
Loading