4 Commits

Author SHA1 Message Date
Hayden
9e6ae2e514
chore: remove black (#3437) 2024-04-11 20:36:55 -05:00
Hayden
b54cdf6425
fix: sync locales in user registration validation (#3278)
* Add ability to inject into Python files

* Update outdated references to gen_global_components.py

* Add code gen for registration locale validation

* sort validators

* update for pydantic 2

* run generator again

---------

Co-authored-by: Gasper Gril <gasper@gril.si>
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
2024-03-10 09:58:52 -08:00
Michael Genson
7602c67449
fix: More Backup Restore Fixes (#2859)
* refactor normalized search migration to use dummy default

* changed group slug migration to use raw SQL

* updated comment

* added tests with anonymized backups (currently failing)

* typo

* fixed LDAP enum in test data

* fix for adding label settings across groups

* add migration data fixes

* fix shopping list label settings test

* re-run db init instead of just running alembic migration, to include fixes

* intentionally broke SQLAlchemy GUID handling

* safely convert between GUID types in different databases

* restore original test data after testing backup restores

* added missing group name update to migration
2024-01-03 04:19:04 +00:00
Hayden
9ecef4c25f
chore: file generation cleanup (#1736)
This PR does too many things :( 

1. Major refactoring of the dev/scripts and dev/code-generation folders. 

Primarily this was removing duplicate code and cleaning up some poorly written code snippets as well as making them more idempotent so then can be re-run over and over again but still maintain the same results. This is working on my machine, but I've been having problems in CI and comparing diffs so running generators in CI will have to wait. 

2. Re-Implement using the generated api routes for testing

This was a _huge_ refactor that touched damn near every test file but now we have auto-generated typed routes with inline hints and it's used for nearly every test excluding a few that use classes for better parameterization. This should greatly reduce errors when writing new tests. 

3. Minor Perf improvements for the All Recipes endpoint

  A. Removed redundant loops
  B. Uses orjson to do the encoding directly and returns a byte response instead of relying on the default 
       jsonable_encoder.

4. Fix some TS type errors that cropped up for seemingly no reason half way through the PR.

See this issue https://github.com/phillipdupuis/pydantic-to-typescript/issues/28

Basically, the generated TS type is not-correct since Pydantic will automatically fill in null fields. The resulting TS type is generated with a ? to indicate it can be null even though we _know_ that i can't be.
2022-10-18 14:49:41 -08:00