faker-ruby / faker

A library for generating fake data such as names, addresses, and phone numbers.
MIT License
11.28k stars 3.18k forks source link

v3.2.3 correct? #2900

Closed rocket-turtle closed 8 months ago

rocket-turtle commented 10 months ago

Is the Version v3.2.3 of faker correct? (https://github.com/faker-ruby/faker/blob/v3.2.3/CHANGELOG.md)

There are a lot of changes when I compare v3.2.2 and v3.2.3 on github: https://github.com/faker-ruby/faker/compare/v3.2.2...v3.2.3

But there are note the same changes in the gem: https://my.diffend.io/gems/faker/3.2.2/3.2.3

stefannibrasil commented 10 months ago

Hi @rocket-turtle thanks for opening this! AFAIK, 3.2.3 is correct:

https://github.com/faker-ruby/faker/releases/tag/v3.2.3 https://github.com/faker-ruby/faker/blob/v3.2.3/CHANGELOG.md

But I am not sure how https://my.diffend.io/gems works. Not sure what they use to create those diffs. Could you ask them? not sure what to do on our end.

rocket-turtle commented 10 months ago

I'm pretty sure they download the gem from https://rubygems.org/gems/faker and do some comparisons. If I download the gem and search for Music::SmashingPumpkins in the README.md it is not present.

bundle show faker ... /ruby-3.1.4@mhmr/gems/faker-3.2.3

cat ... /ruby-3.1.4@mhmr/gems/faker-3.2.3/README.md | grep 'Music::Rush'

The github stuff seams correct maybe something in the build process of the gem was wrong?

thdaraujo commented 9 months ago

oh I see what you're saying @rocket-turtle . I think some things didn't make to the last release:

irb(main):008> Faker::VERSION
=> "3.2.3"
irb(main):009> Faker::Music::SmashingPumpkins.lyric
(irb):9:in `<main>': uninitialized constant Faker::Music::SmashingPumpkins (NameError)

We'll probably have to cut another release, thanks for reporting this!

stefannibrasil commented 8 months ago

Hi @rocket-turtle thanks for reporting this issue. It's fixed now with the latest release: https://github.com/faker-ruby/faker/releases/tag/v3.3.0 Please let us know if you still have any issues. Thanks!

aprescott commented 8 months ago

For what it's worth in case anyone runs into this same issue, there seems to be a discrepancy between the released 3.2.3 version of the gem and the v3.2.3 git tag on this repo, which currently points to 50146e0582d8af486d7fbe3c0ab833cdbe6e1eed.

Compare:

# On the v3.2.3 git tag
Faker::Config.locale = "en-US"
Faker::PhoneNumber.translate("faker.cell_phone.formats")
# => ["###-###-####", "(###) ###-####", "###.###.####", "### ### ####"]

Within an app I maintain, this isn't the same value:

Faker::VERSION
# => "3.2.3"
Faker::Config.locale = "en-US"
Faker::PhoneNumber.translate("faker.cell_phone.formats")
# => 
# ["\#{PhoneNumber.area_code}-\#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "(\#{PhoneNumber.area_code}) \#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "\#{PhoneNumber.area_code}-\#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "\#{PhoneNumber.area_code}.\#{PhoneNumber.exchange_code}.\#{PhoneNumber.subscriber_number}",
#  "\#{PhoneNumber.area_code}-\#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "(\#{PhoneNumber.area_code}) \#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "\#{PhoneNumber.area_code}-\#{PhoneNumber.exchange_code}-\#{PhoneNumber.subscriber_number}",
#  "\#{PhoneNumber.area_code}.\#{PhoneNumber.exchange_code}.\#{PhoneNumber.subscriber_number}"]

I expected the v3.2.3 tag to point to the same code that the application was using, but that wasn't the case, which hindered some debugging.

stefannibrasil commented 8 months ago

Hi, @aprescott thank you for the detailed notes! I appreciate it.

I'm getting an error after setting the locale to 'en-US', will investigate the issue.

stefannibrasil commented 8 months ago

Ah, I missed this PR: https://github.com/faker-ruby/faker/pull/2924 that solves the phone number issue. Closing this one again. Thanks, everyone!

aprescott commented 8 months ago

@stefannibrasil my apologies! I should have made it clear that the actual issue that led to discovering the tagging issue was handled separately. Sorry about that.

stefannibrasil commented 8 months ago

No problem at all @aprescott 👍