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

Added validation errors #2639

Merged
merged 2 commits into from
Apr 26, 2018
Merged

Added validation errors #2639

merged 2 commits into from
Apr 26, 2018

Conversation

SidharthBansal
Copy link
Member

As asked in #2556 by @jywarren
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.

Thanks!

@PublicLabBot
Copy link

PublicLabBot commented Apr 19, 2018

1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
2 Messages
📖 @SidharthBansal Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

elsif tagname.split(':')[0] == 'google'
errors ? "Only Oauth can create such tags" : false
elsif tagname.split(':')[0] == 'github'
errors ? "Only Oauth can create such tags" : false
Copy link
Member

Choose a reason for hiding this comment

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

By using ["facebook", ...].include? tagname.split(':')[0] instead we can squeeze 8 lines into just 2 and avoid much repetition. What do you think?

Copy link
Member Author

@SidharthBansal SidharthBansal Apr 19, 2018

Choose a reason for hiding this comment

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

@seafr I want to know whether we want the same error message for all 4 cases or different for these. I will do the required patch accordingly.
Thanks

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I see your point. I thought this was the final version as the in progress label was removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jywarren what do you suggest?

Copy link
Member

Choose a reason for hiding this comment

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

Hm, i like @seafr's suggestion! Let's do it!

Copy link
Member

Choose a reason for hiding this comment

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

@SidharthBansal I suggest moving all 4 options into 1 elseif as I said above. You can also customise the error message to something like:
"... create the #{tagname...[0]} tag"
if you want to make it different for each case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, updating in a minute. Thanks both of you

@jywarren
Copy link
Member

This looks good! Is it ready for merging? 👍 😄

@SidharthBansal
Copy link
Member Author

Yeah

@SidharthBansal
Copy link
Member Author

SidharthBansal commented Apr 23, 2018

Thanks all mentors for selecting me in Gsoc 2018

@jywarren
Copy link
Member

I'm going to test CodeClimate integration by closing and reopening... let's see!

@jywarren jywarren closed this Apr 23, 2018
@jywarren jywarren reopened this Apr 23, 2018
@jywarren
Copy link
Member

@publiclab/reviewers - I tried enabling CodeClimate -- it's configured in .codeclimate.yml in the root directory. It's a little strict... what do folks think about having it on? I can turn it off if it seems too unfriendly.

@jywarren
Copy link
Member

Maybe we should turn off some of the checks -- that way we can "ease in" more gradually. As files get cleaner, we can turn on more checks? https://github.com/publiclab/plots2/blob/master/.codeclimate.yml

@jywarren
Copy link
Member

Also notice I was able to log into CodeClimate by clicking "Details" and then approve it there despite the issues it complained about. So we can work around this... my main concern is that it looks too intimidating to newcomers -- and I wish it offered more advice to people on how to improve their code, rather than just complaining about it!

@jywarren
Copy link
Member

So now that I've approved it, to see the original error it complained about, click Show all checks and click on Details for CodeClimate.

@jywarren
Copy link
Member

I believe all reviewers ought to be able to "approve" via CodeClimate.

@SidharthBansal
Copy link
Member Author

Yeah I am able to see that you have approved it and the errors are on its respective page. Can anyone from @publiclab/reviewers approve this too?? I will not be able to do in my own pr.
I think we should first try CodeClimate this summer, if we all get comfortable with handling CodeClimate with the newcomers and ongoing summer PL projects then we will continue with it else you can turn it off.

@jywarren jywarren merged commit 234208d into master Apr 26, 2018
@jywarren
Copy link
Member

OK, merging!! 😀

@SidharthBansal SidharthBansal added this to the OAUTH LOGIN milestone Jun 20, 2018
SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
@emilyashley emilyashley deleted the user_tag_errors branch January 15, 2020 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants