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

Update app and issues workflow #4

Merged
merged 11 commits into from
Apr 15, 2020
Merged

Conversation

sowbiba
Copy link
Contributor

@sowbiba sowbiba commented Feb 19, 2020

No description provided.

@sowbiba sowbiba added the WIP label Feb 19, 2020
@sowbiba sowbiba self-assigned this Feb 19, 2020
index.js Outdated
},
milestones: {
next_patch_milestone: '1.7.4.3',
next_minor_milestone: '1.7.5.0',
next_minor_milestone: '1.7.5.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

These are very outdated but can be fixed later

@matks
Copy link
Contributor

matks commented Feb 20, 2020

@sowbiba Looks good to me. Let's see if @eternoendless has something to add, else it's OK

@PierreRambaud and @NeOMakinG can also help to review Javascript

index.js Outdated
if (rule != null) {
context.log.info('[Index] Received webhook matches rule ' + rule + ' requirements');
ruleApplier.applyRule(rule, context);
if (rules != null) {

Choose a reason for hiding this comment

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

Suggested change
if (rules != null) {
if (rules !== null) {

Choose a reason for hiding this comment

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

Also is if(rules) not enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the change in file 🤔

src/issue-data-provider.js Outdated Show resolved Hide resolved
})
}
}
}

Choose a reason for hiding this comment

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

This looks so duplicating, wdyt @PierreRambaud ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep 👍

Choose a reason for hiding this comment

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

Then would it be possible to try to do something to avoid duplicate code ? Sometimes it's too overkill but there it looks like not

index.js Outdated
context.log.info('[Index] Received webhook matches rule ' + rule + ' requirements');
ruleApplier.applyRule(rule, context);
if (rules != null) {
for (const rule of rules) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The for statement is also done in applyRules, is it needed to do both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


switch (rule) {
case Rule.A1:
this.applyRuleA1(context);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be better to find a way to remove this useless switch, otherwise in few weeks, we'll have a 500 lines only for the switch.

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 tried to do it better

@@ -0,0 +1,3 @@
/node_modules/
/tests/
!.eslintrc.js

Choose a reason for hiding this comment

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

Please configure your IDE so it auto-add new line at the end of files!

browser: true,
node: true,
es6: true,
jquery: true,

Choose a reason for hiding this comment

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

No need this on this project right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You right. It seems not needed. I will check what every parameter is for in env and globals

Copy link
Contributor

Choose a reason for hiding this comment

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

Env is for context, globals is for globals variables.

Comment on lines +12 to +15
google: true,
document: true,
navigator: false,
window: true,

Choose a reason for hiding this comment

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

No need too, it's node side, not client side right ?

Comment on lines +40 to +41
name: 'global',
message: 'Use window variable instead.',

Choose a reason for hiding this comment

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

It's node side, you'll never use window

src/pull-request-data-provider.js Show resolved Hide resolved
src/pull-request-data-provider.js Outdated Show resolved Hide resolved
src/rule-applier.js Outdated Show resolved Hide resolved
sowbiba and others added 3 commits February 27, 2020 18:46
@sowbiba sowbiba removed the WIP label Mar 25, 2020
@sowbiba sowbiba merged commit bc1fa00 into PrestaShop:master Apr 15, 2020
@sowbiba sowbiba deleted the add-missing-rules branch April 15, 2020 13:21
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.

5 participants