Skip to content

Commit

Permalink
all orval things
Browse files Browse the repository at this point in the history
  • Loading branch information
JComins000 committed Nov 1, 2024
1 parent 4769801 commit 48aa0bb
Show file tree
Hide file tree
Showing 5 changed files with 13,050 additions and 4 deletions.
19 changes: 15 additions & 4 deletions bindings/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SWAGGER_SPEC := ../proto/build/swagger/determined/api/v1/api.swagger.json
py_bindings_dest := ../harness/determined/common/api/bindings.py
ts_bindings_dest := ../webui/react/src/services/api-ts-sdk
e2e_bindings_dest := ../webui/react/src/generated/orval/e2e-client.ts
py_generator := generate_bindings_py.py
ts_generator := generate_bindings_ts.py

Expand All @@ -17,30 +18,40 @@ $(py_bindings_dest): $(SWAGGER_SPEC) swagger_parser.py $(py_generator)
$(ts_bindings_dest): $(SWAGGER_SPEC) swagger_parser.py $(ts_generator) $(wildcard static_ts_files/*)
python $(ts_generator) --output $@

$(e2e_bindings_dest): $(SWAGGER_SPEC)
cd ../webui/react && npm run bindings

.PHONY: build/python
build/python: $(py_bindings_dest)

.PHONY: build/typescript
build/typescript: $(ts_bindings_dest)

.PHONY: build/e2e
build/e2e: $(ts_bindings_dest)

.PHONY: build
build: $(ts_bindings_dest) $(py_bindings_dest)
build: $(ts_bindings_dest) $(py_bindings_dest) $(e2e_bindings_dest)

.PHONY: check
check: force-gen check/python check/typescript
check: force-gen check/python check/typescript check/e2e
# Checking that the (committed) generated code is up-to-date by ensuring that
# git reports the files as unchanged after forcibly regenerating them.
# WARNING this has a dependency on proto module being built recently
# which isn't linked here.

.PHONY: check-python
.PHONY: check/python
check/python: build/python
test -z "$(shell git status --porcelain $(py_bindings_dest))" || (git diff; false)

.PHONY: check-typescript
.PHONY: check/typescript
check/typescript: build/typescript
test -z "$(shell git status --porcelain $(ts_bindings_dest)/*)" || (git diff; false)

.PHONY: check/e2e
check/e2e: build/e2e
test -z "$(shell git status --porcelain $(e2e_bindings_dest)/*)" || (git diff; false)

.PHONY: clean
clean:
rm -rf build/ $(py_bindings_dest) $(ts_bindings_dest)
Expand Down
1 change: 1 addition & 0 deletions webui/react/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ src/vendor/notebook/notebook.js
!.eslintrc.js
!.stylelintrc.js
node_modules
generated
1 change: 1 addition & 0 deletions webui/react/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ src/vendor/*
!.eslintrc.js
!.stylelintrc.js
node_modules
generated
Loading

0 comments on commit 48aa0bb

Please sign in to comment.