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

feat(music): add album and artist methods #2620

Merged

Conversation

jeremyhofer
Copy link
Contributor

@jeremyhofer jeremyhofer commented Jan 24, 2024

This PR introduces two new methods to the music module. albumName and artist.

Data was sourced from various resources from a number of resources online, including:

The @since version on the methods was set to 8.5.0, as it looks like the 8.4.0 tag has been created.

@jeremyhofer jeremyhofer requested a review from a team as a code owner January 24, 2024 03:21
Copy link
Contributor

@matthewmayer matthewmayer left a comment

Choose a reason for hiding this comment

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

  1. We normally limit to 1000 entries per file
  2. Suggest splitting into two PRs, one for adding data for existing methods (since that can be done in a patch release) and one for proposing new methods
  3. Some of the genres look a bit awkward like "Holiday: Other". Maybe remove ones like that.

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (91a4d3d) to head (65c11e9).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2620      +/-   ##
==========================================
- Coverage   99.96%   99.95%   -0.01%     
==========================================
  Files        2973     2975       +2     
  Lines      212501   214451    +1950     
  Branches      948      601     -347     
==========================================
+ Hits       212422   214358    +1936     
- Misses         79       93      +14     
Files Coverage Δ
src/locales/en/music/album.ts 100.00% <100.00%> (ø)
src/locales/en/music/artist.ts 100.00% <100.00%> (ø)
src/locales/en/music/index.ts 100.00% <100.00%> (ø)
src/modules/music/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@matthewmayer matthewmayer added the m: music Something is referring to the music module label Jan 24, 2024
@jeremyhofer jeremyhofer force-pushed the music-artist-album-new-genres-songs branch from 338b3be to 1a58eb8 Compare January 25, 2024 00:04
@jeremyhofer
Copy link
Contributor Author

@matthewmayer thanks for the feedback!

I pulled the genre and song name additions out of this PR. Will raise a PR to add and clean up the additional genres. Given the song name set is near 1000 entries I'm discarding all my changes there.

I updated the added album_name and artist sets down to 1000 entries each.

@jeremyhofer jeremyhofer changed the title feat(music): add albumName and artist methods add additional genres and songs feat(music): add albumName and artist methods Jan 25, 2024
src/modules/music/index.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: feature Request for new feature labels Jan 25, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Jan 25, 2024
@matthewmayer
Copy link
Contributor

Non ascii names are OK as long as that's how they are normally written in English

src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/locales/en/music/artist.ts Show resolved Hide resolved
@matthewmayer
Copy link
Contributor

FWIW although we would normally wait for 10 upvotes to approve a change like this this does seem a fairly sensible extension of the current music module so I'd be fine with approving this for next minor or major release.

@jeremyhofer
Copy link
Contributor Author

Updated to remove albums that could be confusing - the ones that were called out, as well as others I felt could similarly cause some confusion. Updated to case insensitive sort the data as well.

Thanks for considering these methods! Would it be possible to add the ask to propose and vote on new modules and methods to the docs and CONTRIBUTING.md? I was unaware this was the general expectation when I got started in the repo 😃

@matthewmayer
Copy link
Contributor

Would it be possible to add the ask to propose and vote on new modules and methods to the docs and CONTRIBUTING.md? I was unaware this was the general expectation when I got started in the repo 😃

Its not really a hard requirement, its more to help triage the issues that are added to the project. So if someone adds an issue saying "it would be cool if we had artist names" we will normally wait until >10 upvotes to see if other people would find it useful. If someone sources suitable data, makes a PR, adds tests etc, then the threshold for inclusion is lower!

So I think being too strict about it and documenting in CONTRIBUTING might discourage people from actually contributing code, which we wouldnt want.

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

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

Some small updates to the documentation. Otherwise this looks good to me.

src/modules/music/index.ts Outdated Show resolved Hide resolved
src/modules/music/index.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label Apr 11, 2024
@ST-DDT
Copy link
Member

ST-DDT commented Apr 11, 2024

We talked about this PR in today's team meeting.
There we discussed whether the methods (and definitions) should use the Name suffix.
In our oppinion album and albumName convey the same information and thus we should only use album().

The definitions should follow the method's name unless there is a need for disambiaguation such as with _pattern.
(Since we don't plan to add patterns for these methods we should use the method name for the definitions)

We will rename songName -> song in a separate PR.

@matthewmayer What do you think?

@ST-DDT ST-DDT removed the s: needs decision Needs team/maintainer decision label Apr 11, 2024
@matthewmayer
Copy link
Contributor

Sure. Shorter is better like city instead of cityName

@ST-DDT
Copy link
Member

ST-DDT commented Apr 12, 2024

@jeremyhofer Could you please apply the requested changes and fix the merge conflicts?

src/modules/music/index.ts Outdated Show resolved Hide resolved
src/locales/en/music/album_name.ts Outdated Show resolved Hide resolved
src/definitions/music.ts Outdated Show resolved Hide resolved
src/modules/music/index.ts Outdated Show resolved Hide resolved
src/modules/music/index.ts Outdated Show resolved Hide resolved
@xDivisionByZerox xDivisionByZerox dismissed stale reviews from Shinigami92 and themself via 5e2cee0 April 26, 2024 23:47
ST-DDT
ST-DDT previously approved these changes Apr 27, 2024
@ST-DDT ST-DDT requested review from Shinigami92, xDivisionByZerox and a team April 27, 2024 07:43
Shinigami92
Shinigami92 previously approved these changes Apr 27, 2024
@Shinigami92 Shinigami92 changed the title feat(music): add albumName and artist methods feat(music): add album and artist methods Apr 27, 2024
@ST-DDT ST-DDT requested review from matthewmayer and removed request for matthewmayer April 27, 2024 22:32
@xDivisionByZerox xDivisionByZerox dismissed stale reviews from Shinigami92, ST-DDT, and themself via a5e9958 April 29, 2024 08:41
@ST-DDT ST-DDT requested review from Shinigami92, xDivisionByZerox and a team April 29, 2024 09:05
@xDivisionByZerox xDivisionByZerox merged commit f682750 into faker-js:next Apr 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature m: music Something is referring to the music module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants