Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0952729
feat: complete Phase 1 of version_scanner project
chalmerlowe Jun 11, 2026
163b773
test: fix ConfigManager signature and regex assertions
chalmerlowe Jun 11, 2026
3fd95aa
test: fix regex rule compilation in tests
chalmerlowe Jun 11, 2026
632e3da
fix: prevent truncation in sys.version_info.minor regexes
chalmerlowe Jun 11, 2026
6b844c6
fix: force string format in CSV output to prevent spreadsheet truncation
chalmerlowe Jun 11, 2026
f679fd7
build: update version_scanner.yml triggers to match repo standards
chalmerlowe Jun 11, 2026
2356936
chore: test workflow on push
chalmerlowe Jun 11, 2026
7b8f3c3
chore: update workflow trigger for new branch
chalmerlowe Jun 11, 2026
dc6b011
build: fix scanner output redirection and add artifact upload
chalmerlowe Jun 11, 2026
f357200
chore: updates github action versions and scanner config
chalmerlowe Jun 11, 2026
ae291ad
chore: update filename
chalmerlowe Jun 11, 2026
8b64db7
feat(scanner): add --soft-fail CLI flag and integrate in GHA workflow
chalmerlowe Jun 12, 2026
265ba67
chore(scanner): expand branch triggers to match any version-scanner b…
chalmerlowe Jun 12, 2026
e1c6391
chore(scanner): update cron trigger to run hourly
chalmerlowe Jun 12, 2026
4f67a1a
chore(scanner): simplify console output by removing rule listing and …
chalmerlowe Jun 12, 2026
fe5c56a
chore(scanner): update soft-fail help text and test docstring
chalmerlowe Jun 12, 2026
cc8cd2d
refactor(tests): use idiomatic pytest.raises instead of try-except fo…
chalmerlowe Jun 12, 2026
a002eb1
chore(scanner): address PR review comments on limit, safe-int, and st…
chalmerlowe Jun 12, 2026
e6fe5f6
docs(scanner): add descriptive docstrings to spreadsheet helpers
chalmerlowe Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/version_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Version Scan

on:
push:
branches:
- main
- '**version-scanner**'
schedule:
- cron: '0 * * * *' # Run hourly at the top of the hour
workflow_dispatch:

permissions:
contents: read
issues: write

jobs:
scan:
name: Version Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml

- name: Run Version Scanner
run: |
# Use -o to output the raw CSV to a file, and --stdout to print the summary to the GitHub Actions UI
python scripts/version_scanner/version_scanner.py -d python -v 3.7 --stdout -o version_scanner_output.csv --soft-fail

- name: Upload CSV Results
if: always()
uses: actions/upload-artifact@v7
with:
name: version-scanner-results
path: version_scanner_output.csv

- name: Create or update issue on finding
if: failure()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE="Version Scanner found deprecated dependencies"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# Read the first 50 lines to prevent blowing up the issue body if it's massive
CSV_PREVIEW=$(head -n 50 version_scanner_output.csv)

BODY="The [Version Scanner]($RUN_URL) found deprecated dependencies in the repository.

**Matches Found:**
\`\`\`csv
$CSV_PREVIEW
\`\`\`
*(If there are more than 50 matches, see the workflow logs for the full list)*"

# Mirroring regenerate-all.yml: check if an issue already exists to prevent spam
EXISTING_ISSUE=$(gh issue list --state open --search "in:title \"$TITLE\"" --json number --jq '.[0].number')

if [ -z "$EXISTING_ISSUE" ]; then
echo "WOULD HAVE CREATED ISSUE:"
echo "gh issue create --title \"$TITLE\" --body \"$BODY\""
# gh issue create --title "$TITLE" --body "$BODY"
else
echo "Issue #$EXISTING_ISSUE already exists."
echo "WOULD HAVE ADDED COMMENT:"
echo "gh issue comment \"$EXISTING_ISSUE\" --body \"Another scanner run found deprecated dependencies: $RUN_URL\""
# gh issue comment "$EXISTING_ISSUE" --body "Another scanner run found deprecated dependencies: $RUN_URL"
fi
14 changes: 7 additions & 7 deletions scripts/version_scanner/regex_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ rules:
- |
sys\.version_info\s*<\s*\(3,\s*{minor_plus_one}\)
- |
sys\.version_info\.minor\s*==\s*{minor}
sys\.version_info\.minor\s*==\s*{minor}(?!\d)
- |
sys\.version_info\.minor\s*>=\s*{minor}
sys\.version_info\.minor\s*>=\s*{minor}(?!\d)
- |
sys\.version_info\.minor\s*<=\s*{minor}
sys\.version_info\.minor\s*<=\s*{minor}(?!\d)
- |
sys\.version_info\.minor\s*>\s*{minor_minus_one}
sys\.version_info\.minor\s*>\s*{minor_minus_one}(?!\d)
- |
sys\.version_info\.minor\s*<\s*{minor_plus_one}
sys\.version_info\.minor\s*<\s*{minor_plus_one}(?!\d)

- name: python_env_short
description: Finds short python environment names often used in tox or nox.
Expand All @@ -87,7 +87,7 @@ rules:
- "Python3.7"
rules:
- |
python3\.{minor}
python3\.{minor}(?!\d)

- name: combined_version_string
description: Finds combined version strings often used in class or variable names.
Expand All @@ -97,6 +97,6 @@ rules:
- "Python37DeprecationWarning"
rules:
- |
Python{major}{minor}
Python{major}{minor}(?!\d)


Loading
Loading