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

Ignore nil tags and convert symbol ones #53

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

pschambacher
Copy link
Contributor

@degemer

When upgrading to version 3.0, we got a couple errors. In previous versions (at least v1), you could pass nil tags that would be ignored and symbol tags that would be converted to strings.

This brings the functionality back.

end

def escape_tag_content!(tag)
tag = tag.to_s
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can make this tag = tag.to_s if tag.is_a?(Symbol) to avoid stupid cases like numbers or complex objects

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to check for those, the documentation clearly specifies that tags should be an array of strings. I'm ok with supporting tags because it used to work with 1.x and the change is small, but people reading the documentation will/should likely use strings.

Actually, I think this change is not needed with #51.

@pschambacher pschambacher mentioned this pull request Jun 22, 2017
@degemer degemer added this to the 3.1.0 milestone Jul 14, 2017
Copy link
Member

@degemer degemer left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

I left a small comment, LGTM apart from that.

end

def escape_tag_content!(tag)
tag = tag.to_s
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to check for those, the documentation clearly specifies that tags should be an array of strings. I'm ok with supporting tags because it used to work with 1.x and the change is small, but people reading the documentation will/should likely use strings.

Actually, I think this change is not needed with #51.

@mikhailov
Copy link

mikhailov commented Sep 11, 2017

@degemer
but people reading the documentation will/should likely use strings.

well, we do read documentation, but there is a breaking change that slows down from upgrade applications to the 3.*. However the major version bump perfectly fits to introduce breaking change, so either option would be great to implement:

  1. make the gem backward compatible by merging this PR or Ignore nil tags and convert symbol ones #53
  2. make a configuration option that typecast tags
  3. make a step-by-step guideline to bump the gem, despite of existed documentation there is no effortless way to upgrade it at the moment.

what you think?

Copy link
Contributor

@zippolyte zippolyte left a comment

Choose a reason for hiding this comment

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

Hi @pschambacher, I'm going to merge this, thanks for your contribution

@zippolyte zippolyte merged commit bdf6065 into DataDog:master Oct 26, 2017
@pschambacher
Copy link
Contributor Author

🙇

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.

None yet

4 participants