git.iko.soy/typeable/mock-server-client
on master help sign in
fix manual
e5e9907Aleksey Uymanov
README.md+17−15
@@ -3,7 +3,7 @@
3The package is the client library for the [mock server](https://www.mock-server.com/). The source code is
3The package is the client library for the [mock server](https://www.mock-server.com/). The source code is
4generated by the [openapi3-code-generator](https://hackage.haskell.org/package/openapi3-code-generator), specifically its patched version.
4generated by the [openapi3-code-generator](https://hackage.haskell.org/package/openapi3-code-generator), specifically its patched version.
5
5
6−## How to regenerate
6+## How to regenerate code from the spec
7
7
8```
8```
9cd codegen && ./regen.sh
9cd codegen && ./regen.sh
@@ -36,17 +36,19 @@ mentioned earlier the original code was slightly modified, so watch your commits
36
36
37## How the to update the package to the new version of the `mock-server`?
37## How the to update the package to the new version of the `mock-server`?
38
38
39−* Commit all changes in git
39+* Commit all changes
40−* Run the `regen.sh` and regenerate the whole package
40+* `git checkout update-openapi-spec`
41−* Run `git diff -p > src.patch` and save the manual changes made to the source code
42−* Download the [original spec](https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/5.13.x) in place of our patched spec file
43−* Run the `git diff -- codegen/mock-server-openapi-5.13.x-swagger.yaml -p > spec.patch`
44−* Download the [new spec](https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi) and put it in place of the old one
45−* Try to `git apply spec.patch` to the newer version of the spec to apply manual
46− changes to the new spec. If somethig goes wrong use AI to fix it for you, heh.
47−* Fix the `regen.sh` and rename the `mock-server-openapi-5.13.x-swagger.yaml` to
41+* Replace the `codegen/mock-server-openapi.yaml` with a newer version
48− the newer version.
42+* `git commit -m "updated mock-server-openapi.yaml to version $NEWVERSION"`
49−* `git commit -m 'dangerous action'`
43+* `git checkout -b "update-$NEWVERSION" master`
50−* Run the `regen.sh` so you will hopefuly have a new version of the client code
44+* `git merge update-openapi-spec`
51− generated.
45+* Resolve conflicts if any
52−* `git apply src.patch` to apply manual patches to the new version.
46+* `./codegen/regen.sh`
47+* `git symbolic-ref HEAD refs/heads/update-generated-code && git reset`
48+ switching to the branch `update-generated-code` without checking out the working-tree
49+* `git commit -m "update the generted code for version $NEWVERSION"`
50+* `git checkout "update-$NEWVERSION"`
51+* `git merge update-generated-code`
52+* Resolve conflicts if any
53+* `git push origin "update-$NEWVERSION"`
54+* Create PR, wait for CI, review, merge into the master