From 3eb7de77bf5bef895c5e3e83b69a6d100c115502 Mon Sep 17 00:00:00 2001 From: GRBurst Date: Mon, 24 Jul 2023 00:41:41 +0200 Subject: [PATCH 1/2] ci: Always run and output test coverage Signed-off-by: GRBurst --- .github/workflows/deploy.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b26bf27..599ed84 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -70,14 +70,13 @@ jobs: run: | pytest - - name: Gather Badge Data - if: github.ref_name == 'main' && github.event_name == 'push' + - name: coverage | Test Coverage run: | coverage run -m pytest -s coverage report -m - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v3 - if: always() && github.ref_name == 'main' && github.event_name == 'push' + if: github.ref_name == 'main' && github.event_name == 'push' with: ref: assets path: assets From 547f5ef4d9e47935560ad45a64da35708e4e8dec Mon Sep 17 00:00:00 2001 From: GRBurst Date: Mon, 24 Jul 2023 00:51:17 +0200 Subject: [PATCH 2/2] wip Signed-off-by: GRBurst --- slack_logger/__init__.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/slack_logger/__init__.py b/slack_logger/__init__.py index b222aa0..bd2ca49 100644 --- a/slack_logger/__init__.py +++ b/slack_logger/__init__.py @@ -81,13 +81,16 @@ def construct_context( if config.context != []: context_msg = ", ".join(config.context) return ContextBlock(elements=[MarkdownTextObject(text=context_msg)]) - elif env is not None and service is not None: - return ContextBlock(elements=[MarkdownTextObject(text=f":point_right: {env}, {service}")]) - elif env is None: - return ContextBlock(elements=[MarkdownTextObject(text=f":point_right: {env}")]) - elif service is None: - return ContextBlock(elements=[MarkdownTextObject(text=f":point_right: {service}")]) - return None + if env is None and service is None: + return None + + context: List[str] = [] + if env is not None: + context.append(env) + if service is not None: + context.append(service) + + return ContextBlock(elements=[MarkdownTextObject(text=f":point_right: {','.join(context)}")]) def format(self, record: LogRecord) -> str: maybe_blocks: Sequence[Optional[Block]] = self.format_blocks(record=record)