Skip to content

Commit c124871

Browse files
committed
chore: drop the game category (moved to GetTechAPI/game-catalog)
Games were 962,384 of TechAPI's 1.11M records and referenced nothing, so they carried 86% of the dump cost for a leaf category: over five hours to generate and pull requests GitHub could neither render nor merge. The records now live in GetTechAPI/game-catalog with their import history intact, validated there (962,384 records, 0 errors) and published at https://gettechapi.github.io/game-catalog/. Removes the model, schema, router, serializer, seed and validation paths, plus the Pages workaround that had to skip games at dump time. Refs #1
1 parent 524878b commit c124871

15 files changed

Lines changed: 6 additions & 305 deletions

File tree

‎.github/workflows/deploy-pages.yml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ jobs:
4444
- name: Generate static JSON dump + openapi.json
4545
env:
4646
TECHAPI_DATA_DIR: ${{ github.workspace }}/TechAPI/data
47-
# Games are not published here: ~962k per-record files exceed the fixed
48-
# GitHub Pages deployment window (the deploy step times out at
49-
# "syncing_files"). Skipping them at generation time also keeps this
50-
# step from writing files that would only be deleted before upload.
51-
# They remain available as versioned data in the TechAPI repo.
52-
run: python -m app.dump --output dump --exclude games
47+
run: python -m app.dump --output dump
5348

5449
- uses: actions/setup-node@v4
5550
with:

‎app/dump.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"cpus",
3232
"laptops",
3333
"monitors",
34-
"games",
3534
"software",
3635
"websites",
3736
]
@@ -151,7 +150,7 @@ def run(output_dir: Path = OUTPUT_DIR, exclude: list[str] | None = None) -> None
151150
default=[],
152151
metavar="COLLECTION",
153152
help=(
154-
"collection to skip, repeatable (e.g. --exclude games). Useful when a "
153+
"collection to skip, repeatable (e.g. --exclude software). Useful when a "
155154
"consumer does not publish a large collection: skipping it avoids "
156155
"writing hundreds of thousands of files that are discarded anyway."
157156
),

‎app/main.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from app.routers import (
1818
brands,
1919
cpus,
20-
games,
2120
gpus,
2221
laptops,
2322
meta,
@@ -89,7 +88,6 @@ async def add_request_id(
8988
app.include_router(cpus.router, prefix=PREFIX)
9089
app.include_router(laptops.router, prefix=PREFIX)
9190
app.include_router(monitors.router, prefix=PREFIX)
92-
app.include_router(games.router, prefix=PREFIX)
9391
app.include_router(software.router, prefix=PREFIX)
9492
app.include_router(websites.router, prefix=PREFIX)
9593

‎app/models/__init__.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from app.models.brand import Brand
77
from app.models.cpu import CPU
8-
from app.models.game import Game
98
from app.models.gpu import DiscreteGPU
109
from app.models.laptop import Laptop
1110
from app.models.mobile_device import PDA, Tablet, Watch
@@ -25,6 +24,5 @@
2524
"CPU",
2625
"Laptop",
2726
"Monitor",
28-
"Game",
2927
"Software",
3028
]

‎app/models/game.py‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎app/routers/games.py‎

Lines changed: 0 additions & 63 deletions
This file was deleted.

‎app/schemas/__init__.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from app.schemas.brand import BrandRead, BrandSummary
44
from app.schemas.common import ErrorBody, ErrorResponse, Page, ResourceRef
5-
from app.schemas.game import GameRead
65
from app.schemas.laptop import LaptopRead
76
from app.schemas.monitor import MonitorRead
87
from app.schemas.smartphone import ScoreRead, SmartphoneRead
@@ -23,6 +22,5 @@
2322
"ScoreRead",
2423
"LaptopRead",
2524
"MonitorRead",
26-
"GameRead",
2725
"SoftwareRead",
2826
]

‎app/schemas/game.py‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎app/schemas/serializers.py‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from app.config import settings
66
from app.models.brand import Brand
77
from app.models.cpu import CPU
8-
from app.models.game import Game
98
from app.models.gpu import DiscreteGPU
109
from app.models.laptop import Laptop
1110
from app.models.mobile_device import MobileDeviceFields
@@ -17,7 +16,6 @@
1716
from app.schemas.brand import BrandRead, BrandSummary
1817
from app.schemas.common import HybridRead, ManufacturerRef, ResourceRef
1918
from app.schemas.cpu import CPURead, CPUScoreRead
20-
from app.schemas.game import GameRead
2119
from app.schemas.gpu import GPURead, GPUScoreRead
2220
from app.schemas.laptop import LaptopRead
2321
from app.schemas.mobile_device import MobileDeviceRead
@@ -384,33 +382,6 @@ def monitor_read(monitor: Monitor, brand: Brand) -> MonitorRead:
384382
)
385383

386384

387-
def game_read(game: Game) -> GameRead:
388-
assert game.id is not None
389-
return GameRead(
390-
id=game.id,
391-
slug=game.slug,
392-
name=game.name,
393-
release_date=game.release_date,
394-
rating=game.rating,
395-
rating_count=game.rating_count,
396-
metacritic=game.metacritic,
397-
playtime_hours=game.playtime_hours,
398-
platforms=game.platforms,
399-
genres=game.genres,
400-
stores=game.stores,
401-
developers=game.developers,
402-
publishers=game.publishers,
403-
tags=game.tags,
404-
esrb_rating=game.esrb_rating,
405-
background_image=game.background_image,
406-
verified=game.verified,
407-
source_urls=game.source_urls,
408-
created_at=game.created_at,
409-
updated_at=game.updated_at,
410-
url=url_for("games", game.slug),
411-
)
412-
413-
414385
def software_read(software: Software) -> SoftwareRead:
415386
assert software.id is not None
416387
return SoftwareRead(

‎app/seed.py‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from app.database import create_db_and_tables, engine
2828
from app.models.brand import Brand
2929
from app.models.cpu import CPU
30-
from app.models.game import Game
3130
from app.models.gpu import DiscreteGPU
3231
from app.models.laptop import Laptop
3332
from app.models.mobile_device import PDA, Tablet, Watch
@@ -103,7 +102,6 @@ def seed(session: Session, data_dir: Path = DATA_DIR) -> dict[str, int]:
103102
"cpus": 0,
104103
"laptops": 0,
105104
"monitors": 0,
106-
"games": 0,
107105
"software": 0,
108106
"websites": 0,
109107
}
@@ -264,15 +262,6 @@ def seed_mobile_devices(subdir: str, model: type[SQLModel], count_key: str) -> N
264262
counts["monitors"] += 1
265263
session.commit()
266264

267-
# --- Games (standalone; no brand FK) ---
268-
game_slugs = _existing_slugs(session, Game)
269-
for record in _load_dir(data_dir / "game"):
270-
if record["slug"] in game_slugs:
271-
continue
272-
session.add(_with_id(Game(**record), taken))
273-
counts["games"] += 1
274-
session.commit()
275-
276265
# --- Software (standalone; no brand FK) ---
277266
software_slugs = _existing_slugs(session, Software)
278267
for record in _load_dir(data_dir / "software"):

0 commit comments

Comments
 (0)