Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.45

* **Add `/check` as the plugin connection-check route**: generated plugin apps now expose `/check` alongside `/precheck` for the v3 plugin contract.

## 0.0.44

* **Ignore SIGTERM in plugin uvicorn Servers**: plugin webservers now keep
Expand Down
9 changes: 9 additions & 0 deletions test/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ def generic_validation(self):
]


def test_check_alias_matches_precheck_noop_response():
from test.assets.empty_input_and_response import SampleClass as TestClass

test_class = TestClass()
client = TestClient(wrap_in_fastapi(func=test_class.do_nothing, plugin_id="mock_plugin"))

assert client.get("/check").json() == client.get("/precheck").json()


@pytest.mark.parametrize(
"file_data", mock_file_data, ids=[type(fd).__name__ for fd in mock_file_data]
)
Expand Down
2 changes: 1 addition & 1 deletion unstructured_platform_plugins/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.44" # pragma: no cover
__version__ = "0.0.45" # pragma: no cover
4 changes: 3 additions & 1 deletion unstructured_platform_plugins/etl_uvicorn/api_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ async def get_schema() -> SchemaOutputResponse:
resp = SchemaOutputResponse(inputs=schema["inputs"], outputs=schema["outputs"])
return resp

@fastapi_app.get("/precheck")
async def run_precheck() -> InvokePrecheckResponse:
if precheck_func:
fn_response = await wrap_fn(func=precheck_func)
Expand All @@ -311,6 +310,9 @@ async def run_precheck() -> InvokePrecheckResponse:
else:
return InvokePrecheckResponse(status_code=status.HTTP_200_OK, usage=[])

fastapi_app.get("/check")(run_precheck)
fastapi_app.get("/precheck")(run_precheck)

@fastapi_app.get("/id")
async def get_id() -> str:
return plugin_id
Expand Down
Loading