Skip to content

Commit

Permalink
chore: minor review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Dec 6, 2022
1 parent e3b4a8f commit ceca6c0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contributing

We love receiving PRs from the community with features and fixed.
We love receiving PRs from the community with features and fixed.
For big feature it's advised to raise an issue to discuss it first.

## TLDR:
## TLDR

* Install the .NET SDKs
* To quickly get up and running, you can just run `dotnet build`
Expand Down Expand Up @@ -68,7 +68,7 @@ Note that the MSBuild version should always be `17.0` but will change paths base
We'd love for users to update the SDK everytime and as soon as we make a new release. But in reality most users rarely update the SDK.
To help users see value in updating the SDK, we maintain a changelog file with entries split between two headings:

1. `### Features`
1. `### Features`
2. `### Fixes`

We add the heading in the first PR that's adding either a feature or fixes in the current release.
Expand All @@ -86,3 +86,15 @@ Below that, you'll add the heading 3 mentioned above. For example, if you're add
```

There's a GitHub action check to verify if an entry was added. If the entry isn't a user-facing change, you can skip the verification with `#skip-changelog` written to the PR description. The bot writes a comment in the PR with a suggestion entry to the changelog based on the PR title.

## Verify tests

Some tests use [Verify](https://github.com/VerifyTests/Verify) to check returned objects against snapshots that are part of the repo.
In case you're making code changes that produce many (intended) changes in those snapshots, you can use [accept-verifier-changes.ps1](./scripts/accept-verifier-changes.ps1) like this:

```shell-script
dotnet test
pwsh ./scripts/accept-verifier-changes.ps1
```

You may need to run this multiple times because `dotnet test` stops after a certain number of failures.
5 changes: 2 additions & 3 deletions scripts/update-test-apks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ $apkPrefix = "$repoRoot/test/Sentry.Tests/Internals/android"
function BuildAndroidSample([bool] $UseAssemblyStore, [bool] $UseAssemblyCompression)
{
$sampleDir = "$repoRoot/samples/Sentry.Samples.Android"
$framework = 'net6.0-android'
$outputApk = "$apkPrefix-Store=$UseAssemblyStore-Compressed=$UseAssemblyCompression.apk"

if ($IfNotExist -and (Test-Path $outputApk))
Expand All @@ -24,7 +23,7 @@ function BuildAndroidSample([bool] $UseAssemblyStore, [bool] $UseAssemblyCompres
# Need to do a clean build otherwise some DLLs would end up being compressed even if it's disabled on this run.
git clean -ffxd . | Out-Host

dotnet build --configuration Release --framework $framework `
dotnet build --configuration Release `
--property:AndroidUseAssemblyStore=$UseAssemblyStore `
--property:AndroidEnableAssemblyCompression=$UseAssemblyCompression `
| Out-Host
Expand All @@ -38,7 +37,7 @@ function BuildAndroidSample([bool] $UseAssemblyStore, [bool] $UseAssemblyCompres
Pop-Location
}

Move-Item -Verbose "$sampleDir/bin/Release/$framework/io.sentry.dotnet.samples.android-Signed.apk" $outputApk
Move-Item -Verbose "$sampleDir/bin/Release/*/io.sentry.dotnet.samples.android-Signed.apk" $outputApk
}

if (!$IfNotExist)
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/Extensibility/SentryStackTraceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SentryStackTraceFactory : ISentryStackTraceFactory

var stackTrace = exception is null ? new StackTrace(true) : new StackTrace(exception, true);
var result = DebugStackTrace.Create(_options, stackTrace, isCurrentStackTrace);
_options.LogDebug($"Created {typeof(DebugStackTrace).Name} with {0} frames.", result.Frames.Count);
_options.LogDebug("Created {0} with {1} frames.", typeof(DebugStackTrace).Name, result.Frames.Count);
return result.Frames.Count != 0 ? result : null;
}
}
2 changes: 1 addition & 1 deletion src/Sentry/Internal/DebugStackTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private void InitializeAssemblyReader()
// well, we are out of luck :-(
if (debugId == null)
{
_options.LogDebug("Skipping DebugImage for module '{0}' because DebugId couldn't be determined", module.Name);
_options.LogWarning("Skipping DebugImage for module '{0}' because DebugId couldn't be determined", module.Name);
_debugImageIndexByModule.Add(id, DebugImageMissing); // don't try to resolve again
return null;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Sentry/SentryStackTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public IList<SentryStackFrame> Frames
set => InternalFrames = value;
}

// This class is sealed externally, but can be extended internally.
internal SentryStackTrace() { }

/// <inheritdoc />
public void WriteTo(Utf8JsonWriter writer, IDiagnosticLogger? logger)
{
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/Sentry.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<Import Project="..\..\src\Sentry\buildTransitive\Sentry.props" />

<Target Name="BuildTestAPKs" BeforeTargets="VSTest">
<Exec EnvironmentVariables="IgnoreExitCode=true" Command="pwsh &quot;$(MSBuildThisFileDirectory)/../../scripts/update-test-apks.ps1&quot; -IfNotExist" />
<Exec Command="pwsh &quot;$(MSBuildThisFileDirectory)/../../scripts/update-test-apks.ps1&quot; -IfNotExist" />
</Target>
</Project>

0 comments on commit ceca6c0

Please sign in to comment.