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

Fix: Don't require the JSON user arguments field, interpret empty string as null #5320

Merged
merged 3 commits into from Jan 8, 2024

Conversation

stumpylog
Copy link
Member

Proposed change

Closes #5313

Type of change

  • Bug fix: non-breaking change which fixes an issue.
  • New feature: non-breaking change which adds functionality. Please read the important note above.
  • Breaking change: fix or feature that would cause existing functionality to not work as expected.
  • Documentation only.
  • Other. Please explain:

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have included testing coverage for new code in this PR, for backend and / or front-end changes.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@stumpylog stumpylog requested a review from a team as a code owner January 8, 2024 15:47
@github-actions github-actions bot added the bug Bug report or a Bug-fix label Jan 8, 2024
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f525ac0) 96.40% compared to head (65fef9a) 96.41%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #5320   +/-   ##
=======================================
  Coverage   96.40%   96.41%           
=======================================
  Files         394      394           
  Lines       15424    15428    +4     
  Branches     1179     1179           
=======================================
+ Hits        14870    14875    +5     
+ Misses        550      549    -1     
  Partials        4        4           
Flag Coverage Δ
backend 95.15% <100.00%> (+0.01%) ⬆️
frontend 97.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shamoon
Copy link
Member

shamoon commented Jan 8, 2024

My pytest is still borked but I can at least run the backend again 😅

I still get {"user_args":["Value must be valid JSON."]} with this?

@stumpylog
Copy link
Member Author

I can't reproduce that from the image. The standard {"invalidate_digital_signatures": true} in the field works, and an empty field works now as well.

@shamoon
Copy link
Member

shamoon commented Jan 8, 2024

Ah, I think if you set it, then delete the contents of the field the frontend will pass "" which is what fails. I suppose we can handle it in either place, I think this came up with #4762 where we handled it in the backend

@stumpylog
Copy link
Member Author

Ah, the change without saving thing. I can add that fix in a bit

@shamoon shamoon added this to the Next Release milestone Jan 8, 2024
@stumpylog
Copy link
Member Author

Really hating DRF here. It's not calling validate or update reliably for me when changing settings. Any idea what the heck it's doing?

@shamoon
Copy link
Member

shamoon commented Jan 8, 2024

Sometimes it's so weird. I can look a bit later, alternatively would it be easier to make the frontend pass null for this field? It might be a bit of a pain but vs. fighting with DRF =)

Maybe I'll have some beginners luck

@shamoon
Copy link
Member

shamoon commented Jan 8, 2024

Dont ask me why, but run_validation seems to do it, lmk if you notice any issues with it:

Screenshot 2024-01-08 at 10 20 45 AM

@stumpylog
Copy link
Member Author

That seems fine to me. I'm going to ignore the coverage, it's an odd ball case to me.

@shamoon
Copy link
Member

shamoon commented Jan 8, 2024

Dont mean to overstep but I took the liberty of adding a little coverage, happy to revert it if you dont want it

@stumpylog stumpylog merged commit a12e1fa into dev Jan 8, 2024
30 checks passed
@stumpylog stumpylog deleted the fix/5313 branch January 8, 2024 21:14
@shamoon shamoon changed the title Fix: Don't require the JSON user arguments field Fix: Don't require the JSON user arguments field, interpret empty string as null Jan 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend bug Bug report or a Bug-fix small-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration: User-Arguments are mandatory
2 participants