Skip to content

Warn when DDNoopRUMMonitor is sent any DDRUMMonitor methods#1007

Merged
maxep merged 2 commits into
DataDog:developfrom
dfed:dfed--DDNoop-loud-978
Sep 21, 2022
Merged

Warn when DDNoopRUMMonitor is sent any DDRUMMonitor methods#1007
maxep merged 2 commits into
DataDog:developfrom
dfed:dfed--DDNoop-loud-978

Conversation

@dfed

@dfed dfed commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

What and why?

This PR resolves the baseline request in #978 by calling warn() when any method vended by DDRUMMonitor is called on an instance of DDNoopRUMMonitor.

This change will make it more obvious when a DDNoopRUMMonitor has been captured and is being utilized accidentally.

How?

I copied over all methods from DDRUMMonitor into DDNoopRUMMonitor, replaced public with override, and called warn() within each method body.

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 – N/A

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@dfed
dfed marked this pull request as ready for review September 20, 2022 15:04
@dfed
dfed requested a review from a team as a code owner September 20, 2022 15:04
@dfed

dfed commented Sep 20, 2022

Copy link
Copy Markdown
Contributor Author

I could use help understanding what about the Bitrise job failed – I don't have permissions to view the failure message, and the unit test I updated succeeds on my machine.

@maxep maxep left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @dfed ! Thank you so much for this contribution 👍

Indeed, our CI requires a manual trigger before running external PRs. It looks great, only the linter is failing because of that extra line break. After that, it would be good for merging.
Thanks again!

Comment thread Sources/Datadog/RUM/RUMMonitor/DDNoopRUMMonitor.swift Outdated
@maxep
maxep merged commit 77fc236 into DataDog:develop Sep 21, 2022
@maxep maxep mentioned this pull request Nov 8, 2022
6 tasks
@dfed
dfed deleted the dfed--DDNoop-loud-978 branch November 8, 2022 16:58
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