Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Rename MemoryInfo.AllocatedBytes to MemoryInfo.TotalAllocatedBytes ([#4243](https://github.com/getsentry/sentry-dotnet/pull/4243))
- Replace libcurl with .NET HttpClient for sentry-native ([#4222](https://github.com/getsentry/sentry-dotnet/pull/4222))
- Add .NET MAUI `AutomationId` element information to breadcrumbs ([#4248](https://github.com/getsentry/sentry-dotnet/pull/4248))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamescrosswell it seems like this got merged in the wrong place (it got added to the release notes for 5.10, instead of the Unreleased section). I noticed because I wanted to make sure my PR modified the changelog correctly.

It might be good to think about a way to better automate this process. Perhaps there is a way to have a bot automatically update the changelog, instead of having to do it manually. This way, the modifications always happen in the correct place, and not accidentally in already released sections.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #4273 to fix this.

Copy link
Collaborator

@jamescrosswell jamescrosswell Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KnapSac - much appreciated!

It might be good to think about a way to better automate this process. Perhaps there is a way to have a bot automatically update the changelog, instead of having to do it manually. This way, the modifications always happen in the correct place, and not accidentally in already released sections.

Yeah it's a bit tricky. The PR that updates the changelog in the main branch happens when making a release. We'd need something that went through and automatically updates any other open PRs... I imaging that could be done - just hard to find the time to look at it (given all the other issues on the backlog).

Copy link
Contributor Author

@albyrock87 albyrock87 Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using release-drafter on my project and I'm very happy with it.
https://github.com/nalu-development/nalu/blob/main/.github/workflows/release-drafter.yml

I think it's much better than having a CHANGELOG.md file.
If we still want to have it, maybe some kind of automated process could pull the releases information from GitHub releases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a safe guard, maybe the GH action which checks for a changelog entry could also check that any modifications appear in the Unreleased section, and not in an already released section. It seems like that wouldn't be too hard to implement, but I'm not sure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using release-drafter on my project and I'm very happy with it.

That might be an option if this was an isolated repo. The sentry-dotnet repo is one of over 650 in the getsentry org though so there's a standard release process used across all of the SDKs... it does stuff like updating the latest release version to be referenced in docs and download links etc.

As a safe guard, maybe the GH action which checks for a changelog entry could also check that any modifications appear in the Unreleased section, and not in an already released section. It seems like that wouldn't be too hard to implement, but I'm not sure.

There is a GH action to check that already but some new commits have to be pushed to a PR for it to trigger.

The problem occurs when this sequence of events occurs:

PR1: push changes (changelog entries correctly in unreleased)
-> All CI checks pass
PR2: push changes (changelog entries correctly in unreleased)
-> All CI checks pass
PR1: approve and merge
Create New Release (includes PR1)
-> Change log updated (Unreleased -> New Release)
-> CI checks don't run again on open PRs (i.e. PR2)
PR2: approve and merge
-> The change log entry is now unfortunately part of New Release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about having an UNRELEASED.md file?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - I haven't spent time looking at it to see if that might work.

Releases happen here basically:

- name: Prepare release ${{ github.event.inputs.version }}
uses: getsentry/action-prepare-release@v1

That's a shared github action used by sentry-dotnet and the other repos, using Craft and tying into other things that are required to release stuff for Sentry.


### Fixes

Expand Down
17 changes: 11 additions & 6 deletions src/Sentry.Maui/Internal/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,26 @@ public static void AddElementInfo(this IDictionary<string, string> data,
// The element ID seems to be mostly useless noise
//data.Add(prefix + nameof(element.Id), element.Id.ToString());

if (element.StyleId != null)
if (element.AutomationId is { } automationId)
{
data.Add(prefix + nameof(Element.AutomationId), automationId);
}

if (element.StyleId is { } styleId)
{
// The StyleId correlates to the element's name if one is set in XAML
// TODO: Is there a better way to get this?
data.Add(prefix + "Name", element.StyleId);
data.Add(prefix + "Name", styleId);
}

if (options.IncludeTitleInBreadcrumbs && element is ITitledElement { Title: { } } titledElement)
if (options.IncludeTitleInBreadcrumbs && element is ITitledElement { Title: { } title })
{
data.Add(prefix + nameof(titledElement.Title), titledElement.Title);
data.Add(prefix + nameof(ITitledElement.Title), title);
}

if (options.IncludeTextInBreadcrumbs && element is IText { Text: { } } textElement)
if (options.IncludeTextInBreadcrumbs && element is IText { Text: { } text })
{
data.Add(prefix + nameof(textElement.Text), textElement.Text);
data.Add(prefix + nameof(IText.Text), text);
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/Sentry.Maui.Tests/MauiEventsBinderTests.Element.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void Element_ChildEvents_AddsBreadcrumb(string eventName)
_fixture.Binder.HandleElementEvents(parent);

var child = new MockElement("child");
child.AutomationId = "child-automation-id";

// Act
parent.RaiseEvent(eventName, new ElementEventArgs(child));
Expand All @@ -28,6 +29,7 @@ public void Element_ChildEvents_AddsBreadcrumb(string eventName)
crumb.Data.Should().Contain($"{nameof(MockElement)}.Name", "parent");
crumb.Data.Should().Contain("Element", nameof(MockElement));
crumb.Data.Should().Contain("Element.Name", "child");
crumb.Data.Should().Contain("Element.AutomationId", "child-automation-id");
}

[Theory]
Expand Down
Loading