-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1140 from rommapp/master
v3.5.0
- Loading branch information
Showing
164 changed files
with
4,306 additions
and
1,606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
buy_me_a_coffee: zurdi15 | ||
open_collective: romm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11 | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,53 +2,73 @@ | |
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml | ||
version: 0.1 | ||
cli: | ||
version: 1.22.2 | ||
version: 1.22.3 | ||
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) | ||
plugins: | ||
sources: | ||
- id: trunk | ||
ref: v1.6.0 | ||
ref: v1.6.1 | ||
uri: https://github.com/trunk-io/plugins | ||
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) | ||
runtimes: | ||
enabled: | ||
- [email protected] | ||
- [email protected] | ||
- python@3.11.6 | ||
- python@3.12.2 | ||
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) | ||
lint: | ||
enabled: | ||
- [email protected] | ||
- eslint@9.6.0 | ||
- eslint@9.9.0 | ||
- [email protected] | ||
- [email protected] | ||
- black@24.4.2 | ||
- [email protected].178 | ||
- black@24.8.0 | ||
- [email protected].228 | ||
- git-diff-check | ||
- [email protected] | ||
- mypy@1.10.1 | ||
- [email protected].1 | ||
- [email protected].1 | ||
- [email protected].2 | ||
- ruff@0.5.1 | ||
- mypy@1.11.1 | ||
- [email protected].3 | ||
- [email protected].2 | ||
- [email protected].3 | ||
- ruff@0.6.0 | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- taplo@0.8.1 | ||
- trivy@0.52.2 | ||
- trufflehog@3.79.0 | ||
- taplo@0.9.3 | ||
- trivy@0.54.1 | ||
- trufflehog@3.81.9 | ||
- [email protected] | ||
ignore: | ||
- linters: [ALL] | ||
paths: | ||
- frontend/src/__generated__/** | ||
- docker/Dockerfile | ||
- docker/nginx/js/** | ||
files: | ||
- name: vue | ||
extensions: [vue] | ||
definitions: | ||
- name: eslint | ||
files: [typescript, javascript] | ||
files: | ||
- javascript | ||
- typescript | ||
commands: | ||
- name: lint | ||
run_from: ${root_or_parent_with_any_config} | ||
- name: prettier | ||
files: | ||
- typescript | ||
- yaml | ||
- css | ||
- postcss | ||
- sass | ||
- html | ||
- markdown | ||
- json | ||
- javascript | ||
- graphql | ||
- vue | ||
- prettier_supported_configs | ||
actions: | ||
disabled: | ||
- trunk-check-pre-push | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"languages": { | ||
"Python": { | ||
"tab_size": 4 | ||
}, | ||
"Vue.js": { | ||
"tab_size": 2, | ||
"formatter": { | ||
"external": { | ||
"command": "prettier", | ||
"arguments": ["--stdin-filepath", "{buffer_path}"] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
"""empty message | ||
Revision ID: 0024_sibling_roms_db_view | ||
Revises: 0023_make_columns_non_nullable | ||
Create Date: 2024-08-08 12:00:00.000000 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0024_sibling_roms_db_view" | ||
down_revision = "0023_make_columns_non_nullable" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.create_index("idx_roms_igdb_id", ["igdb_id"]) | ||
batch_op.create_index("idx_roms_moby_id", ["moby_id"]) | ||
|
||
connection = op.get_bind() | ||
|
||
connection.execute( | ||
sa.text( | ||
""" | ||
CREATE VIEW sibling_roms AS | ||
SELECT | ||
r1.id AS rom_id, | ||
r2.id AS sibling_rom_id, | ||
r1.platform_id AS platform_id, | ||
NOW() AS created_at, | ||
NOW() AS updated_at, | ||
CASE WHEN r1.igdb_id <=> r2.igdb_id THEN r1.igdb_id END AS igdb_id, | ||
CASE WHEN r1.moby_id <=> r2.moby_id THEN r1.moby_id END AS moby_id | ||
FROM | ||
roms r1 | ||
JOIN | ||
roms r2 | ||
ON | ||
r1.platform_id = r2.platform_id | ||
AND r1.id != r2.id | ||
AND ( | ||
(r1.igdb_id = r2.igdb_id AND r1.igdb_id IS NOT NULL AND r1.igdb_id != '') | ||
OR | ||
(r1.moby_id = r2.moby_id AND r1.moby_id IS NOT NULL AND r1.moby_id != '') | ||
); | ||
""" | ||
), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
connection = op.get_bind() | ||
|
||
connection.execute( | ||
sa.text( | ||
""" | ||
DROP VIEW sibling_roms; | ||
""" | ||
), | ||
) | ||
|
||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.drop_index("idx_roms_igdb_id") | ||
batch_op.drop_index("idx_roms_moby_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"""empty message | ||
Revision ID: 0025_roms_hashes | ||
Revises: 0024_sibling_roms_db_view | ||
Create Date: 2024-08-11 21:50:53.301352 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
from config import IS_PYTEST_RUN, SCAN_TIMEOUT | ||
from endpoints.sockets.scan import scan_platforms | ||
from handler.redis_handler import high_prio_queue | ||
from handler.scan_handler import ScanType | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0025_roms_hashes" | ||
down_revision = "0024_sibling_roms_db_view" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("crc_hash", sa.String(length=100), nullable=True)) | ||
batch_op.add_column(sa.Column("md5_hash", sa.String(length=100), nullable=True)) | ||
batch_op.add_column( | ||
sa.Column("sha1_hash", sa.String(length=100), nullable=True) | ||
) | ||
|
||
# Run a no-scan in the background on migrate | ||
if not IS_PYTEST_RUN: | ||
high_prio_queue.enqueue( | ||
scan_platforms, [], ScanType.QUICK, [], [], job_timeout=SCAN_TIMEOUT | ||
) | ||
|
||
high_prio_queue.enqueue( | ||
scan_platforms, [], ScanType.HASHES, [], [], job_timeout=SCAN_TIMEOUT | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.batch_alter_table("roms", schema=None) as batch_op: | ||
batch_op.drop_column("sha1_hash") | ||
batch_op.drop_column("md5_hash") | ||
batch_op.drop_column("crc_hash") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.