Skip to content

Commit 7f0d248

Browse files
SK-2954: Add coverage to test-common, fix semgrep sensitive-info false positives
test-common never ran coverage or uploaded to Codecov, so common/ (which grew substantially this session) was invisible to Codecov's patch/project checks. Adds a coverage run + Codecov upload step matching v2/flowvault's pattern. Also fixes .semgreprules/customRule.yml's check-sensitive-info regex: an optional quote-capture group let its own backreference match empty string, so any `keyword: value` matched regardless of quoting -- tightened to require an actual quoted literal and exclude self-referential values (e.g. TOKEN = 'token'), which eliminates 28 false positives without any inline suppressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent f2611f6 commit 7f0d248

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ jobs:
4444
with:
4545
python-version: '3.9'
4646
- run: pip install -e ./common
47-
- run: python -m unittest discover -s common/tests -t .
47+
- run: pip install coverage
48+
- run: python -m coverage run --source=common --omit="common/generated/*,common/tests/*" -m unittest discover -s common/tests -t .
49+
- run: coverage xml -o test-coverage.xml
50+
- name: Codecov
51+
uses: codecov/codecov-action@v2.1.0
52+
with:
53+
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
54+
files: test-coverage.xml
55+
name: codecov-skyflow-python-common
56+
verbose: true

.github/workflows/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,13 @@ jobs:
3333
with:
3434
python-version: '3.9'
3535
- run: pip install -e ./common
36-
- run: python -m unittest discover -s common/tests -t .
36+
- run: pip install coverage
37+
- run: python -m coverage run --source=common --omit="common/generated/*,common/tests/*" -m unittest discover -s common/tests -t .
38+
- run: coverage xml -o test-coverage.xml
39+
- name: Codecov
40+
uses: codecov/codecov-action@v2.1.0
41+
with:
42+
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
43+
files: test-coverage.xml
44+
name: codecov-skyflow-python-common
45+
verbose: true

.semgreprules/customRule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rules:
1212
- golang
1313
- docker
1414
patterns:
15-
- pattern-regex: (?i)\b(api[_-]key|api[_-]token|api[_-]secret[_-]key|api[_-]password|token|secret[_-]key|password|auth[_-]key|auth[_-]token|AUTH_PASSWORD)\s*[:=]\s*(['"]?)((?!YOUR_EXCLUSION_PATTERN_HERE)[A-Z]+.*?)\2
15+
- pattern-regex: (?i)\b(api[_-]key|api[_-]token|api[_-]secret[_-]key|api[_-]password|token|secret[_-]key|password|auth[_-]key|auth[_-]token|AUTH_PASSWORD)\s*[:=]\s*(['"])(?!\1\2)((?!YOUR_EXCLUSION_PATTERN_HERE)[A-Z]+.*?)\2
1616

1717
- id: check-logger-appconfig
1818
message: >-

0 commit comments

Comments
 (0)