Skip to content

Commit

Permalink
ci: extract version from git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nosahama committed Dec 18, 2024
1 parent 255ea7f commit d7f28e2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/container-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ jobs:
with:
fetch-depth: 0

- name: Install requirements
run: make install-dev

- name: Resolve Karapace version
run: |
source ./venv/bin/activate
KARAPACE_VERSION=$(python -c "from karapace import version; print(version.__version__)")
echo KARAPACE_VERSION=$KARAPACE_VERSION >> $GITHUB_ENV
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.12'

- name: Install requirements
run: make install-dev

- name: Resolve Karapace version
run: |
source ./venv/bin/activate
KARAPACE_VERSION=$(python -c "from karapace import version; print(version.__version__)")
echo KARAPACE_VERSION=$KARAPACE_VERSION >> $GITHUB_ENV
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
--showlocals
steps:
- uses: actions/checkout@v4
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -40,14 +43,8 @@ jobs:
with:
go-version: '1.21.0'

- name: Install requirements
run: make install-dev

- name: Resolve Karapace version
run: |
source ./venv/bin/activate
KARAPACE_VERSION=$(python -c "from karapace import version; print(version.__version__)")
echo KARAPACE_VERSION=$KARAPACE_VERSION >> $GITHUB_ENV
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV
Expand Down
3 changes: 1 addition & 2 deletions src/schema_registry/telemetry/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
url_attributes as U,
)
from opentelemetry.trace.span import Span
from typing import Any

import inspect

Expand All @@ -42,7 +41,7 @@ def get_name_from_caller() -> str:
return inspect.stack()[1].function

@staticmethod
def get_name_from_caller_with_class(function_class: object, function: Callable[[Any], Any]) -> str:
def get_name_from_caller_with_class(function_class: object, function: Callable) -> str:
return f"{type(function_class).__name__}.{function.__name__}()"

@staticmethod
Expand Down

0 comments on commit d7f28e2

Please sign in to comment.