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

RUMM-1467 Remove deprecation warnings when compiling the SDK code #550

Merged
merged 1 commit into from
Aug 2, 2021

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Aug 2, 2021

What and why?

🧽 This PR cleans up compiler warnings which pop up when compiling the SDK:

Screenshot 2021-08-02 at 12 39 33

These warnings appear to any user linking the SDK to their project. Their presence is misleading - the user is not using any deprecated API, instead we do it internally in the SDK code. Because the user can't do anything to dismiss it, I'm fixing it in this PR by removing deprecation annotation in these APIs. This operation is safe as explained below.

How?

These warnings were introduced in #523 by marking legacy cases as deprecated in 3 enums:

public enum LogsEndpoint {
   // ...
}
public enum TracesEndpoint {
   // ...
}
public enum RUMEndpoint {
   // ...
}

This isn't required, as those endpoints can only be used in these 3 legacy APIs which (if called) will already emit the deprecation warning:

@available(*, deprecated, message: "This option is replaced by `set(endpoint:)`. Refer to the new API comment for details.")
public func set(logsEndpoint: LogsEndpoint) -> Builder { /* ... */ }

@available(*, deprecated, message: "This option is replaced by `set(endpoint:)`. Refer to the new API comment for details.")
public func set(tracesEndpoint: TracesEndpoint) -> Builder { /* ... */ }

@available(*, deprecated, message: "This option is replaced by `set(endpoint:)`. Refer to the new API comment for details.")
public func set(rumEndpoint: RUMEndpoint) -> Builder { /* ... */ }

All these APIs are already replaced with a single set(endpoint:) which receives DatadogEndpoint enum.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

@ncreated ncreated requested a review from a team as a code owner August 2, 2021 10:58
@ncreated ncreated self-assigned this Aug 2, 2021
@ncreated ncreated merged commit 070edcf into master Aug 2, 2021
@ncreated ncreated deleted the ncreated/RUMM-1467-fix-deprecation-warnings branch August 2, 2021 12:22
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.

2 participants