Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Remove - [SentryOptions initWithDict:didFailWithError:] #2404

Merged
merged 9 commits into from
Nov 22, 2022

Conversation

kevinrenskers
Copy link
Contributor

@kevinrenskers kevinrenskers commented Nov 18, 2022

📜 Description

Removed - [SentryOptions initWithDict:didFailWithError:]
Removed - [SentrySDK startWithOptions:]
Removed deprecated - [SentryOptions sdkInfo]

I did introduce a new - [SentryOptions initWithDsn:didFailWithError:] method to make it easy to create SentryOptions with a DSN (the most common usage of SentryOptions), while keeping the throwing behavior when the DSN is invalid.

Question 1: I think we should rename - [SentrySDK startWithOptionsObject:] to - [SentrySDK startWithOptions:]. Do you agree?

Question 2: I don't know if this is a feature or a fix? But I went with "ref" now.

Question 3: How do we add breaking changes like this to the changelog?

💡 Motivation and Context

Closes #2395

💚 How did you test it?

Unit tests

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • Review from the native team if needed
  • No breaking changes -> oh yes there are!

🔮 Next steps

Remove `- [SentrySDK startWithOptions:]`
Remove deprecated `- [SentryOptions sdkInfo]`

Closes #2395
@github-actions
Copy link

github-actions bot commented Nov 18, 2022

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.48 ms 1257.34 ms 30.86 ms
Size 20.75 KiB 373.94 KiB 353.19 KiB

Baseline results on branch: 8.0.0

Startup times

Revision Plain With Sentry Diff
58ec104 1244.29 ms 1269.67 ms 25.39 ms
a9e77dc 1231.94 ms 1254.85 ms 22.91 ms
d10145a 1232.65 ms 1257.55 ms 24.90 ms
7eee302 1228.73 ms 1241.94 ms 13.21 ms
dcac8ad 1238.82 ms 1247.80 ms 8.98 ms

App size

Revision Plain With Sentry Diff
58ec104 20.75 KiB 379.11 KiB 358.36 KiB
a9e77dc 20.75 KiB 379.12 KiB 358.36 KiB
d10145a 20.75 KiB 379.12 KiB 358.36 KiB
7eee302 20.75 KiB 374.73 KiB 353.97 KiB
dcac8ad 20.75 KiB 379.11 KiB 358.36 KiB

Previous results on branch: ref/2395-remove-options-dict

Startup times

Revision Plain With Sentry Diff
bd0eaeb 1238.12 ms 1246.08 ms 7.96 ms
87e351e 1221.43 ms 1234.47 ms 13.04 ms
74e0fc3 1244.22 ms 1270.11 ms 25.88 ms
397b93b 1233.94 ms 1267.76 ms 33.82 ms
e09ff64 1234.02 ms 1240.94 ms 6.92 ms
b7bcebd 1217.47 ms 1240.48 ms 23.01 ms
82acb6a 1235.70 ms 1253.28 ms 17.58 ms
bef2c08 1222.90 ms 1226.51 ms 3.61 ms

App size

Revision Plain With Sentry Diff
bd0eaeb 20.75 KiB 369.76 KiB 349.00 KiB
87e351e 20.75 KiB 369.87 KiB 349.12 KiB
74e0fc3 20.75 KiB 369.82 KiB 349.07 KiB
397b93b 20.75 KiB 369.87 KiB 349.12 KiB
e09ff64 20.75 KiB 369.87 KiB 349.12 KiB
b7bcebd 20.75 KiB 373.94 KiB 353.19 KiB
82acb6a 20.75 KiB 369.87 KiB 349.12 KiB
bef2c08 20.75 KiB 373.94 KiB 353.18 KiB

@kevinrenskers
Copy link
Contributor Author

Note: we should change the base branch to some sort of 8.0.0 branch, before merging.

@kevinrenskers
Copy link
Contributor Author

kevinrenskers commented Nov 18, 2022

When I run - [SentryTests testVersion] locally by itself, or by running all the SentryTests.m tests, it always succeeds. But when I run the entire test suite, it always fails, also here on CI. I am not sure what is going on.

testVersion: (([version isEqualToString:SentryMeta.versionString]) is true) failed - Version of bundle:7.31.1 not equal to version of SentryMeta:0.0.1

What is this test even trying to test? 🤔

edit: turns out I had the exact same problem and question in #1960. I hate this test, how it's so easily broken by global variables.

@kevinrenskers kevinrenskers added this to the 8.0.0 milestone Nov 18, 2022
@brustolin
Copy link
Contributor

Question 1: I think we should rename - [SentrySDK startWithOptionsObject:] to - [SentrySDK startWithOptions:]. Do you agree?

Yes, sounds good to me.

@brustolin brustolin changed the base branch from master to milestone/8.0.0 November 21, 2022 06:29
@philipphofmann philipphofmann changed the base branch from milestone/8.0.0 to 8.0.0 November 21, 2022 08:30
* 8.0.0:
  Update CHANGELOG.md (#2415)
  feat: Properly demangle Swift class name (#2162)
  chore: Create 8.0.0 branch
  test: include Sentry changes in hash keys (#2412)
  release: 7.31.2
CHANGELOG.md Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentryOptions.h Show resolved Hide resolved
Sources/Sentry/Public/SentryOptions.h Show resolved Hide resolved
Sources/Sentry/SentryOptions.m Show resolved Hide resolved
Tests/SentryTests/SentryMetaTests.swift Show resolved Hide resolved
@philipphofmann
Copy link
Member

I did introduce a new - [SentryOptions initWithDsn:didFailWithError:] method to make it easy to create SentryOptions with a DSN (the most common usage of SentryOptions), while keeping the throwing behavior when the DSN is invalid.

I would vote for removing this one.

Question 1: I think we should rename - [SentrySDK startWithOptionsObject:] to - [SentrySDK startWithOptions:]. Do you agree?

Yes.

Question 2: I don't know if this is a feature or a fix? But I went with "ref" now.

Ref is fine.

Question 3: How do we add breaking changes like this to the changelog?

I think that's already answered.

@kevinrenskers
Copy link
Contributor Author

I did introduce a new - [SentryOptions initWithDsn:didFailWithError:] method to make it easy to create SentryOptions with a DSN (the most common usage of SentryOptions), while keeping the throwing behavior when the DSN is invalid.

I would vote for removing this one.

Basically every time you instantiate a SentryOptions object, you do that with a DSN. Removing this convenience initializer makes that harder to do to, less obvious you need to set a DSN, and last but not least: you get rid of the throwing behavior when the DSN is invalid. Instead the dev will only get console logs.

Why would you want to remove this?

Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
@kevinrenskers kevinrenskers changed the title ref: Removed - [SentryOptions initWithDict:didFailWithError:] ref: Remove - [SentryOptions initWithDict:didFailWithError:] Nov 21, 2022
@philipphofmann
Copy link
Member

Why would you want to remove this?

Ups sorry. My bad. It was late. [SentryOptions initWithDsn:didFailWithError:] I thought it was [SentrySDK initWithDsn:didFailWithError:]. Please keep it.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM

* 8.0.0:
  ref: Mark [SpanProtocol setExtraValue:forKey] as deprecated (#2413)
  typos (#2421)
  test: Disable NSDataTracker in clearTestState (#2418)
@kevinrenskers kevinrenskers merged commit 68094b3 into 8.0.0 Nov 22, 2022
@kevinrenskers kevinrenskers deleted the ref/2395-remove-options-dict branch November 22, 2022 09:11
@github-actions
Copy link

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Remove `- [SentryOptions initWithDict:didFailWithError:]` ([#2404](https://github.com/getsentry/sentry-cocoa/pull/2404))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 0bf85b3

kevinrenskers added a commit that referenced this pull request Nov 22, 2022
* 8.0.0:
  ref: Remove `- [SentryOptions initWithDict:didFailWithError:]` (#2404)
  ref: Mark [SpanProtocol setExtraValue:forKey] as deprecated (#2413)
  typos (#2421)
  test: Disable NSDataTracker in clearTestState (#2418)
  Update CHANGELOG.md (#2415)
kevinrenskers added a commit that referenced this pull request Nov 22, 2022
* 8.0.0:
  ref: Fix typos in OOMTracker (#2431)
  ref: Make SpanProtocol.data non nullable (#2409)
  ref: add/improve logging (#2420)
  ref: bump supported OS versions (#2414)
  test: shorten some tests (#2428)
  ref: Remove `- [SentryOptions initWithDict:didFailWithError:]` (#2404)
  ref: Mark [SpanProtocol setExtraValue:forKey] as deprecated (#2413)
  typos (#2421)
  test: Disable NSDataTracker in clearTestState (#2418)
  Update CHANGELOG.md (#2415)
  feat: Properly demangle Swift class name (#2162)
  chore: Create 8.0.0 branch
  test: include Sentry changes in hash keys (#2412)
  release: 7.31.2
  fix: Crash in Client when reading integrations (#2398)
  test: tooling improvements (#2400)
  fix: Don't increase session's error count for dropped events (#2374)
  Update CHANGELOG.md (#2396)
  release: 7.31.1
  Fix: Set the correct OOM event timestamp (#2394)

# Conflicts:
#	Sentry.xcodeproj/project.pbxproj
#	SentryPrivate.podspec
#	scripts/add-sentry-to-vlc.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove SentrySDK startWithOptions:optionsDict
3 participants