The first SonarQube Cloud scan reported 57 issues. 45 are fixed in code, the 11 on the saved itch.io test pages leave the scan via .sonarcloud.properties, and css:S8776 (Tailwind's @utility nesting) is a false positive to mark on SonarQube Cloud. Worker: trailing slashes and the gate cookie's padding are trimmed by trimEnd() instead of /\/+$/ (quadratic on the public 404 path); the feed and collection parsers lose their backtracking regexes; compareCodeUnits keeps the code-unit sorts (the rule's localeCompare is locale-dependent); Number.*, DEFAULT_SIZES, crypto.randomUUID; i18n-edit.mjs reads stdin. Pipeline: the NSFW notices are one selector list, either class (the rule's ".a.b" would need both), each tested; plain if-guards; update_info.main returns None; no plain-http adapter; [[ ]] in cf_build_status.sh. Supply chain: requirements*.txt are hash-locked pip-tools compiles of requirements*.in (on Python 3.14, which Dependabot reads from the header), installed with --require-hashes --only-binary :all: in block scalars; npm ci --ignore-scripts in CI and the release builds (verified by manual release runs on all platforms); npm run cf:check. Release 4.4.2: also ships the toolchain upgrade (#149, #154) and Dependabot #141-#148, #150, #152, #153. CLAUDE.md gotchas 40 and 41. [skip-discuss] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
# Lint + tests for the data pipeline, and schema validation of the catalog.
|
|
# Pushes by the admin Worker's GitHub App also trigger this,
|
|
# so every externally written data change is validated.
|
|
name: Python CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'scripts/**'
|
|
- 'tests/**'
|
|
- 'data_game/**'
|
|
- 'requirements*.txt'
|
|
- 'requirements*.in'
|
|
- 'pyproject.toml'
|
|
- '.github/python-version'
|
|
- '.github/workflows/python-ci.yml'
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'scripts/**'
|
|
- 'tests/**'
|
|
- 'data_game/**'
|
|
- 'requirements*.txt'
|
|
- 'requirements*.in'
|
|
- 'pyproject.toml'
|
|
- '.github/python-version'
|
|
- '.github/workflows/python-ci.yml'
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: python-ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
# Not .python-version: Dependabot's pip updater reads that file and
|
|
# supports Python <= 3.14 only (CLAUDE.md gotcha 39).
|
|
python-version-file: .github/python-version
|
|
cache: pip
|
|
cache-dependency-path: |
|
|
requirements.txt
|
|
requirements-dev.txt
|
|
|
|
# Both hash-locked files at once: pip fails if their pins disagree.
|
|
# Wheels only, so no package runs a build script here.
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --require-hashes --only-binary :all: -r requirements.txt -r requirements-dev.txt
|
|
|
|
- name: Ruff
|
|
run: |
|
|
ruff check scripts tests webapp/scripts
|
|
ruff format --check scripts tests
|
|
|
|
- name: Vulture (dead code)
|
|
run: vulture
|
|
|
|
- name: Pytest (no network)
|
|
run: pytest
|
|
|
|
- name: Validate catalog data
|
|
run: python scripts/validate.py
|