Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
969833f
Update .pre-commit-config.yaml
michplunkett Mar 3, 2025
8acefb0
Non-web formatting
michplunkett Mar 3, 2025
2d67478
Formatting
michplunkett Mar 3, 2025
23c91f6
Update crud.py
michplunkett Mar 3, 2025
0e0b431
Update crud.py
michplunkett Mar 3, 2025
0772243
Update interoperability.py
michplunkett Mar 3, 2025
6fc99d7
Update interoperability.py
michplunkett Mar 3, 2025
3f33736
Use HTTPStatus constants
michplunkett Mar 3, 2025
d4b69da
Update default.py
michplunkett Mar 3, 2025
5ac7442
Mas
michplunkett Mar 3, 2025
31ac597
Update default.py
michplunkett Mar 3, 2025
567e3b0
Update default.py
michplunkett Mar 3, 2025
b33d251
Oi
michplunkett Mar 3, 2025
f3a0081
Update sheet.py
michplunkett Mar 3, 2025
b8be4b3
Update models.py
michplunkett Mar 3, 2025
fc85f79
Update sheet.py
michplunkett Mar 3, 2025
a7b2f6f
Update sheet.py
michplunkett Mar 3, 2025
1a95121
Update sheet.py
michplunkett Mar 3, 2025
828fe40
Update interoperability.py
michplunkett Mar 3, 2025
4c89e39
Update pyproject.toml
michplunkett Mar 3, 2025
c497a3a
oi
michplunkett Mar 3, 2025
830ffed
Change settings back
michplunkett Mar 3, 2025
e31bcca
Update user_state.py
michplunkett Mar 7, 2025
58027e3
Update crud.py
michplunkett Mar 7, 2025
88c38a2
Update user_state.py
michplunkett Mar 7, 2025
c7a0f62
Doin' the thing
michplunkett Mar 7, 2025
cb9ad43
Update sheet.py
michplunkett Mar 8, 2025
8b3140d
Update url.py
michplunkett Mar 8, 2025
a77f25a
Update user_state.py
michplunkett Mar 8, 2025
cbc61c2
Update user_state.py
michplunkett Mar 8, 2025
6b2b1a8
Update misc.py
michplunkett Mar 8, 2025
4473374
Update security.py
michplunkett Mar 8, 2025
415a9b1
Update misc.py
michplunkett Mar 8, 2025
c8ef2bb
Update url.py
michplunkett Mar 10, 2025
4af4e04
Schema objects
michplunkett Mar 10, 2025
9a61d78
Update default.py
michplunkett Mar 10, 2025
453d932
Update default.py
michplunkett Mar 10, 2025
7b69765
Update schemas.py
michplunkett Mar 10, 2025
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
30 changes: 15 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ repos:
- --profile=black
- --line-length=80

# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.9.7
# hooks:
# - id: ruff
# types_or: [python,pyi]
# args:
# - --fix
# - --select=B,C,E,F,W,B9
# - --line-length=80
# - --ignore=E203,E402,E501,E261
# - id: ruff-format
# types_or: [ python,pyi]
# args:
# - --target-version=py310
# - --line-length=80
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.7
hooks:
- id: ruff
types_or: [python,pyi]
args:
- --fix
- --select=B,C,E,F,W,B9
- --line-length=80
- --ignore=E203,E402,E501,E261
- id: ruff-format
types_or: [ python,pyi]
args:
- --target-version=py310
- --line-length=80
4 changes: 1 addition & 3 deletions app/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
# This line sets up loggers basically.
if config.config_file_name is not None:
# disable_existing_loggers prevents loguru disabling
fileConfig(
config.config_file_name, disable_existing_loggers=False
)
fileConfig(config.config_file_name, disable_existing_loggers=False)

# add your model's MetaData object here
# for 'autogenerate' support
Expand Down
2 changes: 1 addition & 1 deletion app/shared/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_uuid():
return str(uuid.uuid4())


# many to many association tables
# many-to-many association tables
association_table_archive_tags = Table(
"mtm_archives_tags",
Base.metadata,
Expand Down
24 changes: 12 additions & 12 deletions app/tests/shared/db/test_worker_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ def test_update_sheet_last_url_archived_at(db_session):
assert isinstance(test_sheet.last_url_archived_at, datetime)
before = test_sheet.last_url_archived_at
assert (
worker_crud.update_sheet_last_url_archived_at(db_session, "sheet-123")
is True
worker_crud.update_sheet_last_url_archived_at(db_session, "sheet-123")
is True
)
db_session.refresh(test_sheet)
assert isinstance(test_sheet.last_url_archived_at, datetime)
assert test_sheet.last_url_archived_at > before

# Test non-existent sheet
assert (
worker_crud.update_sheet_last_url_archived_at(
db_session, "non-existent-sheet"
)
is False
worker_crud.update_sheet_last_url_archived_at(
db_session, "non-existent-sheet"
)
is False
)


Expand All @@ -42,14 +42,14 @@ def test_create_or_get_user(test_data, db_session):

# already exists
assert (
u1 := worker_crud.create_or_get_user(db_session, "rick@example.com")
) is not None
u1 := worker_crud.create_or_get_user(db_session, "rick@example.com")
) is not None
assert u1.email == "rick@example.com"

# new user
assert (
u2 := worker_crud.create_or_get_user(db_session, "beth@example.com")
) is not None
u2 := worker_crud.create_or_get_user(db_session, "beth@example.com")
) is not None
assert u2.email == "beth@example.com"

assert db_session.query(models.User).count() == 4
Expand All @@ -64,8 +64,8 @@ def test_create_tag(db_session):
assert create_tag.id == "tag-101"
assert db_session.query(models.Tag).count() == 1
assert (
db_session.query(models.Tag).filter(models.Tag.id == "tag-101").first()
== create_tag
db_session.query(models.Tag).filter(models.Tag.id == "tag-101").first()
== create_tag
)

# same id does not add new db entry
Expand Down
6 changes: 5 additions & 1 deletion app/tests/web/db/test_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,11 @@ async def test_find_by_store_until(async_db_session):

@pytest.mark.asyncio
async def test_get_sheets_by_id_hash(async_db_session):
author_emails = ["rick@example.com", "morty@example.com", "jerry@example.com"]
author_emails = [
"rick@example.com",
"morty@example.com",
"jerry@example.com",
]

# Add test data
sheets = [
Expand Down
2 changes: 1 addition & 1 deletion app/tests/web/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
from fastapi.testclient import TestClient

from app.web.main import app_factory
from app.web.utils.metrics import EXCEPTION_COUNTER


Expand Down Expand Up @@ -59,7 +60,6 @@ def test_serve_local_archive_logic(get_settings):
try:
# modify the settings
get_settings.SERVE_LOCAL_ARCHIVE = "/app/local_archive_test"
from app.web.main import app_factory

app = app_factory(get_settings)

Expand Down
5 changes: 4 additions & 1 deletion app/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
- You can use this API to archive single URLs or entire Google Sheets.
- Once you submit a URL or Sheet for archiving, the API will return a task_id that you can use to check the status of the archiving process. It works asynchronously.
"""
BREAKING_CHANGES = {"minVersion": "0.4.0", "message": "The latest update has breaking changes, please update the extension to the most recent version."}
BREAKING_CHANGES = {
"minVersion": "0.4.0",
"message": "The latest update has breaking changes, please update the extension to the most recent version.",
}

# changing this will corrupt the database logic
ALLOW_ANY_EMAIL = "*"
Loading