Repository navigation
Conversation
Python 3.10 is end of life. The CI matrix covers 3.11 to 3.15, and the future import of annotations that Python 3.8 needed goes. mypy and ruff move to their latest versions; the ruff configuration follows the Checkmk repository in leaving the flake8-type-checking and pydocstyle families off.
2d41bd1 to
8b9585b
Compare
The keyword logged through the root logger, which ruff's LOG015 rejects. A logger named after the module lets the message be filtered by name; Robot Framework captures it into the log the same way.
5757a7e to
5cfa1d6
Compare
The keyword moves from RobotmkLibrary/__init__.py to RobotmkLibrary/runtime/__init__.py; the package re-exports it, so Library RobotmkLibrary keeps working, and Library RobotmkLibrary.runtime imports the runtime keywords alone. The README documents the keyword. robotframework becomes a dependency, and an integration test pins the keyword list of the package through libdoc. pytest joins the dev tools and the workflow; mypy checks the tests too, with calls into the untyped robot package excluded from disallow_untyped_calls and the Any-typed values it returns tolerated in tests.
RobotmkLibrary.instrumentation.listener.RobotmkListener exports one trace per robot run over OTLP/HTTP: suite, test and keyword spans with rf.* attributes and the Robot Framework status, log messages as log records of the open span, embedded screenshots as image records. The Checkmk identity is read from CHECKMK_RESOURCE_ATTRIBUTES. The providers are registered as the process globals so that other instrumentations nest below the running keyword; a provider registered earlier is an error. The package exposes __version__ from the installed metadata as the instrumentation scope version. The library depends on opentelemetry-sdk and the OTLP/HTTP exporter.
5cfa1d6 to
46ae166
Compare
jherbel
left a comment
There was a problem hiding this comment.
Very nice, thanks! Missing tests are OK, since we explicitly agreed that they will come in a follow-up change.
Mainly cosmetic comments + the Python version changes in here. Also, for next time: Please move monitor_subsequent_keyword_runtime in a separate change.
| strategy: | ||
| matrix: | ||
| python_version: | ||
| - "3.8" |
There was a problem hiding this comment.
You mean in this PR? I have a separate PR for only the python changes and the packaging, but I have never used stacked PRs and was not sure how to get this into review without including the full chain. See: #6
I considered looking into stacked PRs but I figured its small enough so we can do this in a single PR. If you prefer we can merge #6 before and then rebase this change before merging.
There was a problem hiding this comment.
I tried my luck here: https://github.com/Checkmk/robotframework-robotmklibrary/stack/13
| @@ -0,0 +1,20 @@ | |||
| """Keywords for the runtime monitoring of the Checkmk test services.""" | |||
There was a problem hiding this comment.
Suggestions: let's name the sub-package keyword_monitoring. I suspect that we might implement more of that in the future.
| ] | ||
| requires-python = ">=3.8" | ||
| dependencies = [] | ||
| requires-python = ">=3.11" |
| class _EmbeddedImage(NamedTuple): | ||
| media_type: str | ||
| payload: str | ||
|
|
||
|
|
||
| class _OpenSpan(NamedTuple): | ||
| span: trace.Span | ||
| token: Token[Context] |
There was a problem hiding this comment.
Can we use frozen dataclasses instead?
|
Regarding the Python version changes: If you need them here, we could try this: https://docs.github.com/en/pull-requests/how-tos/stacked-pull-requests |
|
closing this in favor of the stacked PRs |
No description provided.