Fix 132 tags not found#136
Conversation
getLastTags should use pagination when the tag option were set to 2 tags and these tags weren not found yet
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
===========================================
- Coverage 85.75% 38.69% -47.06%
===========================================
Files 7 7
Lines 316 323 +7
===========================================
- Hits 271 125 -146
- Misses 45 198 +153
Continue to review full report at Codecov.
|
|
@alexcanessa I don't understand why the codevcov tests are failing, do you have any clue? |
|
@wellDan28 I'm trying to understand. |
alexcanessa
left a comment
There was a problem hiding this comment.
@wellDan28 don't worry for the codecov, it's going to automatically get fixed when master runs.
lib/src/Gren.js
Outdated
| _validateRequiredTagsExists(tags, requireTags) { | ||
| if (requireTags.indexOf('all') >= 0 || !(requireTags instanceof Array)) return; | ||
|
|
||
| const tagsNames = tags.map(x => x.tag.name); |
There was a problem hiding this comment.
Please use explicit parameters name (i.e. tagData instead of x)
lib/src/Gren.js
Outdated
| if (missingTags.length > 0) { | ||
| const notFoundMessage = (missingTags.length === 1) ? 'tag is' : 'tags are'; | ||
| throw chalk.red(`\nThe following ${notFoundMessage} not found in the repository: ${missingTags}. ` + | ||
| 'please provider tags that are exists in the repository'); |
There was a problem hiding this comment.
Why not everything in the template literal?
There was a problem hiding this comment.
I'm sorry, I don't understand, could you please explain what you mean?
lib/src/Gren.js
Outdated
| if (missingTags.length > 0) { | ||
| const notFoundMessage = (missingTags.length === 1) ? 'tag is' : 'tags are'; | ||
| throw chalk.red(`\nThe following ${notFoundMessage} not found in the repository: ${missingTags}. ` + | ||
| 'please provider tags that are exists in the repository'); |
There was a problem hiding this comment.
Please change so that:
please provider tags that are exists in the repositoryplease provide existing tags.
alexcanessa
left a comment
There was a problem hiding this comment.
@wellDan28 last feedback, promise 👍
lib/src/Gren.js
Outdated
|
|
||
| const missingTags = requireTags.filter(requireTag => tagsNames.indexOf(requireTag) < 0); | ||
| if (missingTags.length > 0) { | ||
| const notFoundMessage = (missingTags.length === 1) ? 'tag is' : 'tags are'; |
There was a problem hiding this comment.
to notFoundMessageinflection as it makes more sense 👍
lib/src/Gren.js
Outdated
| * Check that the require tags are exists in tags | ||
| * | ||
| * @param {Array} tags | ||
| * @param {any} requireTags |
There was a problem hiding this comment.
You can expect requireTags to be Array because this.options.tags it's always an Array
github-release-notes/lib/src/_utils.js
Lines 123 to 149 in 3e6b2e4
Also, replace the @return with @throws as the function is only returning undefined
| if (missingTags.length > 0) { | ||
| const notFoundMessage = (missingTags.length === 1) ? 'tag is' : 'tags are'; | ||
| throw chalk.red(`\nThe following ${notFoundMessage} not found in the repository: ${missingTags}. ` + | ||
| 'please provide existing tags.'); |
There was a problem hiding this comment.
Why not one template literal?
|
@all-contributors please add @wellDan28 for bug |
|
I've put up a pull request to add @wellDan28! 🎉 |
|
@all-contributors please add @wellDan28 for code |
|
I've put up a pull request to add @wellDan28! 🎉 |
Close #132
The resolution contains two parts: