-
-
Couldn't load subscription status.
- Fork 206
refactor(frontend): generate API react-query helpers with Orval DEV-893 #6083
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
Conversation
4a6835d to
4807342
Compare
|
root cause for CI fail is addressed at #6084, let's merge that into |
ac0ff84 to
fb91f82
Compare
708a733 to
563a626
Compare
006359a to
3a900e6
Compare
### 💭 Notes For development purposes let's commit the generated schema, so that we can build on top of that frontend typed API helpers, see #6083. To ensure that the committed schema is always up-to-date, let's add to CI a job that checks if it's generated. P.S. along the way simplified the script with a helper for gosu. ### 👀 Preview steps 1. see the new "openapi" job 2. 🟢 [on PR showcase commit [f4d9501](f4d9501) before updating schema] notice that CI fails 3. 🟢 [on PR latest commit [936c461](936c461) after updating schema] notice that CI succeeds 4. 🟢 run locally `./run.py -cf run --rm kpi ./scripts/generate_openapi_schemas.sh` from `kobo-install` and it succeeds to regenerate schema
3a900e6 to
847c7b4
Compare
60b1e32 to
e6aee5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 💯
Tested, generated and checked code.
Nothing breaks!
Nice job!
e6aee5a to
1461192
Compare
…93 (#6083) ### 💭 Notes Generate react-query helpers from API with Orval. By it's own does nothing. See these few refactors, the rest is for now unused generated files: - `jsapp/js/api.ts` - `package.json` - `package-lock.json` Configuration is split across these files: - `orval.config.js` - `jsapp/js/api/orval.mutator.ts` - `jsapp/js/api/orval.operationName.ts` - `scripts/generate_api.sh` - `.github/workflows/openapi.yml` See other refactor PRs that use these helpers to call API: - #6090 ### 👀 Preview steps 1. run kobo-install locally 2. `./run.py -cf run --rm kpi ./scripts/generate_api.sh` to re-generate helpers 3. notice that helpers are regenerated 4. click around so that some APIs are called the old way 5. notice that it still works and the refactors didn't break anything
…93 (#6083) ### 💭 Notes Generate react-query helpers from API with Orval. By it's own does nothing. See these few refactors, the rest is for now unused generated files: - `jsapp/js/api.ts` - `package.json` - `package-lock.json` Configuration is split across these files: - `orval.config.js` - `jsapp/js/api/orval.mutator.ts` - `jsapp/js/api/orval.operationName.ts` - `scripts/generate_api.sh` - `.github/workflows/openapi.yml` See other refactor PRs that use these helpers to call API: - #6090 ### 👀 Preview steps 1. run kobo-install locally 2. `./run.py -cf run --rm kpi ./scripts/generate_api.sh` to re-generate helpers 3. notice that helpers are regenerated 4. click around so that some APIs are called the old way 5. notice that it still works and the refactors didn't break anything
💭 Notes
Generate react-query helpers from API with Orval. By it's own does nothing. See these few refactors, the rest is for now unused generated files:
jsapp/js/api.tspackage.jsonpackage-lock.jsonConfiguration is split across these files:
orval.config.jsjsapp/js/api/orval.mutator.tsjsapp/js/api/orval.operationName.tsscripts/generate_api.sh.github/workflows/openapi.ymlSee other refactor PRs that use these helpers to call API:
👀 Preview steps
./run.py -cf run --rm kpi ./scripts/generate_api.shto re-generate helpers