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

[WIP] experiment(data-quality): Disallow emails in product fields #6655

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yuktea
Copy link
Contributor

@yuktea yuktea commented Apr 20, 2022

Closes #6539

Information

This PR aims to disallow email addressed fields belonging to products new or existing. I've made an effort in accommodating the logic into, what I think is our existing validation layer. However I'm yet to figure out where we're setting up the other validation rules (if there are any others yet). for this I'm attempting to set up a remote debugger which would let me introspect and figure it out better. Apart from that, some problems I could identify with this approach:

  • No client-side validation and indication.
  • The form is not preserved on submission of invalid information, and there's no information on why the form failed.

I'd like reviewers to give feedback on the approach any insights into how we validate data and validation taken care of by Product::process_product_edit_rules.

@sonarcloud
Copy link

sonarcloud bot commented Apr 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@stephanegigandet
Copy link
Contributor

This would work, but as you suggest, we probably should think more about this, to decide what would be the right behaviour:

  1. reject the changes completely if there is an error in one of the fields
  2. ignore the fields that have errors

And how to convey this information to users so that they can correct the fields.

It's also complexified a bit by the fact that those changes can be made through the OFF website (and app), but also through third parties that use our API to add / edit products. It's relatively easy for us to introduce new behaviours on the website (such as redisplaying the form with messages about errors), but for the API, we need to find a solution that does not break existing applications that use the API.

@yuktea
Copy link
Contributor Author

yuktea commented May 7, 2022

Hi folks! I'm so sorry I've not been able to make progress on this PR yet. I've been occupied with work commitments and University since my academic session is ending next week (which means I'll be taking my final exams this week), but I expect to continue work on this by next week. Thanks for the support and patience!

cc: @stephanegigandet

@stephanegigandet
Copy link
Contributor

Hi @yuktea ,thank you and good luck with your exams!

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Aug 8, 2022
@yuktea yuktea removed ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. labels Jan 25, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jan 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@teolemon teolemon added the 🧽 Data quality https://wiki.openfoodfacts.org/Quality label Apr 1, 2024
Copy link

sonarcloud bot commented Apr 1, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality Privacy Products
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Prevent people from entering email addresses as values
3 participants