Skip to content

Commit

Permalink
flattened distribution payload fields
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMoelans committed Nov 25, 2024
1 parent 6097e9d commit 5f9df80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/sentry_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,12 @@ sentry__get_os_context(void)
return os;
}
}
sentry_value_set_by_key(os, "distribution", os_dist);
sentry_value_set_by_key(os, "distribution_name",
sentry_value_get_by_key(os_dist, "name"));
sentry_value_set_by_key(os, "distribution_version",
sentry_value_get_by_key(os_dist, "version"));
sentry_value_set_by_key(os, "distribution_pretty_name",
sentry_value_get_by_key(os_dist, "pretty_name"));
# endif // defined(SENTRY_PLATFORM_LINUX)

return os;
Expand Down
5 changes: 2 additions & 3 deletions tests/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ def assert_meta(
event["contexts"]["os"],
{"name": "Linux", "version": version, "build": build},
)
assert "distribution" in event["contexts"]["os"]
assert "name" in event["contexts"]["os"]["distribution"]
assert "version" in event["contexts"]["os"]["distribution"]
assert "distribution_name" in event["contexts"]["os"]
assert "distribution_version" in event["contexts"]["os"]
elif sys.platform == "darwin":
version = platform.mac_ver()[0].split(".")
if len(version) < 3:
Expand Down

0 comments on commit 5f9df80

Please sign in to comment.