Skip to content

Commit 1d359f2

Browse files
authored
Merge pull request #26 from zcsadmin/fix/log_for_otel
fix: add safeguard for OTel logs
2 parents 05b0df8 + fcb1247 commit 1d359f2

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/publish-tag.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
permissions:
14-
contents: 'read'
14+
contents: 'write'
1515
id-token: 'write'
1616

1717
steps:
1818
- id: checkout
1919
name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- id: auth
2323
name: Authenticate with Google Cloud
24-
uses: google-github-actions/auth@v2
24+
uses: google-github-actions/auth@v3
2525
with:
2626
token_format: access_token
2727
workload_identity_provider: projects/51853309262/locations/global/workloadIdentityPools/my-pool/providers/my-provider
@@ -34,7 +34,7 @@ jobs:
3434
cat app/pyproject.toml
3535
3636
- name: Setup Python
37-
uses: actions/setup-python@v3
37+
uses: actions/setup-python@v6
3838

3939
- name: Install Dependencies
4040
run: |
@@ -60,3 +60,18 @@ jobs:
6060
gcloud config set artifacts/location europe-west1
6161
gcloud artifacts print-settings python > ~/.pypirc
6262
python -m twine upload --repository python dist/*
63+
64+
- name: Check if pre-release
65+
id: check_prerelease
66+
run: |
67+
if [[ "${{ github.ref_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then
68+
echo "prerelease=false" >> $GITHUB_OUTPUT
69+
else
70+
echo "prerelease=true" >> $GITHUB_OUTPUT
71+
fi
72+
73+
- name: Create GitHub Release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
generate_release_notes: true
77+
prerelease: ${{ steps.check_prerelease.outputs.prerelease }}

app/src/zcs/core/logger/logger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ def record_factory(*args, **kwargs):
1818

1919
# Set original exception value if needed
2020
record.original_exception = None
21-
if args[6] is not None:
22-
for arg in args[6]:
21+
value = args[6] if len(args) > 6 else None
22+
if isinstance(value, (list, tuple, set)):
23+
for arg in value:
2324
if isinstance(arg, Exception):
2425
record.original_exception = arg
2526
if isinstance(arg, ZcsException):

0 commit comments

Comments
 (0)