-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address feedback from spec review: ooni/spec#292
* Add support for expiration date * Compute is_expired from expiration date at eval time * Add support for color * Drop creator_account_id from return value * Drop v string * Small bugfixing * Add alembic db migration * Fix tests and some bugs related to expiration time * Add more tests for expiration * Add more tests for OONI Run v2 * Reach 100% code coverage * Bump minor version number * Interpolate the OONI_PG_PASSWORD * Convert OONI Run link ID column to string * Handle the _intl fields being set to None * Bump API version to 0.4.1 * Add tests for filtering by only_latest * Add click to dev deps * Fix types of oonirun_link_id * Add a smoketest for oonirun v2 * Add a smoketest stage before pushing the docker tags * Rename test_new_api to test_legacy_ooniapi * Move mypy tests into test_legacy_ooniapi * Run alembic migration before starting pg host * bump dataapi version
- Loading branch information
Showing
16 changed files
with
768 additions
and
338 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
pull_request: | ||
branches: | ||
- "*" | ||
workflow_call: | ||
jobs: | ||
run_tests: | ||
runs-on: ubuntu-latest | ||
|
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
37 changes: 37 additions & 0 deletions
37
api/fastapi/oonidataapi/alembic/versions/7d5841cb9549_make_oonirun_link_id_a_string.py
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,37 @@ | ||
"""make oonirun link id a string | ||
Revision ID: 7d5841cb9549 | ||
Revises: 836b3451a168 | ||
Create Date: 2024-02-28 15:41:53.811746 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "7d5841cb9549" | ||
down_revision: Union[str, None] = "836b3451a168" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
""" | ||
ALTER TABLE oonirun | ||
ALTER COLUMN oonirun_link_id TYPE TEXT USING oonirun_link_id::TEXT | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.execute( | ||
""" | ||
ALTER TABLE oonirun | ||
ALTER COLUMN oonirun TYPE INTEGER USING oonirun::INTEGER | ||
""" | ||
) |
32 changes: 32 additions & 0 deletions
32
...tapi/oonidataapi/alembic/versions/836b3451a168_add_expiration_date_color_columns_drop_.py
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,32 @@ | ||
"""Add expiration_date, color columns. Drop is_archived column. | ||
Revision ID: 836b3451a168 | ||
Revises: f96cf47f2791 | ||
Create Date: 2024-02-27 09:44:26.833238 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "836b3451a168" | ||
down_revision: Union[str, None] = "f96cf47f2791" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column( | ||
"oonirun", sa.Column("expiration_date", sa.DateTime(), nullable=False) | ||
) | ||
op.add_column("oonirun", sa.Column("color", sa.String(), nullable=True)) | ||
op.drop_column("oonirun", "is_archived") | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("oonirun", "expiration_date") | ||
op.drop_column("oonirun", "color") |
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.