Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.10 #342

Merged
merged 155 commits into from
Aug 15, 2023
Merged

v1.10 #342

Show file tree
Hide file tree
Changes from 154 commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
ce7684c
Refactor config + add pytest
Jul 31, 2023
cc98b36
Refactor logger
Jul 31, 2023
71cd6b5
Alembic pre-test migrations + db handler tests
Jul 31, 2023
9ce9524
Fix get_roms method
Aug 1, 2023
ebe557c
Refactor + add tests for igdb handler
Aug 1, 2023
8b5a263
Mark cassettes as lingust generated
Aug 1, 2023
5f73153
Merge branch 'master' into backend-testing-refactor
Aug 1, 2023
e1dff4a
Fix broken tests from merge
Aug 1, 2023
355d3c7
Add tests for utils init
Aug 1, 2023
d3f818d
Add tests for fastapi
Aug 1, 2023
27f344b
Add tests for fs
Aug 1, 2023
f49dd64
Remove test resources
Aug 1, 2023
22b402e
Add ignores for testing resources
Aug 1, 2023
d81aeda
Merge pull request #315 from zurdi15/release
zurdi15 Aug 1, 2023
f6576f1
Changes and comments from self review
Aug 1, 2023
8347cf5
Add test for models
Aug 1, 2023
fad8d95
Fix scanning + centralize icon rendering
Aug 1, 2023
df41336
Changes so it builds on rpi
Aug 2, 2023
c56c295
Merge branch 'master' into backend-testing-refactor
Aug 2, 2023
b553868
fixed database variable to match pytest variables
zurdi15 Aug 2, 2023
c9aa2ee
fixed scan + case insensitive
zurdi15 Aug 2, 2023
fba7b6a
tests fixed
zurdi15 Aug 2, 2023
cac59de
updated get_rom cassette
zurdi15 Aug 2, 2023
d830ea5
Add docs for running tests
Aug 2, 2023
53d09ba
updated mariadb to 1.1.7
zurdi15 Aug 3, 2023
282d36e
test db and user creation fixed and scripted
zurdi15 Aug 3, 2023
d8b8022
automatic migrations when running the backend
zurdi15 Aug 3, 2023
479393a
developer docs updated
zurdi15 Aug 3, 2023
569f01b
Update DEVELOPER-SETUP.md
zurdi15 Aug 3, 2023
be18268
added fix for mariadb connector/c version
zurdi15 Aug 3, 2023
e1ffbc2
updated test sql script path
zurdi15 Aug 3, 2023
ebb9eb5
updated develop-setup
zurdi15 Aug 3, 2023
614f940
updated developer-setup
zurdi15 Aug 3, 2023
b2893d2
Always use download API to bypass SW cache
Aug 3, 2023
c0d7666
fixed npm version needed
zurdi15 Aug 3, 2023
31c9ad1
Merge pull request #316 from GAntoine/fix-297
zurdi15 Aug 3, 2023
436fe45
typo
zurdi15 Aug 3, 2023
36fb22d
Merge branch 'master' into backend-testing-refactor
Aug 3, 2023
d2c1f6c
Small tweaks from reivew
Aug 3, 2023
2800342
rever test migration autouse
zurdi15 Aug 3, 2023
8da195b
Merge pull request #310 from GAntoine/backend-testing-refactor
gantoine Aug 3, 2023
139cf9e
Improved scan logs
Aug 3, 2023
ebad5b5
Better error management in igdb handler
Aug 3, 2023
c1113c0
Fix rebinding socket events
Aug 3, 2023
6cbdfb4
More robust scanning + better output
Aug 3, 2023
a813403
Fix igdb tests
Aug 3, 2023
f0e85df
Add pytest for PRs
Aug 4, 2023
0801451
build romm workflow renamed
zurdi15 Aug 4, 2023
c884b86
build romm workflow renamed
zurdi15 Aug 4, 2023
5a984a3
Merge branch 'improved-scanning' of https://github.com/GAntoine/romm …
zurdi15 Aug 4, 2023
98fd3c1
Merge pull request #318 from GAntoine/improved-scanning
zurdi15 Aug 4, 2023
bd19156
readme fixed
zurdi15 Aug 4, 2023
a23a474
version upgraded to 1.9.2
zurdi15 Aug 4, 2023
0dff6f9
Fix scanning files not found in IGDB
Aug 4, 2023
0bfc19c
Revert force download through api
Aug 4, 2023
bcce180
Merge pull request #320 from zurdi15/hotfix-scanning-igdb-misses
zurdi15 Aug 4, 2023
5df170e
Update README.md
zurdi15 Aug 4, 2023
017f968
Run scan task async via redis + sockets
Aug 4, 2023
20bdb92
Parallel jobs
Aug 4, 2023
28c8129
Support worker in dokcer build
Aug 5, 2023
b13886c
Store twitck token in redis cache + switch back to single task
Aug 5, 2023
d7df979
Changes from self review
Aug 5, 2023
66c8039
bugfix
Aug 5, 2023
f3c950d
Add oytest cache to gitignore
Aug 5, 2023
539db06
Merge branch 'master' into redis-sockets
zurdi15 Aug 5, 2023
2ce1a92
Update platform rom counts after scan/delete
Aug 6, 2023
3660674
fied missing parameters with no IGDB roms
zurdi15 Aug 7, 2023
fe980e0
Merge pull request #326 from zurdi15/fix-325
zurdi15 Aug 7, 2023
a243cfd
Add a png version of the romm logo
Aug 7, 2023
7811c97
refactor delete rom dialog as component
zurdi15 Aug 7, 2023
bebc328
romm png updated
zurdi15 Aug 7, 2023
9f47ac3
Merge pull request #327 from zurdi15/romm-logo-png
zurdi15 Aug 7, 2023
6bbb973
Merge pull request #322 from zurdi15/redis-sockets
zurdi15 Aug 7, 2023
26f7aa4
css fixed and close on outside click added
zurdi15 Aug 7, 2023
5760bb1
edit rom dialog added
zurdi15 Aug 7, 2023
05c63c4
search rom dialog added
zurdi15 Aug 7, 2023
d734249
details adapted to dialog components
zurdi15 Aug 7, 2023
7a50fdd
refactor edit rom dialog code
zurdi15 Aug 7, 2023
ed408e8
fixed autosearch search dialog
zurdi15 Aug 7, 2023
aa9e347
Patch out redis when not running
Aug 8, 2023
774d023
Move sockets to utils
Aug 8, 2023
a5c207c
Changes from self review
Aug 8, 2023
e9ca29c
half-refactor of dialogs as components
zurdi15 Aug 8, 2023
c328966
complete refactor of dialogs as components
zurdi15 Aug 8, 2023
3310d39
added admin menu to list view
zurdi15 Aug 8, 2023
c57169d
removed unused code
zurdi15 Aug 8, 2023
2128eb2
add default cover to not cover games when searching with IGDB
zurdi15 Aug 8, 2023
ae2ce0f
tooltip added to matched roms
zurdi15 Aug 8, 2023
b9b6be0
quick actions buttons are now squared
zurdi15 Aug 8, 2023
6c43b32
Patch in ps2/opl support for game scanning
Aug 8, 2023
fd0c646
fixed cover and screenthos stored path
zurdi15 Aug 8, 2023
5791603
pylint tweaks
zurdi15 Aug 8, 2023
850d428
fixed cached token
zurdi15 Aug 8, 2023
f5c5473
Merge pull request #328 from zurdi15/redis-patch
zurdi15 Aug 8, 2023
5adb3aa
ps2 igdb id set as constant
zurdi15 Aug 8, 2023
3e97e9a
Merge branch 'master' into ps2-opl-support
Aug 8, 2023
d04c73b
more meaningul constants
zurdi15 Aug 8, 2023
c3a2975
Merge pull request #330 from zurdi15/ps2-opl-support
zurdi15 Aug 8, 2023
fb15cf8
Merge branch 'master' into feature-28-mini-admin-menu
zurdi15 Aug 8, 2023
9687f69
tests fixed
zurdi15 Aug 8, 2023
be72668
removed timestamp from cover path
zurdi15 Aug 8, 2023
1946bdf
get_cover tests fixed
zurdi15 Aug 8, 2023
051d5ea
reverted matched roms no cover
zurdi15 Aug 9, 2023
b534c24
edit and search update rom logic unified
zurdi15 Aug 9, 2023
00f4028
fixed tests
zurdi15 Aug 9, 2023
a9a08d2
extract admin menu as component
zurdi15 Aug 9, 2023
59d3362
added admin menu to list view
zurdi15 Aug 9, 2023
88ac2a7
introduce mypy with lib types + remove ignores + fix types
Aug 9, 2023
ad80f44
Revert change to basemodel config
Aug 9, 2023
baffda2
Fix user data used in path expression
Aug 9, 2023
f4176a1
Merge pull request #329 from zurdi15/feature-28-mini-admin-menu
zurdi15 Aug 9, 2023
783b3ab
small ui tweak to tooltips
zurdi15 Aug 9, 2023
de59c21
docker-compose example updated
zurdi15 Aug 9, 2023
c16da97
fixed white theme tooltip color
zurdi15 Aug 9, 2023
030767c
fixed black theme tooltip color
zurdi15 Aug 9, 2023
811d02d
reverted timestamp in cover request
zurdi15 Aug 9, 2023
ca1b7e7
addded rom version as file
zurdi15 Aug 9, 2023
ceb3f46
Hotfix running worker when redis disabled
Aug 9, 2023
360d5a3
init_worker disabled
zurdi15 Aug 9, 2023
731120b
added netcat to base image
zurdi15 Aug 9, 2023
2d6499a
Merge pull request #333 from zurdi15/redis-worker-hotfix
zurdi15 Aug 9, 2023
19b651a
Fix multi rom zipping + streaming
Aug 9, 2023
4b60782
unraid template added
zurdi15 Aug 9, 2023
5e1466c
added version placeholders
zurdi15 Aug 9, 2023
5d77038
get control panel version from package.json
zurdi15 Aug 9, 2023
ba10a48
added set version step to pytest workflow
zurdi15 Aug 9, 2023
5481df4
fixed build workflow version
zurdi15 Aug 9, 2023
e7621ee
romm_version placeholder added to package.lock
zurdi15 Aug 9, 2023
62e60fc
vscode development tasks/settings added to git track
zurdi15 Aug 9, 2023
6401fb0
disabled redis from developing docker-compose
zurdi15 Aug 9, 2023
71cf499
vscode tasks added
zurdi15 Aug 10, 2023
fd6b9a4
docker image local build script added
zurdi15 Aug 10, 2023
6b0438f
front version added to docker image build
zurdi15 Aug 10, 2023
826af4c
igdb autosearch by filename instead than r_name
zurdi15 Aug 10, 2023
39f7c08
Merge branch 'master' into fix-322
zurdi15 Aug 10, 2023
5062a9d
kick off the download when it starts for multi files
Aug 10, 2023
ad9f647
Use sockets to track download completion
Aug 10, 2023
c53fb56
ONly disconnect when store empty
Aug 10, 2023
b0869e7
Changes from self review
Aug 10, 2023
22dec93
Revert romm_version file
Aug 11, 2023
9afcc92
branch name added to build local image script
zurdi15 Aug 11, 2023
e006b33
fixed sql script testing setup
zurdi15 Aug 11, 2023
e244633
Merge pull request #335 from zurdi15/fix-322
zurdi15 Aug 11, 2023
3b4c8c1
Merge branch 'master' into revert-sed
Aug 12, 2023
6e13af8
Merge pull request #337 from zurdi15/revert-sed
zurdi15 Aug 12, 2023
55f78a8
romm community section added to readme
zurdi15 Aug 13, 2023
05f759c
Update README.md
zurdi15 Aug 13, 2023
5b28856
Merge pull request #339 from zurdi15/zurdi15-patch-1
zurdi15 Aug 13, 2023
767341a
.romm-version workflow reverted
zurdi15 Aug 13, 2023
e45a4a7
romm version upgraded to 1.10
zurdi15 Aug 13, 2023
282d147
dockerfile fixed
zurdi15 Aug 13, 2023
fb49f65
Hotfix downloading multi-files
Aug 14, 2023
fe7f553
Merge pull request #341 from zurdi15/hotfix-download-multifile
zurdi15 Aug 14, 2023
255e1cd
added changelog for v1.10
zurdi15 Aug 15, 2023
e977cdd
added redis support note to
zurdi15 Aug 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/tests/cassettes/*.yaml linguist-generated
File renamed without changes.
69 changes: 69 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: run pytest

on:
pull_request:
types:
- "opened"
- "synchronize"
paths-ignore:
- "docker/**"
- "examples/*"
- "frontend/**"
push:
branches:
- "master"
paths-ignore:
- "docker/**"
- "examples/*"
- "frontend/**"

jobs:
pytest:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
services:
mariadb:
image: mariadb:10.11
ports:
- 3306
env:
MYSQL_USER: romm_test
MYSQL_PASSWORD: passwd
MYSQL_DATABASE: romm_test
MYSQL_ROOT_PASSWORD: passwd
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install mariadb connectors
run: |
sudo apt-get update
sudo apt-get install -y libmariadb3 libmariadb-dev
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies
run: |
poetry install --sync
- name: Initiate database
run: |
mysql --host 127.0.0.1 --port ${{ job.services.mariadb.ports['3306'] }} -uroot -ppasswd -e "GRANT ALL PRIVILEGES ON romm_test.* TO 'romm_test'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;"
- name: Run python tests
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mariadb.ports['3306'] }}
run: |
cd backend
poetry run pytest -vv --maxfail=10 --junitxml=pytest-report.xml .
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
files: |
backend/pytest-report.xml
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ coverage
# Editor directories and files
.vscode
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/tasks.json
.idea
*.suo
*.ntvs*
Expand All @@ -42,3 +44,11 @@ romm_mock

# virtualenv
.venv

# testing
backend/romm_test/resources
backend/romm_test/logs
.pytest_cache

# service worker
frontend/dev-dist
52 changes: 52 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"path": "frontend",
"problemMatcher": [],
"label": "Launch frontend [npm]"
},
{
"type": "shell",
"command": "source ~/.cache/pypoetry/virtualenvs/romm-TjwgbYlf-py3.11/bin/activate; cd backend; python main.py",
"label": "Launch backend [python]",
"problemMatcher": []
},
{
"type": "shell",
"command": "source ~/.cache/pypoetry/virtualenvs/romm-TjwgbYlf-py3.11/bin/activate; cd backend; pytest -v",
"label": "Execute tests [pytest]",
"problemMatcher": []
},
{
"type": "shell",
"command": "./docker/build_local_image.sh",
"label": "Build docker local image [docker]",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"command": "docker compose up -d",
"label": "Setup development environment [docker] (1)",
"problemMatcher": []
},
{
"type": "shell",
"command": "export $(cat .env | xargs); docker exec -i mariadb mariadb -u root -p$DB_ROOT_PASSWD < backend/romm_test/setup.sql",
"label": "Setup development environment migrations [docker] (2)",
"problemMatcher": []
},
{
"type": "shell",
"command": "cd romm_mock; docker compose up -d",
"label": "Setup testing environment [docker]",
"problemMatcher": []
}
]
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# v1.10 (_xx-08-2023_)

## Added
- Rom admin menu added to roms in gallery. Closes [#28](https://github.com/zurdi15/romm/issues/28)
- Added ps2/opl naming convention support for roms scanning. Closes [#324](https://github.com/zurdi15/romm/issues/324)

## Fixed
- Fixed an error caused by the service worker that sometimes intercepts download requests and returns a bad response. Fixes [#297](https://github.com/zurdi15/romm/issues/297)
- Fixed rom count in platform selector when deleting/scanning roms. Fixes [#325](https://github.com/zurdi15/romm/issues/325)

## Changed
- Improved scanning and IGDB requests logs. Fixes [#317](https://github.com/zurdi15/romm/issues/317)
- Improved downloading process. Fixes [#332](https://github.com/zurdi15/romm/issues/332)

<br>

# v1.9.1 (_01-08-2023_)

## Added
Expand Down
54 changes: 42 additions & 12 deletions DEVELOPER-SETUP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## Create the mock structure with at least one rom
# Environment setup

## Mocking RomM structure

### - Create the mock structure with at least one rom and empty config for manual testing

```sh
mkdir -p romm_mock/library/roms/switch
Expand All @@ -9,13 +13,13 @@ touch romm_mock/config.yml

## Setting up the backend

### Copy env.template to .env and fill the variables
### - Copy env.template to .env and fill the variables

```sh
cp env.template .env
```

### Install python dependencies
### - Install python dependencies

You'll need poetry installed

Expand All @@ -26,47 +30,73 @@ Then initialize the virtual environment and install the dependencies
```sh
poetry shell
# Fix disable parallel installation stuck: $> poetry config experimental.new-installer false
# Fix Loading macOS stuck: $> export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
# Fix Loading macOS/linux stuck: $> export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
# Fix mariadb install on linux: $> sudo apt install libmariadb3 libmariadb-dev
# Fix mariadb connector/c >= 3.3.1: https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/c/install/#Installation_via_Package_Repository_(Linux)
poetry install
```

### Spin up mariadb in docker
### - Spin up mariadb in docker

```sh
docker-compose up -d
```

### Run the migrations
### - Run the backend

*__*Migrations will be run automatically when running the backend.__*

```sh
cd backend
alembic upgrade head
python main.py
```

## And finally run the backend

### - Start a worker

```sh
python main.py
cd backend
python worker.py
```

## Setting up the frontend

### Install node.js dependencies
### - Install node.js dependencies

```sh
cd frontend
# npm version >= 9 needed
npm install
```

### Create symlink to library and resources
### - Create symlink to library and resources
```sh
mkdir assets/romm
ln -s ../../../romm_mock/library assets/romm/library
ln -s ../../../romm_mock/resources assets/romm/resources
```

### Run the frontend
### - Run the frontend

```sh
npm run dev
```

# Test setup

### - Create the test user and database with root user

```sh
docker exec -i mariadb mysql -u root -p<root password> < backend/romm_test/setup.sql # for amd images
docker exec -i mariadb mariadb -u root -p<root password> < backend/romm_test/setup.sql # for arm images
```

### - Run tests

*__*Migrations will be run automatically when running the tests.__*

```sh
cd backend
# path or test file can be passed as argument to test only a subset
pytest [path/file]
```
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1 style="padding:20px;"><img src="romm.svg" height="220px" width="auto" alt="RomM Logo"></h1>
<img alt="GitHub" src="https://img.shields.io/github/license/zurdi15/romm?style=flat-square">
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/zurdi15/romm?style=flat-square">
<img alt="GitHub Workflow Status (with branch)" src="https://img.shields.io/github/actions/workflow/status/zurdi15/romm/image.yml?style=flat-square&branch=master">
<img alt="GitHub Workflow Status (with branch)" src="https://img.shields.io/github/actions/workflow/status/zurdi15/romm/build.yml?style=flat-square&branch=master">
<br>
<a href="https://hub.docker.com/r/zurdi15/romm">
<img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/zurdi15/romm?style=flat-square">
Expand Down Expand Up @@ -67,6 +67,10 @@ Inspired by [Jellyfin](https://jellyfin.org/), allows you to manage all your gam
</details>
<br>

# The RomM community
[Wiki](https://github.com/zurdi15/romm/wiki) <br/>
[Discord](https://discord.gg/P5HtHnhUDH)<br/>

# Installation

## 🐳 Docker
Expand Down Expand Up @@ -149,7 +153,7 @@ Check the [docker-compose.yml](https://github.com/zurdi15/romm/blob/master/examp
<h2 id="platform-support">🎮 Platform support</h2>

If the RomM [folder structure](#📁-folder-structure) is followed, any kind of platform/folder-name is supported for the core features. For having extra metadata as well as cover images and platforms icons, the following table shows how to name your platforms folders.
This will change over the time, adding games metadata for more platforms. Make sure that the platforms folder names are lowercase.
This will change over the time, adding games metadata for more platforms.

<br>
<details>
Expand Down
6 changes: 2 additions & 4 deletions backend/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from config.config_loader import ConfigLoader
from alembic import context
from models.base import BaseModel

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
Expand All @@ -13,14 +14,11 @@
# Interpret the config file for Python logging.
# This line sets up loggers basically.
if config.config_file_name is not None:
fileConfig(config.config_file_name)
fileConfig(config.config_file_name, disable_existing_loggers=False)

# add your model's MetaData object here
# for 'autogenerate' support
sys.path.append(f"{Path(__file__).parent.parent.resolve()}")
from models.base import BaseModel
from models.platform import Platform
from models.rom import Rom

target_metadata = BaseModel.metadata

Expand Down
Loading