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

Bo 1575 : Add hook triggered when there is a change in packages #62

Merged
merged 4 commits into from Aug 11, 2017

Conversation

remiriv
Copy link
Contributor

@remiriv remiriv commented Aug 9, 2017

image

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 98.758% when pulling b8273c5 on BO-1575 into f4bc5dd on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 98.762% when pulling 81022f2 on BO-1575 into b5f3c28 on master.

@@ -3,53 +3,56 @@ const Validator = require('../../utils/Validator');
const ObjectReader = require('../../utils/ObjectReader');

function getHookType(program) {
if (program.web) {
if (program.hookType === 'web') {
Copy link
Member

Choose a reason for hiding this comment

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

extract logic and remove if/elseif

return 'bigquery';
}
}

function getEventType(program) {
if (program.ping) {
if (program.event === 'ping') {
Copy link
Member

Choose a reason for hiding this comment

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

extract logic and remove if/elseif

!program.web && program.googleAnalytics && !program.bigquery && program.gaTrackingId && program.gaTrackingId !== true ||
!program.web && !program.googleAnalytics && program.bigquery && program.googleClientSecret && Validator.fileExists(program.googleClientSecret));

var handlers = {
Copy link
Member

Choose a reason for hiding this comment

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

const, and extract it to be global and private

bigQuery: (program) => program.googleClientSecret && program.googleClientSecret !== true && Validator.fileExists(program.googleClientSecret)
}

return (['web', 'googleAnalytics', 'bigQuery'].indexOf(program.hookType) > -1) && handlers[program.hookType](program)
Copy link
Member

Choose a reason for hiding this comment

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

use handlers to do the validation instead of an hardcoded array

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 98.749% when pulling 93bb91c on BO-1575 into b5f3c28 on master.

@weber-gregoire weber-gregoire merged commit 8a964de into master Aug 11, 2017
@weber-gregoire weber-gregoire deleted the BO-1575 branch August 11, 2017 20:55
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

3 participants