Code0x58 opened a new pull request #3642: URL: https://github.com/apache/incubator-heron/pull/3642
The main goal of these changes are to help make the tracker easier to understand and work on in the future. Documentation is automatically generated from the code (thanks to [FastAPI](https://fastapi.tiangolo.com/)) and served at `/` of running tracker instances. E.g. ```shell heron-tracker --port=8080 & sleep 5 open http://localhost:8080/ ``` Type annotations are included throughout. Adding `mypy` to the builds [[e.g.](https://github.com/thundergolfer/bazel-mypy-integration/)] would be good to take advantage of the typing, but it would take additional work due to the `pex_*` rules instead of regular `py_*` ones. A lot of things were touched, but I tried to leave things that looked suspicious but might be relied on as a feature, and didn't intentionally make changes to the interface aside from dropping the redirect at `/` and some methods returning objects with None values instead of undefined values (hopefully inconsequential - its managable in FastAPI/Pydantic that way). The tests now pass locally. The API feels a bit rough, for example returning objects with all None values rather than just a None, but I am not addressing things like that now as that would touch additional services. The commits will be squashed down on merge so I'll clean up the commit message then. ## Tracker changes * replace Tornado with FastAPI for self documentation of API * use async outbound HTTP requests - may give lower latency to some metrics queries * remove unnecessary use of unittest as pytest is already in use There's probably still refinement potential, but I'm happy with the improvements to readability. ### Behaviour changes * replace `/` → `/topologies` redirect with (OpenAPI on ReDoc) documentation ## To do * [ ] review changes * [ ] clean up notes * [ ] revert changes to `tools/python/checkstyle.ini` (it currently allows TODO/XXX/FIXME) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
