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

Software Data #36

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
4f1b9a1
Use Enums
RickiJay-WMDE Oct 7, 2024
1567a9c
str
RickiJay-WMDE Oct 7, 2024
2591801
Optional, Variables
RickiJay-WMDE Oct 7, 2024
794753c
Add
RickiJay-WMDE Oct 7, 2024
4faa737
Add Wikibase
RickiJay-WMDE Oct 7, 2024
787de36
Pass Tests
RickiJay-WMDE Oct 8, 2024
1471021
Remove Data
RickiJay-WMDE Oct 8, 2024
5562b8c
Format
RickiJay-WMDE Oct 8, 2024
b95e901
Fixes
RickiJay-WMDE Oct 8, 2024
011fffb
Alphabetize
RickiJay-WMDE Oct 8, 2024
eb03c80
Who Could Ask For Anything More
RickiJay-WMDE Oct 8, 2024
daf5669
Typo
RickiJay-WMDE Oct 8, 2024
a87e25b
Test Add
RickiJay-WMDE Oct 8, 2024
c994bbc
Dependencies
RickiJay-WMDE Oct 8, 2024
0f1fe80
String
RickiJay-WMDE Oct 8, 2024
70eb484
Marker
RickiJay-WMDE Oct 10, 2024
aa47dd0
Return Type
RickiJay-WMDE Oct 10, 2024
885aa60
Greenlet Error
RickiJay-WMDE Oct 15, 2024
c438bfe
Updates
RickiJay-WMDE Oct 16, 2024
a553888
Software Model
RickiJay-WMDE Oct 16, 2024
c1ba875
Foreign
RickiJay-WMDE Oct 16, 2024
d4b81fb
Alembic
RickiJay-WMDE Oct 16, 2024
5e3b470
Simplify
RickiJay-WMDE Oct 16, 2024
184f158
Add Software in Observations
RickiJay-WMDE Oct 16, 2024
6155076
Populate
RickiJay-WMDE Oct 16, 2024
aef63f0
Mandatory
RickiJay-WMDE Oct 16, 2024
ed98930
Remove Redundancies
RickiJay-WMDE Oct 16, 2024
e99277b
Fix Tests
RickiJay-WMDE Oct 17, 2024
5bf47bc
software expectations
RickiJay-WMDE Oct 17, 2024
4999542
Format
RickiJay-WMDE Oct 17, 2024
eb9af52
Typo
RickiJay-WMDE Oct 17, 2024
0d200dc
Tag
RickiJay-WMDE Oct 17, 2024
deb6035
Bug
RickiJay-WMDE Oct 17, 2024
5df7f9c
Format
RickiJay-WMDE Oct 17, 2024
f59cb52
XRef Expectations
RickiJay-WMDE Oct 17, 2024
677d963
Moved
RickiJay-WMDE Oct 17, 2024
26aed28
Format
RickiJay-WMDE Oct 17, 2024
0bc55ee
Fetched
RickiJay-WMDE Oct 17, 2024
ca8bdbb
Update Software Data
RickiJay-WMDE Oct 17, 2024
307dee3
Model Updates
RickiJay-WMDE Oct 18, 2024
525f519
Expectation
RickiJay-WMDE Oct 18, 2024
4a715d4
Pulls and Updates
RickiJay-WMDE Oct 18, 2024
f42eea1
Lint
RickiJay-WMDE Oct 18, 2024
d459bbe
Recursion
RickiJay-WMDE Oct 18, 2024
ef1ce0a
Data
RickiJay-WMDE Oct 18, 2024
2c170c1
Tests
RickiJay-WMDE Oct 20, 2024
93f040a
Black
RickiJay-WMDE Oct 20, 2024
1563334
Lint
RickiJay-WMDE Oct 20, 2024
ab1ec4e
Data Checks
RickiJay-WMDE Oct 20, 2024
095e3e5
MockInfo
RickiJay-WMDE Oct 24, 2024
7eb95f3
MockInfo
RickiJay-WMDE Oct 24, 2024
0016a20
Lint
RickiJay-WMDE Oct 24, 2024
162f6df
Imports
RickiJay-WMDE Oct 24, 2024
0c42126
Prelim
RickiJay-WMDE Oct 24, 2024
c40a5b2
Mock Response Updates
RickiJay-WMDE Oct 24, 2024
c8d97d0
Test Pull
RickiJay-WMDE Oct 24, 2024
746129c
Name
RickiJay-WMDE Oct 24, 2024
0f66a4d
Specify
RickiJay-WMDE Oct 24, 2024
56a00dc
Reformat
RickiJay-WMDE Oct 24, 2024
e24b248
Mark Soup
RickiJay-WMDE Oct 24, 2024
643ffc5
Constants
RickiJay-WMDE Oct 25, 2024
bb0604a
Missing
RickiJay-WMDE Oct 25, 2024
4ab5060
feat: Input Wikibase (#34)
RickiJay-WMDE Oct 30, 2024
9949fcf
merge origin/main into software-data
RickiJay-WMDE Oct 30, 2024
26e8bf9
Test DB Updates
RickiJay-WMDE Oct 30, 2024
df0e672
Create Tables
RickiJay-WMDE Oct 30, 2024
87a1759
Scripts
RickiJay-WMDE Oct 30, 2024
0ed6725
Updates
RickiJay-WMDE Oct 30, 2024
3057f24
Prelim Data
RickiJay-WMDE Oct 30, 2024
fa0adf7
Format
RickiJay-WMDE Oct 30, 2024
d360bd0
Extension List
RickiJay-WMDE Oct 30, 2024
aac0e94
Reuse
RickiJay-WMDE Oct 30, 2024
792931f
fix: GX-1.2 (#37)
RickiJay-WMDE Oct 30, 2024
96bb197
Updates
RickiJay-WMDE Oct 30, 2024
bb0d916
First Test
RickiJay-WMDE Nov 4, 2024
94dcf59
Use
RickiJay-WMDE Nov 4, 2024
79e72b8
Start List
RickiJay-WMDE Nov 4, 2024
ec19da5
Clean Strings
RickiJay-WMDE Nov 4, 2024
6950190
Freeze Your Time
RickiJay-WMDE Nov 4, 2024
cf4c313
Sometimes you have to test everything, everything
RickiJay-WMDE Nov 4, 2024
8528ec7
Format
RickiJay-WMDE Nov 4, 2024
e3c13bd
Coerce
RickiJay-WMDE Nov 4, 2024
92f38dc
Excess Whitespace Check
RickiJay-WMDE Nov 4, 2024
7fa76b0
Avoid regex-replace
RickiJay-WMDE Nov 4, 2024
ba0ce25
Split
RickiJay-WMDE Nov 4, 2024
6b82679
Legibility
RickiJay-WMDE Nov 4, 2024
ac5da00
Miraheze Magic
RickiJay-WMDE Nov 5, 2024
0f52d0f
Correct
RickiJay-WMDE Nov 5, 2024
4df4420
Correction
RickiJay-WMDE Nov 5, 2024
68c5867
Format
RickiJay-WMDE Nov 5, 2024
df6363f
Update Tests
RickiJay-WMDE Nov 5, 2024
133ba96
Coverage
RickiJay-WMDE Nov 5, 2024
b60a8e7
Expectations
RickiJay-WMDE Nov 5, 2024
f532543
Format
RickiJay-WMDE Nov 5, 2024
3b469ed
Mostly
RickiJay-WMDE Nov 5, 2024
ff11550
Repull
RickiJay-WMDE Nov 5, 2024
f29a3bd
Manual merging
RickiJay-WMDE Nov 5, 2024
06e29e0
Errant
RickiJay-WMDE Nov 5, 2024
f00c2af
Manual Merging II
RickiJay-WMDE Nov 7, 2024
ef9aa37
chore: Lint Cleanup (#39)
RickiJay-WMDE Nov 12, 2024
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
8 changes: 0 additions & 8 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -25,8 +23,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -40,8 +36,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -55,8 +49,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
107 changes: 107 additions & 0 deletions alembic/versions/0833cb54870f_software_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
"""Software Model

Revision ID: 0833cb54870f
Revises: e3ecd40e3851
Create Date: 2024-10-16 23:03:09.901779

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "0833cb54870f"
down_revision: Union[str, None] = "e3ecd40e3851"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"wikibase_software",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column(
"software_type",
sa.Enum(
"SOFTWARE", "SKIN", "EXTENSION", "LIBRARY", name="wikibasesoftwaretype"
),
nullable=False,
),
sa.Column("software_name", sa.String(), nullable=False),
sa.Column("url", sa.String(), nullable=True),
sa.Column("description", sa.String(), nullable=True),
sa.Column("latest_version", sa.String(), nullable=True),
sa.Column("quarterly_download_count", sa.Integer(), nullable=True),
sa.Column("public_wiki_count", sa.Integer(), nullable=True),
sa.Column("mw_bundled", sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint(
"software_type", "software_name", name="unique_software_type_name"
),
)

op.create_table(
"wikibase_software_tag",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("tag", sa.String(), nullable=False),
sa.PrimaryKeyConstraint("id"),
)

op.create_table(
"wikibase_software_tag_xref",
sa.Column("wikibase_software_id", sa.Integer(), nullable=False),
sa.Column("wikibase_software_tag_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["wikibase_software_id"],
["wikibase_software.id"],
name="foreign_wikibase_software_id",
),
sa.ForeignKeyConstraint(
["wikibase_software_tag_id"],
["wikibase_software_tag.id"],
name="foreign_wikibase_software_tag_id",
),
sa.PrimaryKeyConstraint("wikibase_software_id", "wikibase_software_tag_id"),
)

with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.add_column(
sa.Column("wikibase_software_id", sa.Integer(), nullable=True)
)
batch_op.create_foreign_key(
"software", "wikibase_software", ["wikibase_software_id"], ["id"]
)
with op.get_bind() as conn:
conn.execute(
sa.text(
"""INSERT INTO wikibase_software (software_type, software_name)
SELECT DISTINCT software_type, software_name
FROM wikibase_software_version
ORDER BY software_type, software_name"""
)
)
conn.execute(
sa.text(
"""UPDATE wikibase_software_version
SET wikibase_software_id = wikibase_software.id
FROM wikibase_software
WHERE wikibase_software_version.software_name = wikibase_software.software_name AND wikibase_software_version.software_type = wikibase_software.software_type"""
)
)
conn.commit()
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.drop_constraint("software", type_="foreignkey")
batch_op.drop_column("wikibase_software_id")
op.drop_table("wikibase_software_tag_xref")
op.drop_table("wikibase_software_tag")
op.drop_table("wikibase_software")
# ### end Alembic commands ###
34 changes: 34 additions & 0 deletions alembic/versions/3b5538b2faec_fetched.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Fetched

Revision ID: 3b5538b2faec
Revises: 7fd538ca8735
Create Date: 2024-10-17 12:36:32.239393

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "3b5538b2faec"
down_revision: Union[str, None] = "7fd538ca8735"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"wikibase_software",
sa.Column("fetched", sa.DateTime(timezone=True), nullable=True),
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("wikibase_software", "fetched")
# ### end Alembic commands ###
53 changes: 53 additions & 0 deletions alembic/versions/7fd538ca8735_no_name_or_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""No Name or Type

Revision ID: 7fd538ca8735
Revises: bf635fa3a7ce
Create Date: 2024-10-17 00:13:58.311963

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "7fd538ca8735"
down_revision: Union[str, None] = "bf635fa3a7ce"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.drop_constraint(
"unique_observation_software_type_name", type_="unique"
)
batch_op.create_unique_constraint(
"unique_observation_software_id",
["wikibase_software_version_observation_id", "wikibase_software_id"],
)
batch_op.drop_column("software_type")
batch_op.drop_column("software_name")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.add_column(sa.Column("software_name", sa.VARCHAR(), nullable=False))
batch_op.add_column(
sa.Column("software_type", sa.VARCHAR(length=9), nullable=False)
)
batch_op.drop_constraint("unique_observation_software_id", type_="unique")
batch_op.create_unique_constraint(
"unique_observation_software_type_name",
[
"wikibase_software_version_observation_id",
"software_type",
"software_name",
],
)
# ### end Alembic commands ###
37 changes: 37 additions & 0 deletions alembic/versions/bf635fa3a7ce_mandatory_software_relationship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Mandatory Software Relationship

Revision ID: bf635fa3a7ce
Revises: 0833cb54870f
Create Date: 2024-10-16 23:57:48.573469

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "bf635fa3a7ce"
down_revision: Union[str, None] = "0833cb54870f"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.alter_column(
"wikibase_software_id", existing_type=sa.INTEGER(), nullable=False
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_version") as batch_op:
batch_op.alter_column(
"wikibase_software_id", existing_type=sa.INTEGER(), nullable=True
)
# ### end Alembic commands ###
37 changes: 37 additions & 0 deletions alembic/versions/ced691eaf66e_archived.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Archived

Revision ID: ced691eaf66e
Revises: 3b5538b2faec
Create Date: 2024-10-17 16:19:32.355862

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "ced691eaf66e"
down_revision: Union[str, None] = "3b5538b2faec"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software") as batch_op:
batch_op.add_column(sa.Column("archived", sa.Boolean(), nullable=True))
with op.batch_alter_table("wikibase_software_tag") as batch_op:
batch_op.create_unique_constraint("unique_tag", ["tag"])
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("wikibase_software_tag") as batch_op:
batch_op.drop_constraint("unique_tag", type_="unique")
with op.batch_alter_table("wikibase_software") as batch_op:
batch_op.drop_column("archived")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion data/database_connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Database Connection"""

from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from typing import AsyncGenerator

from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
Expand Down
30 changes: 30 additions & 0 deletions data/gx/checkpoints/wikibase_software_checkpoint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"actions": [
{
"name": "update_all_data_docs",
"site_names": [],
"type": "update_data_docs"
}
],
"id": "ff6c1445-1da6-4b3e-af20-6947ce253bd2",
"name": "wikibase_software_checkpoint",
"result_format": { "result_format": "COMPLETE" },
"validation_definitions": [
{
"id": "76869a4a-b823-4ccd-b091-2e4dff6befee",
"name": "wikibase_software_validation_definition"
},
{
"id": "fa8b2a52-4651-4bec-9e42-7af94e5faca7",
"name": "wikibase_software_tag_validation_definition"
},
{
"id": "0fbc7263-c0d9-4390-884d-445bf59a0647",
"name": "wikibase_software_tag_xref_validation_definition"
},
{
"id": "8768e1d1-11d5-44a6-8f5d-0a03d1d535d4",
"name": "populated_wikibase_software_validation_definition"
}
]
}
28 changes: 0 additions & 28 deletions data/gx/checkpoints/wikibase_statistics_observation_checkpoint

This file was deleted.

Loading