Skip to content

Fix 132 tags not found #136

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

Merged
merged 9 commits into from
Feb 21, 2018

Conversation

wellDan28
Copy link
Contributor

Close #132

The resolution contains two parts:

  1. Enable pagination when two tags were provided in the tags option
  2. Validate that the two tags were found (if they were provided)

getLastTags should use pagination when the tag option were
set to 2 tags and these tags weren not found yet
@codecov-io
Copy link

codecov-io commented Feb 19, 2018

Codecov Report

Merging #136 into master will decrease coverage by 47.05%.
The diff coverage is 0%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
lib/src/Gren.js 5.69% <0%> (-78.18%) ⬇️
lib/src/GitHubInfo.js 80.95% <0%> (-4.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e6b2e4...78762a5. Read the comment docs.

@wellDan28 wellDan28 mentioned this pull request Feb 19, 2018
ignoreTagsWith should work only when tags=all
@wellDan28
Copy link
Contributor Author

@alexcanessa I don't understand why the codevcov tests are failing, do you have any clue?

@alexcanessa
Copy link
Member

@wellDan28 I'm trying to understand.

Copy link
Member

@alexcanessa alexcanessa left a comment

Choose a reason for hiding this comment

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

@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);
Copy link
Member

Choose a reason for hiding this comment

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

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');
Copy link
Member

Choose a reason for hiding this comment

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

Why not everything in the template literal?

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'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');
Copy link
Member

Choose a reason for hiding this comment

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

Please change so that:

please provider tags that are exists in the repository please provide existing tags.

Copy link
Member

@alexcanessa alexcanessa left a comment

Choose a reason for hiding this comment

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

@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';
Copy link
Member

Choose a reason for hiding this comment

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

notFoundMessage to inflection 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
Copy link
Member

Choose a reason for hiding this comment

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

You can expect requireTags to be Array because this.options.tags it's always an Array

/**
* Converts an array like string to an actual Array,
* converting also underscores to spaces
*
* @since 0.6.0
* @public
*
* @param {string} arrayLike The string of items
* e.g.
* "wont_fix, duplicate, bug"
*
* @return {Array} The items with spaces instead of underscores.
*/
function convertStringToArray(arrayLike) {
if (!arrayLike) {
return [];
}
if (typeof arrayLike === 'object') {
return Object.keys(arrayLike).map((itemKey) => arrayLike[itemKey]);
}
return arrayLike
.replace(/\s/g, '')
.split(',')
.map((itemName) => itemName.replace(/_/g, ' ', itemName));
}

Also, replace the @return with @throws as the function is only returning undefined

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 provide existing tags.');
Copy link
Member

Choose a reason for hiding this comment

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

Why not one template literal?

@alexcanessa alexcanessa merged commit adfc5e5 into github-tools:master Feb 21, 2018
@wellDan28 wellDan28 mentioned this pull request Apr 3, 2018
@alexcanessa
Copy link
Member

@all-contributors please add @wellDan28 for bug

@allcontributors
Copy link
Contributor

@alexcanessa

I've put up a pull request to add @wellDan28! 🎉

@alexcanessa
Copy link
Member

@all-contributors please add @wellDan28 for code

@allcontributors
Copy link
Contributor

@alexcanessa

I've put up a pull request to add @wellDan28! 🎉

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.

Tags not found
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy