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: Deprecate not needed option sdkInfo #1960

Merged
merged 12 commits into from
Jul 12, 2022

Conversation

kevinrenskers
Copy link
Contributor

@kevinrenskers kevinrenskers commented Jul 11, 2022

📜 Description

options.sdkInfo is deprecated; SentryMeta is now the only source of truth. The values can be overridden by hybrid SDKs via PrivateSentrySDKOnly.

💡 Motivation and Context

Closes #1884

💚 How did you test it?

All the existing tests still run after this refactor. Added new 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

#skip-changelog

🔮 Next steps

@kevinrenskers
Copy link
Contributor Author

It really feels to me that we should deprecate the entire SentrySdkInfo class; just move its serialize method to SentryMeta. It should be removed from SentryOptions and from SentryEnvelopeHeader, and then this class is basically not used anymore. SentrySdkInfo doesn't really have a purpose anymore.

@kevinrenskers kevinrenskers marked this pull request as ready for review July 12, 2022 09:08
@kevinrenskers
Copy link
Contributor Author

Why is testVersion failing on CI, but working on my machine? I don't really understand this test - based on CFBundleIdentifier we test if CFBundleShortVersionString is equal to SentryMeta.versionString. Why is that failing all of a sudden? Where do we overwrite that value, and why? The comment in that test says "since this will be the app version instead of our SDK version" which is weird to me, so sometimes the SDK version is the app version?

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.

Almost LGTM. I'm looking into why testVersion is failing at the moment.

Sources/Sentry/Public/PrivateSentrySDKOnly.h Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentryOptions.h Show resolved Hide resolved
Sources/Sentry/SentryOptions.m Show resolved Hide resolved
@philipphofmann
Copy link
Member

@kevinrenskers, testVersion fails because some tests set the SentryMeta.version to 1.2.3-alpha.0 and don't reset it afterward in the test. Search for 1.2.3-alpha.0 in the project and you are going to find them.

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.

I'm not sure if the tests will succeed. We could add resetSDKInfo, that is going to restore the default values, make it only visible for testing, and call it in tearDown in the ObjC tests and in clearTestState. For only making it visible for testing, we can create a test category like, for example, SentryClient+TestInit.h

@kevinrenskers
Copy link
Contributor Author

Looks like all tests are passing now 🎉

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

@kevinrenskers kevinrenskers merged commit 0be48b6 into master Jul 12, 2022
@kevinrenskers kevinrenskers deleted the ref/1884-deprecate-sdkinfo-option branch July 12, 2022 15:55
kevinrenskers added a commit that referenced this pull request Jul 12, 2022
* master:
  ref: Mark options.sdkInfo as deprecated (#1960)
  feat: Add extra app start span (#1952)
@philipphofmann philipphofmann changed the title ref: Mark options.sdkInfo as deprecated ref: Deprecate not needed option sdkInfo Jul 13, 2022
kevinrenskers added a commit that referenced this pull request Jul 13, 2022
* master:
  fix: Crash in profiling logger (#1964)
  ref: Mark options.sdkInfo as deprecated (#1960)
  feat: Add extra app start span (#1952)
kevinrenskers added a commit that referenced this pull request Jul 13, 2022
* master:
  fix: Crash in profiling logger (#1964)
  ref: Mark options.sdkInfo as deprecated (#1960)
  feat: Add extra app start span (#1952)
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.

Use SentryOptions.sdkInfo instead of SentryMeta
2 participants