Commit Graph

118 Commits

Author SHA1 Message Date
Georges-Antoine Assi
474ef5b6e8 Move the e2e seed scripts to .github/scripts
They exist to stand up a disposable instance for the Playwright suite, so
they belong with the workflow that runs them rather than in backend/tools/
next to the library-generation utilities.

Their sys.path bootstrap now points at backend/ explicitly (it relied on
being one level below it), the workflow invokes them from the repo root
instead of backend/, and .github/scripts/** joins the workflow's path
filters so editing a seeder still triggers the suite.
2026-07-26 13:05:54 -04:00
Georges-Antoine Assi
395fe93912 cleanup 2026-07-26 12:56:16 -04:00
Georges-Antoine Assi
65425c1476 Run the e2e suite in CI
Adds .github/workflows/e2e.yml: MariaDB + Valkey services, migrations, an
offline library scan, the fixture users, the backend, then Playwright --
whose webServer starts the Vite dev server. DEV_PORT (5000) is both what
main.py binds and what Vite's /api proxy targets, so neither side needs
configuring. Report and test-results upload as an artifact on failure.

`tools/seed_e2e_library.py` scans backend/romm_test/library with an empty
metadata_sources list, so CI never reaches out to a provider. It exits
non-zero on an empty library rather than leaving a confusing Playwright
timeout later.

Also fixes the flakiness that a CI-shaped rehearsal exposed. Root cause was
not slowness: the Vite dev server force-reloads the page when it discovers a
new dependency to pre-bundle, wiping the half-filled login form so the submit
never lands. Defences are a passive warm-up pass in global-setup.ts (absorb
the reload before anything depends on the page, then compile the routes under
test) and a retry in login(). Two smaller real bugs fell out of the same
investigation: `button[type="submit"]` matched two elements, because the
collapsed reset-password form has its own, and the warm-up's best-effort
`.catch()` calls inherited a 120s timeout, making setup take 8 minutes.

Verified from a cold Vite cache against a throwaway database and the fixture
library: 15/15 pass, no flakes, 2.7 minutes.
2026-07-26 10:29:51 -04:00
Georges-Antoine Assi
de63580fcf trunk fmt everything 2026-07-19 20:35:51 -04:00
Georges-Antoine Assi
27692ae212 chore(i18n): add linter enforcing alphabetically sorted locale files
Add check_i18n_sorted.py, which fails when any locale JSON file's keys
are not sorted alphabetically (recursively, so nested objects are
covered). Supports --fix to sort in place. Wire it into the i18n CI
workflow alongside the existing parity check, and sort all existing
locale files.

Generated-By: PostHog Code
Task-Id: 7cbf74de-6bf1-45c0-9c8e-c45f94119edc
2026-07-15 22:07:35 -04:00
Georges-Antoine Assi
355ee14352 feat: inject ScreenScraper dev credentials at build time
Remove the hardcoded (base64-obfuscated) ScreenScraper developer
credentials from the source tree and read them from the
SCREENSCRAPER_DEV_ID / SCREENSCRAPER_DEV_PASSWORD environment variables
instead.

The official images bake the values in at build time from CI secrets via
Docker build args; local builds and source runs read them from the
environment. env.template documents the vars (commented out) so an empty
value never overrides the image's built-in credentials.

Generated-By: PostHog Code
Task-Id: 05a9b58b-4c64-4f75-af3e-d27cc4c5702f
2026-07-13 13:06:31 -04:00
Georges-Antoine Assi
cbf134a576 Update .github/workflows/frontend-v1-frozen.yml
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-07-10 18:10:21 -04:00
Georges-Antoine Assi
70cddb8984 ci: fail PRs that modify the frozen frontend v1 UI
The v1 UI (frontend/src/{views,components,console,layouts}) is frozen and
slated for deletion; new frontend work belongs in frontend/src/v2/. This
workflow fails any PR that touches v1 UI files, with an "allow-v1-changes"
label escape hatch for sanctioned critical bug fixes.

Generated-By: PostHog Code
Task-Id: 55fda8a5-426e-479d-8221-26a8437e57bb
2026-07-10 18:00:37 -04:00
Georges-Antoine Assi
c9779a6302 Stop spamming PRs with coverage reports 2026-06-28 22:13:57 -04:00
Georges-Antoine Assi
93922faf91 Key Docker Hub namespace off push credential
Derive the Docker Hub namespace from DOCKER_NAMESPACE, falling back to
DOCKER_USERNAME and then github.repository_owner, so forks whose GitHub
owner name differs from their writable Docker Hub namespace can push.
GHCR is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:43:03 -04:00
Georges-Antoine Assi
da7658a4aa Clarify GHCR-only preview build PR comment
Rename the comment step to reflect that PR builds only push to GHCR,
add a note explaining the hardcoded registry, and inline the image
string into the updateComment call.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:26:30 -04:00
Ian Mancini
967c146fe9 feat: add option to push experimental image to both registries 2026-06-21 20:40:38 -03:00
Ian Mancini
0f17e70350 feat: add action option to push test images to ghcr 2026-06-21 17:38:09 -03:00
Ian Mancini
7f129b9cf0 fix: use repository owner to allow forks to push images to Docker Hub 2026-06-21 16:28:34 -03:00
Georges-Antoine Assi
26cf4b36f8 Scope test-user grant to the romm_test namespace
Addresses review feedback: granting ALL PRIVILEGES on *.* is overly broad,
especially against a shared DB instance. A database-level grant on the
`romm\_test%` wildcard pattern still lets the user CREATE the per-worker
databases (romm_test_gw0, ...) needed by pytest-xdist, while confining it to
that namespace — verified that out-of-namespace CREATE DATABASE is denied.

PostgreSQL needs no equivalent change: its CI service user (POSTGRES_USER)
is the container superuser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:34:46 -04:00
Georges-Antoine Assi
02815ec403 Run backend tests in parallel with pytest-xdist
Add pytest-xdist and run the backend test suite across multiple workers
(`-n 4` in CI). Each worker gets its own database so the autouse
`clear_database` fixture can't wipe rows another worker is mid-test with:

- Rootdir `backend/conftest.py` sets a per-worker `DB_NAME`
  (`romm_test_gw0`, ...) before any app module is imported, so each
  worker's engine binds to its own database.
- `tests/conftest.py` creates the per-worker database on demand (mariadb/
  mysql and postgresql paths) just before migrations run.
- The test user's grant is widened to `*.*` (setup.sql + CI) so it can
  `CREATE DATABASE` for the workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 21:02:47 -04:00
Georges-Antoine Assi
1e78a2ed59 Merge branch 'master' into claude/exciting-heisenberg-61PF9 2026-06-18 19:59:00 -04:00
zurdi
0450ab7887 chore: remove lint job from frontend workflow 2026-06-17 10:04:47 +02:00
zurdi
8f879d0b59 chore: update Node.js version to 24.16 across workflows and Dockerfile, and enhance package.json with npm version specification 2026-05-26 09:23:47 +00:00
Claude
95958b6687 test: integrate Hypothesis property-based testing for backend
Add Hypothesis to the test dependency group with CI/dev profiles, and
introduce property-based tests for high-value pure functions: crc32_to_hex,
filesystem and LaunchBox filename sanitization, LaunchBox metadata parsers,
and ROM filename tag parsing.

https://claude.ai/code/session_01GCTFmzuhvqNbSAfw3rGxmj
2026-05-21 16:40:04 +00:00
zurdi
df8f6178ef chore(frontend): set up vitest + storybook play() tests and align CI
Add Vitest 4 with happy-dom, @vue/test-utils, and a single
test/storybook.test.ts that auto-discovers every story under
src/v2/lib and runs its play() via composeStories — no Playwright,
just composition-based interaction tests. 89 stories now smoke-pass
in CI.

Scripts: lint:fix (auto-fix), lint (now scoped to ./src/v2; v1 is
frozen), lint:all (legacy sweep), test, test:watch, test:ui,
storybook:test.

eslint.config.js gets argsIgnorePattern: "^_" so unused-by-design
parameters can use the underscore convention.

CI: new frontend.yml runs lint, test, build in parallel on
frontend/** changes; typecheck.yml bumped to Node 22 with cached
npm ci. Existing typecheck job preserved for branch protection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 11:52:44 +00:00
Georges-Antoine Assi
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
7c41fb5bac revert fs_name sibling roms 2026-04-05 17:57:48 -04:00
Georges-Antoine Assi
5da813c871 add perms to copilot setup step 2026-04-03 09:47:05 -04:00
zurdi
a18fd9c459 fix: remove conditional check for mariadb connectors installation 2026-03-20 13:43:47 +00:00
nendo
51c990dcba fix(ci): install mariadb connectors on all runners
uv sync installs sqlalchemy[mariadb-connector] regardless of which
database is being tested, so libmariadb-dev must be present on all
runners. The postgres migration job and pytest postgresql matrix were
missing this step.
2026-03-16 11:40:39 +09:00
Georges-Antoine Assi
2beba3d141 move to corrrect folder 2026-03-12 21:15:08 -04:00
Georges-Antoine Assi
b9e3ae6be3 add perm to job itself 2026-03-09 23:09:05 -04:00
Georges-Antoine Assi
30db3725f4 add comment at the beginnig 2026-03-09 23:02:52 -04:00
Georges-Antoine Assi
bdd5f4b078 add PR label to trigger preview build 2026-03-09 22:59:31 -04:00
Georges-Antoine Assi
2f7f6f65e7 run tests against postgres matrix 2026-03-08 10:20:09 -04:00
Georges-Antoine Assi
e79204ee4a continue-on-error: true in pytest publish report step 2026-02-03 09:22:09 -05:00
Georges-Antoine Assi
5f58deb3ec set more env vars 2026-01-26 21:50:41 -05:00
Georges-Antoine Assi
08839b85c2 add missing env var 2026-01-26 21:40:07 -05:00
Georges-Antoine Assi
958a337ce2 tweak test in migration file 2026-01-26 21:32:03 -05:00
Georges-Antoine Assi
2576ba6bbc Add workflow to run migrations on PR 2026-01-26 21:30:01 -05:00
Georges-Antoine Assi
743bddcb23 add valkey to pytest ci 2026-01-10 09:22:46 -05:00
Georges-Antoine Assi
41cf73bbb7 changes from bot review 2026-01-01 11:32:14 -05:00
Georges-Antoine Assi
bf2413cc73 add perm to action 2025-11-18 12:08:50 -05:00
Georges-Antoine Assi
8eadab6672 open PR when running hltb update 2025-11-18 12:05:31 -05:00
Georges-Antoine Assi
2be1bab224 changes from bot review 2025-11-17 15:46:14 -05:00
Georges-Antoine Assi
8d91362a24 cahgnes from self review 2025-11-17 15:35:08 -05:00
Georges-Antoine Assi
95c506aec0 Add github action to update HLTB API url 2025-11-17 15:27:48 -05:00
Jan van Brügge
06c29119f3 ci: Also check for integrity field in lockfile lint job 2025-10-01 15:12:03 +01:00
Georges-Antoine Assi
91fb6f6f23 initialize field 2025-09-23 18:23:08 -04:00
Georges-Antoine Assi
92ca3d899c pin docker uses to immutable versions 2025-09-18 10:02:54 -04:00
Georges-Antoine Assi
24c0b1836b add rc to valid semver 2025-07-19 10:41:44 -04:00
Georges-Antoine Assi
2e047e41ce actually generate coverage file 2025-07-06 09:32:38 -04:00
Georges-Antoine Assi
7cdc42e307 use coverage from bckend 2025-07-06 09:16:37 -04:00
Georges-Antoine Assi
b797e63fdf augment pytest with coverage 2025-07-05 23:20:52 -04:00