Skip to content

chore: Adds version scanner CI/CD upgrades#17425

Open
chalmerlowe wants to merge 19 commits into
mainfrom
feat/version-scanner-cicd-upgrades
Open

chore: Adds version scanner CI/CD upgrades#17425
chalmerlowe wants to merge 19 commits into
mainfrom
feat/version-scanner-cicd-upgrades

Conversation

@chalmerlowe

@chalmerlowe chalmerlowe commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR contains updates to the automated dependency version scanner tool and its associated CI/CD workflow to support decoupled formatting, clean console logs, and advisory (non-signalling) runs during rollout.

1. GitHub Actions (GHA) Workflow Modernization

  • Triggers & Scheduling:
  • Configured the workflow to run on main and any branch matching '**version-scanner**'
  • Set the schedule to run hourly to test how the system behaves if we choose to use it nightly
  • Added a workflow_dispatch button in the GHA tab to simplify ad hoc testing and demos during development.

2. Scanner Script Refactoring (Decoupled Formatters)

  • Decoupled formatting code from reporting code.
  • Introduced specialized formatters:
    • format_for_raw_csv: Generates clean, unformatted raw data for CSV reporting.
    • format_for_spreadsheet: Wraps matches with Google Sheets formulas (such as HYPERLINK and string quotes to prevent float truncation) for Google Sheets upload.
    • format_for_console: Prepares a slim, readable console string for stdout/logs (especially GHA logs).

3. Output Simplification

  • Removed some existing outputs that no longer made sense to to declutter GHA runner logs.
  • Ensure it prints matches in the clean console format and removed some existing duplicate outputs.

4. Advisory Runs (--soft-fail)

  • Added a --soft-fail CLI flag to the python script to allow it to exit with code 0 even if version matches are found (allowing the scan to run and report findings in the logs without failing the GHA check and blocking merges during development and prototyping phases).
  • Integrated --soft-fail in the GHA workflow for now to support development.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces negative lookahead patterns to prevent version truncation bugs (e.g., matching 3.10 as 3.1), adds Excel-compatible formatting for matched strings, introduces a --stdout option, and updates exit codes for CI/CD integration. Feedback from the reviewer recommends restricting the Excel-specific wrapping to numeric/version strings to avoid formula errors, using pytest.raises for cleaner test assertions, and removing unused imports and redundant file writes in the stdout logic.

Comment thread scripts/version_scanner/version_scanner.py Outdated
Comment thread scripts/version_scanner/tests/unit/test_version_scanner.py Outdated
Comment thread scripts/version_scanner/tests/unit/test_version_scanner.py Outdated
Comment thread scripts/version_scanner/version_scanner.py Outdated
@chalmerlowe chalmerlowe marked this pull request as ready for review June 12, 2026 13:07
@chalmerlowe chalmerlowe requested a review from a team as a code owner June 12, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant