opensafely-core / opensafely-core/opencodelists

Make behaviour less surprising for CSVs that fail to upload via "Create a codelist" form

Open
#2,801 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

csv
Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

Why are we doing this?

From @rw251 in #2705, when a CSV fails to be processed:

the CSV file is no longer "uploaded". I therefore did this one time:

  • upload a csv with headers
  • don't click "Yes" to headers
  • click "Create"
  • return to create page with the "your csv is invalid" type message
  • click "Yes" to headers
  • click "Create"
  • end up at the builder page for an empty codelist because without a selected CSV it just creates an empty codelist
  • I was confused

How will we know when it's done?

When this behaviour is changed to be less surprising.

What are we doing?

If possible, one of the following might address this:

  • persisting the CSV on failed upload, so that the CSV isn't cleared
  • validating that a CSV is present when clicking "Yes" or "No" on the header option is selected, and then perhaps failing with something like "you made a CSV header choice, but didn't provide a CSV"

Or there may be some alternative approach that makes the behaviour more obvious to the user.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure flow in the Create a codelist form: upload a CSV, make an incorrect header choice, and submit. Trace how the form handles the failed upload and the later header choice; done means the CSV is retained or the user receives clear validation, and an empty codelist cannot be created unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.