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

Change input validation settings on WINS form to prevent invalid URL entries #4595

Closed
12 of 13 tasks
Tracked by #4671
roslynwythe opened this issue May 3, 2023 · 13 comments
Closed
12 of 13 tasks
Tracked by #4671
Assignees
Labels
Complexity: Medium P-Feature: Wins Page https://www.hackforla.org/wins/ ready for dev lead Issues that tech leads or merge team members need to follow up on role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Milestone

Comments

@roslynwythe
Copy link
Member

roslynwythe commented May 3, 2023

Prerequisite

  1. Be a member of Hack for LA. (There are no fees to join.) If you have not joined yet, please follow the steps on our Getting Started page.
  2. Before you claim or start working on an issue, please make sure you have read our How to Contribute to Hack for LA Guide.

Overview

As developers we need to update input validation settings on the LinkedIn URL and GitHub URL fields of the "Share your WINS" form, so that invalid URLs are not accepted.

Action Items

  • On your personal or your development Google Drive, create a new test Google Form with two questions: GitHub URL and LinkedIn URL. In the Response settings of the Form, link to a new spreadsheet for storing responses.
  • For both the LinkedIn and GitHub URL fields, open the question settings, click the arrow next to Text, and select Regular Expression. Provide a case-insensitive Regular Expression for matching each specific expected URL.
    • For both URLs, the protocol portion of the URL should match http://, https://, or it could be blank.
    • For the GitHub URL, the remainder of the URL should start with www.github.com/ or github.com/
    • For the LinkedIn URL, the remainder of the URL should start with www.linkedIn.com/in/ or linkedIn.com/in/
    • Both URLs should end with the profile descriptor, optionally followed by /
  • Test by submitting the form with various inputs. Verify that only the URL patterns described above can be submitted and that the responses in the test Sheet are correct.
  • Configure draft error messages to guide users who have entered invalid responses
    • Get sign off from product on the error messages.
  • Demonstrate the regular expressions for dev lead.

Merge Team/Dev Leads

  • Before closing this issue,
    • Update the production Google Form with the regular expressions and error messages for the GitHub and LinkedIn URLs.
    • Test form validation with various inputs. Submit a test form, then verify the submitted data for the Github and Linked URLS in the response Sheet matches the current formats. Find the automatically generated GitHub issue with title "Review Needed - New Wins Form Submission", add the "Ignore:Test" label, make a comment and close as Not Planned.

Resources/Instructions

@roslynwythe roslynwythe added role: back end/devOps Tasks for back-end developers Complexity: Medium P-Feature: Wins Page https://www.hackforla.org/wins/ size: 1pt Can be done in 4-6 hours Draft Issue is still in the process of being created labels May 3, 2023
@roslynwythe

This comment was marked as resolved.

@roslynwythe roslynwythe added ready for dev lead Issues that tech leads or merge team members need to follow up on and removed Draft Issue is still in the process of being created labels May 3, 2023
@JessicaLucindaCheng

This comment was marked as resolved.

@ExperimentsInHonesty ExperimentsInHonesty added this to the 05. Know HFLA milestone May 7, 2023
@ExperimentsInHonesty

This comment was marked as resolved.

@roslynwythe

This comment was marked as resolved.

@roslynwythe roslynwythe added ready for product and removed ready for dev lead Issues that tech leads or merge team members need to follow up on labels May 12, 2023
@ExperimentsInHonesty

This comment was marked as resolved.

@ExperimentsInHonesty

This comment was marked as resolved.

@roslynwythe

This comment was marked as resolved.

@roslynwythe roslynwythe added Ready for Prioritization and removed ready for dev lead Issues that tech leads or merge team members need to follow up on labels Sep 10, 2023
@brianf4 brianf4 self-assigned this Sep 26, 2023
@github-actions
Copy link

Hi @brianf4, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@brianf4
Copy link
Member

brianf4 commented Sep 26, 2023

Availability: Sunday - Friday 10 am - 8 pm
ETA: Friday - EOD

@brianf4
Copy link
Member

brianf4 commented Oct 3, 2023

Here is the Google Form with the input validation settings: https://forms.gle/vvcsr9ijgYBBFAsQ7

As well as the Google Sheet for the responses that went through/allowed: https://docs.google.com/spreadsheets/d/1eMUxEMOC-Py0twk-CkEPNDQLoiqgLzpOU42f3LETL9Q/edit?usp=sharing

Regex expression for both input:

  • ^([Hh][Tt][Tt][Pp][Ss]?://)?([Ww][Ww][Ww].)?[Gg][Ii][Tt][Hh][Uu][Bb].[Cc][Oo][Mm]/[A-Za-z0-9-]+/?$
  • ^([Hh][Tt][Tt][Pp][Ss]?://)?([Ww][Ww][Ww].)?[Ll][Ii][Nn][Kk][Ee][Dd][Ii][Nn].[Cc][Oo][Mm]/[Ii][Nn]/[A-Za-z0-9-]+/?$

Valid GitHub URL examples:

Valid LinkedIn URL examples:

Invalid GitHub URL examples:

Invalid LinkedIn URL examples:

Error Message: "Invalid GitHub/LinkedIn URL"

Screenshot 2023-10-03 at 12 19 28 PM

@brianf4 brianf4 added the ready for dev lead Issues that tech leads or merge team members need to follow up on label Oct 3, 2023
@roslynwythe
Copy link
Member Author

Thanks @brianf4 - This looks good to me but I'd like to give the merge team a few days to test the form as well.

@t-will-gillis
Copy link
Member

@brianf4 @roslynwythe I tried different variations and tried to think of an exception to trip up the regex. So far everything looks good to me.

@roslynwythe
Copy link
Member Author

Thank you @brianf4 for great work on this issue. The regular expressions you created will help to ensure that our Wins form recieves valid URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium P-Feature: Wins Page https://www.hackforla.org/wins/ ready for dev lead Issues that tech leads or merge team members need to follow up on role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Development

No branches or pull requests

5 participants