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

Deprecate and provide replacements for inconsistent methods #676

Merged
merged 10 commits into from
Aug 13, 2021
Merged

Conversation

imjoehaines
Copy link
Contributor

Goal

For consistency with Bugsnag notifiers for other languages, a number of methods have been deprecated in this PR. The old options will be removed in the next major version

  • The notify_release_stages configuration option has been deprecated in favour of enabled_release_stages
  • The auto_capture_sessions and track_sessions configuration options have been deprecated in favour of auto_track_sessions
  • The Report class has been deprecated in favour of the Event class
  • The Report#meta_data attribute has been deprecated in favour of Report#metadata
  • The Breadcrumb#meta_data attribute has been deprecated in favour of Breadcrumb#metadata
  • The Breadcrumb#name attribute has been deprecated in favour of Breadcrumb#message
  • The breadcrumb type constants in the Bugsnag::Breadcrumbs module has been deprecated in favour of the constants available in the Bugsnag::BreadcrumbType module
    For example, Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE is now available as Bugsnag::BreadcrumbType::ERROR

Design

I've avoided using the alias keyword as YARD will merge the alias into the original attribute, e.g the "also" here:

image

This makes it impossible to mark the original name as deprecated without also marking the new name as deprecated1:

image

Therefore I've implemented the aliases manually to give them their own section in the generated API docs:

image

The new methods use the @!attribute directive so YARD generates the docs as if they were attributes and not methods

1 I believe you can do it as it's a behaviour of the templates YARD uses, but usually aliases being merged is correct so it doesn't seem worth writing new templates just for this PR

This will eventually replace the breadcrumb types in the
Bugsnag::Breadcrumbs module
This will eventually replace notify_release_stages entirely, but
for now exists as an alias
By using them in the Rails 5 app, but not the Rails 4 & 6 apps, we
can be more confident that the aliases work exactly as the old names
did
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Delisa <kattrali@users.noreply.github.com>
@imjoehaines imjoehaines merged commit 5ca25e8 into next Aug 13, 2021
@imjoehaines imjoehaines deleted the aliases branch August 13, 2021 13:51
@imjoehaines imjoehaines mentioned this pull request Sep 17, 2021
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