-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): restore green main (workflow callers, type errors, coverage, hardening) #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
496524c
6c9b634
bcdad33
63be743
95585f5
b76c478
80dac4d
a4ad68c
1b22b47
cd3be61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -54,11 +54,16 @@ jobs: | |||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Harden the runner | ||||||||||||||
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||||||||||||||
| with: | ||||||||||||||
| egress-policy: audit | ||||||||||||||
|
|
||||||||||||||
| - name: Checkout repository | ||||||||||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||||||||||||||
|
Comment on lines
62
to
63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Set Neither 🛡️ Proposed hardening (apply to both checkout steps) - name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: falseAs per coding guidelines for 📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[warning] 62-63: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| - name: Install uv | ||||||||||||||
| uses: astral-sh/setup-uv@v7 | ||||||||||||||
| uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1 | ||||||||||||||
| with: | ||||||||||||||
| enable-cache: true | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -200,11 +205,16 @@ jobs: | |||||||||||||
| needs: fips-check | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Harden the runner | ||||||||||||||
| uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | ||||||||||||||
| with: | ||||||||||||||
| egress-policy: audit | ||||||||||||||
|
|
||||||||||||||
| - name: Checkout repository | ||||||||||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||||||||||||||
|
|
||||||||||||||
| - name: Install uv | ||||||||||||||
| uses: astral-sh/setup-uv@v7 | ||||||||||||||
| uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1 | ||||||||||||||
| with: | ||||||||||||||
| enable-cache: true | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,12 +37,16 @@ jobs: | |
| name: Python Compatibility Matrix | ||
| uses: ByronWilliamsCPA/.github/.github/workflows/python-compatibility.yml@main | ||
| with: | ||
| no-build: false # hatchling build backend: editable install must build | ||
| python-versions: '["3.10", "3.11", "3.12", "3.13"]' | ||
| operating-systems: '["ubuntu-latest"]' | ||
| include-macos: true | ||
| include-windows: true | ||
| source-directory: 'src' | ||
| test-command: 'pytest tests/ -v --tb=short -x --ignore=tests/integration --ignore=tests/load -m "not slow and not integration"' | ||
| # No -m marker expression: the embedded quotes do not survive the org | ||
| # workflow's shell expansion (pytest then reads "slow" as a path). The | ||
| # integration/load suites are excluded by path instead. | ||
| test-command: 'pytest tests/ -v --tb=short -x --ignore=tests/integration --ignore=tests/load' | ||
|
Comment on lines
+46
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find tests marked slow that are outside tests/integration and tests/load.
rg -nP '`@pytest`\.mark\.slow' -g 'tests/**/*.py' \
-g '!tests/integration/**' -g '!tests/load/**'Repository: ByronWilliamsCPA/Unify Length of output: 48 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Show the workflow around the cited lines and also any prior `-m` usage in the file
echo "---- workflow snippet (.github/workflows/python-compatibility.yml) ----"
nl -ba .github/workflows/python-compatibility.yml | sed -n '1,120p'
# 2) Search for any `-m` expressions mentioning slow/integration in this workflow
echo "---- -m expressions in workflow ----"
rg -n "pytest.*-m|--ignore=tests/integration|--ignore=tests/load|slow|integration" .github/workflows/python-compatibility.yml
# 3) Find slow-marked tests anywhere
echo "---- `@pytest.mark.slow` anywhere under tests ----"
rg -nP '`@pytest`\.mark\.slow' tests/**/*.py || true
# 4) Re-run the original "outside integration/load" query (the earlier run returned exit 1)
echo "---- `@pytest.mark.slow` outside tests/integration and tests/load ----"
rg -nP '`@pytest`\.mark\.slow' -g 'tests/**/*.py' \
-g '!tests/integration/**' -g '!tests/load/**' || trueRepository: ByronWilliamsCPA/Unify Length of output: 199 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- workflow file head (with line numbers) ----"
cat -n .github/workflows/python-compatibility.yml | sed -n '1,120p'
echo "---- -m / slow / ignore usage in workflow ----"
rg -n "pytest.*-m|--ignore=tests/integration|--ignore=tests/load|slow|integration" .github/workflows/python-compatibility.yml || true
echo "---- `@pytest.mark.slow` anywhere under tests ----"
rg -nP '`@pytest`\.mark\.slow' tests/**/*.py || true
echo "---- `@pytest.mark.slow` outside integration/load dirs ----"
rg -nP '`@pytest`\.mark\.slow' -g 'tests/**/*.py' \
-g '!tests/integration/**' -g '!tests/load/**' || trueRepository: ByronWilliamsCPA/Unify Length of output: 2545 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- any pytest -m usage mentioning slow/integration in workflows ----"
rg -n "pytest .* -m|pytest.*--ignore=tests/integration|--ignore=tests/load|not slow|slow and not|integration and not" .github/workflows || true
echo "---- references to 'slow' in tests (broader than mark.slow) ----"
rg -n "slow" tests || true
echo "---- pytest marker declarations for slow (pytest.ini/pyproject/etc.) ----"
rg -n "markers:|@?pytest\.mark|slow" pyproject.toml tests . || trueRepository: ByronWilliamsCPA/Unify Length of output: 26934 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- any pytest.mark.slow / mark.slow usage ----"
rg -nP 'pytest\.mark\.slow|mark\.slow' tests/**/*.py || true
echo "---- any -m selections referencing slow in workflows ----"
rg -n "pytest .* -m|pytest.*--ignore|not slow|not slow and|slow and" .github/workflows || true
echo "---- any 'slow' marker selection in repo docs/config (for context) ----"
rg -n "not slow|mark.slow|`@pytest`\.mark\.slow" pyproject.toml tests .github/workflows || trueRepository: ByronWilliamsCPA/Unify Length of output: 563 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- `@pytest.mark.integration` anywhere ----"
rg -nP '`@pytest`\.mark\.integration|pytestmark\s*=\s*pytest\.mark\.integration' tests/**/*.py || true
echo "---- `@pytest.mark.integration` outside tests/integration dir ----"
rg -nP '`@pytest`\.mark\.integration|pytestmark\s*=\s*pytest\.mark\.integration' \
-g 'tests/**/*.py' \
-g '!tests/integration/**' \
|| trueRepository: ByronWilliamsCPA/Unify Length of output: 386 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- tests/conftest.py (relevant range) ----"
cat -n tests/conftest.py | sed -n '1,140p'
echo "---- any code that programmatically applies the 'slow' mark ----"
rg -n "add_marker\\(['\"]slow['\"]\\)|mark\\.slow|pytest\\.mark\\.slow|\\bslow\\b.*mark|mark.*\\bslow\\b" tests/**/*.py tests/conftest.py pyproject.toml || trueRepository: ByronWilliamsCPA/Unify Length of output: 5226 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- all occurrences of 'slow' in tests/conftest.py ----"
rg -n "slow" tests/conftest.py || true
echo "---- pytest collection hooks in tests/conftest.py ----"
rg -n "pytest_collection_|add_marker|collect|modifyitems" tests/conftest.py || trueRepository: ByronWilliamsCPA/Unify Length of output: 296 🏁 Script executed: #!/bin/bash
set -euo pipefail
cat -n tests/test_example.py | sed -n '150,240p'Repository: ByronWilliamsCPA/Unify Length of output: 2455 Fix test selection semantics: The workflow no longer uses 🤖 Prompt for AI Agents |
||
| coverage-report: false | ||
| fail-fast: false | ||
| timeout-minutes: 30 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Set
persist-credentials: falseon checkout.This job only reads the dependency diff and never pushes, so the
GITHUB_TOKENdoes not need to persist in.git/config. Disabling persistence reduces the credential-exfiltration surface for the subsequently invoked third-party action.🛡️ Proposed hardening
- name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: falseAs per coding guidelines for
.github/workflows/**: review for "Security best practices (minimal permissions, pinned actions)" and "Proper secret handling".📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 32-33: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents