mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 21:02:21 +01:00
The discovery script imported build_search_payload from hltb_handler, which pulls in handler/metadata/__init__ and so instantiates every metadata handler, opens Redis and writes a config file at import time. That import side effect is why the workflow needed a dummy ROMM_BASE_PATH. The script also hand-forked the rest of the protocol (base headers, the /init mint, the session headers and the honeypot body merge), so it validated a candidate route against a copy of what the handler sends rather than against the real thing. Move the contract into utils/hltb_search.py, a leaf module both sides import, and drop ROMM_BASE_PATH from CI. Pace failed session mints too: _ensure_session retried on every lookup, so a down or IP-blocking HLTB cost each ROM in a scan its own rate-limited /init round trip. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Update HowLongToBeat API URL
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# HLTB rotates the endpoint without notice, and the fixture is served to
|
|
# every install from master, so check weekly rather than on someone noticing.
|
|
- cron: "0 6 * * 1"
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
update-hltb-api-url:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
|
|
|
|
- name: Install python
|
|
run: |
|
|
uv python install 3.13
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv sync
|
|
|
|
- name: Run HLTB API URL discovery script
|
|
# Only satisfies the backend config import; discovery authenticates nothing.
|
|
env:
|
|
# trunk-ignore(checkov/CKV_SECRET_6): placeholder, not a credential
|
|
ROMM_AUTH_SECRET_KEY: unused-by-endpoint-discovery
|
|
run: |
|
|
cd backend
|
|
uv run python -m utils.update_hltb_api_url
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
|
|
with:
|
|
add-paths: |
|
|
backend/handler/metadata/fixtures/hltb_api_url
|
|
commit-message: "Update HLTB API URL [skip CI]"
|
|
branch: update-hltb-api-url
|
|
sign-commits: true
|
|
title: "Update HLTB API URL [skip CI]"
|
|
reviewers: |
|
|
gantoine
|