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

[Issue #125] Enable DatadogCore, DatadogLogs and DatadogTrace to compile on watchOS platform #1946

Merged
merged 14 commits into from
Jul 12, 2024

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Jul 8, 2024

What and why?

Merging #1918 (external) to develop.

More context:

  • As explained in Creating independent watchOS apps independent watchOS apps have similar operation model to iOS apps, hence SDK can collect data using standard model of batching and upload.
  • We only enable DatadogCore, DatadogLogs and DatadogTrace to work on watchOS.
  • This is only basic support to make SDK compile - some functionalities might be degraded and other modules are not yet available for watchOS.

How?

The #1918 was first merged to internal branch. Here w run full CI and do last QA before merging it to develop.

Before release, we will update Supported Versions doc to also reflect the level of support for watchOS platform.

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
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Session Replay

@ncreated ncreated self-assigned this Jul 8, 2024
@ncreated ncreated changed the title [Issue #125] Enable DatadogCore and DatadogLogs to compile on watchOS platform [Issue #125] Enable DatadogCore, DatadogLogs and DatadogTrace to compile on watchOS platform Jul 8, 2024
@ncreated ncreated marked this pull request as ready for review July 8, 2024 15:24
@ncreated ncreated requested review from a team as code owners July 8, 2024 15:24
mariedm
mariedm previously approved these changes Jul 9, 2024
Copy link
Member

@mariedm mariedm left a comment

Choose a reason for hiding this comment

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

LGMT, but I haven't tried to compile it nor ran this branch in a watchOS app.

Comment on lines 17 to 38
#if canImport(UIKit)
import UIKit

#if canImport(WatchKit)
import WatchKit

extension WKInterfaceDevice: DeviceProtocol {}
#else
extension UIDevice: DeviceProtocol {}
#endif

public enum DeviceFactory {
/// Get the current device
public static var current: DeviceProtocol {
#if canImport(WatchKit)
WKInterfaceDevice.current()
#else
UIDevice.current
#endif
}
}
#endif
Copy link
Member

Choose a reason for hiding this comment

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

/blocking Looks like the compilation statement is wrong here, does it actually compile on watchOS? 🤔

Copy link
Member

@maxep maxep Jul 10, 2024

Choose a reason for hiding this comment

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

Actually, I think we should remove this file and only rely on DeviceInfo implementation, which is already based on compile statement for UIKit and macOS. We should add watchOS there IMO.

Copy link
Member

@maxep maxep Jul 11, 2024

Choose a reason for hiding this comment

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

@ncreated, if you agree, I can make the change 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds fair @maxep 👍. Feel free to push to this branch, otherwise I can have a look tomorrow 👍

@maxep maxep force-pushed the jfiser-paylocity/enable-watchos-build branch from 6697b57 to b5215ff Compare July 12, 2024 08:28
@maxep maxep self-requested a review July 12, 2024 08:30
@maxep maxep force-pushed the jfiser-paylocity/enable-watchos-build branch from b5215ff to c9d219c Compare July 12, 2024 09:16
@maxep maxep force-pushed the jfiser-paylocity/enable-watchos-build branch from c9d219c to 4d67a53 Compare July 12, 2024 09:24
@ncreated ncreated merged commit eaafb61 into develop Jul 12, 2024
18 checks passed
@ncreated ncreated deleted the jfiser-paylocity/enable-watchos-build branch July 12, 2024 12:21
@ncreated ncreated mentioned this pull request Jul 12, 2024
@ncreated ncreated mentioned this pull request Jul 25, 2024
3 tasks
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.

4 participants