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

Try using uv for worker #896

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Fix SQLAlchemy upgrade incompatibilities
There's a few things that were fixed for the SQLAlchemy upgrade.
  • Loading branch information
michelletran-codecov committed Nov 19, 2024
commit 707d49258ce9cc119a38e76c2366ae7269d62653
2 changes: 1 addition & 1 deletion database/engine.py
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ def create_session(self):
timeseries_engine = self.timeseries_engine

class RoutingSession(Session):
def get_bind(self, mapper=None, clause=None):
def get_bind(self, mapper=None, clause=None, **kw):
if mapper is not None and issubclass(
mapper.class_, TimeseriesBaseModel
):
1 change: 1 addition & 0 deletions database/tests/unit/test_engine.py
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ def test_session_get_bind_timeseries_enabled(self, sqlalchemy_connect_url, mocke
database_url=sqlalchemy_connect_url,
timeseries_database_url=sqlalchemy_connect_url,
)

session = session_factory.create_session()
assert session_factory.main_engine is not None
assert session_factory.timeseries_engine is not None
4 changes: 2 additions & 2 deletions docker/test_codecov_config.yml
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ setup:
encryption_secret: "zp^P9*i8aR3"

services:
database_url: postgres://postgres:password@postgres:5432/postgres
timeseries_database_url: postgres://postgres:password@timescale:5432/postgres
database_url: postgresql://postgres:password@postgres:5432/postgres
timeseries_database_url: postgresql://postgres:password@timescale:5432/postgres
redis_url: redis://redis:6379
minio:
hash_key: testixik8qdauiab1yiffydimvi72ekq # never change this
4 changes: 2 additions & 2 deletions tasks/delete_owner.py
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ def delete_from_database(self, db_session, owner):
)
db_session.commit()
log.info("Deleting repos from DB", extra=dict(ownerid=ownerid))
involved_repos.delete()
db_session.query(Repository).filter(Repository.ownerid == ownerid).delete()
db_session.commit()
log.info("Setting other owner bots to NULL", extra=dict(ownerid=ownerid))
db_session.query(Owner).filter(Owner.bot_id == ownerid).update(
@@ -77,7 +77,7 @@ def delete_from_database(self, db_session, owner):
log.info(
"Cleaning repos that have this owner as bot", extra=dict(ownerid=ownerid)
)
db_session.query(Repository.repoid).filter(Repository.bot_id == ownerid).update(
db_session.query(Repository).filter(Repository.bot_id == ownerid).update(
{Repository.bot_id: None}, synchronize_session=False
)
db_session.commit()
Loading
Oops, something went wrong.