Raid v2 - #1008
Conversation
|
The CI checks are currently failing: Could you please check the linting and formatting issues please ? |
|
Everything fixed, comment taken into accounts, if you want to check the changes. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1008 +/- ##
==========================================
- Coverage 84.61% 83.80% -0.82%
==========================================
Files 214 217 +3
Lines 15523 16012 +489
==========================================
+ Hits 13135 13419 +284
- Misses 2388 2593 +205 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…hine Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…machine Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…olunteers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…teers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lunteer lookup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… completeness Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dition scoping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d volunteer flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…er flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ther track Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ion deletion Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds GET /raid/participants (manage_raid-gated), mirroring GET /raid/volunteers, built on the existing get_all_participants CRUD with an optional status filter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Documenso PR #1023 landed on main with 60-documents.py (parent 7dbe3290e145), colliding with our raid_editions_and_state which targeted the same parent. Re-parent raid_editions_and_state onto 84ee3296cc58 so alembic sees a single head again. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 8 xdist workers each drop and re-create ~126 tables plus indexes and FKs in a single transaction, which brushes past the default max_locks_per_transaction=64 * max_connections=100 lock-table size and sporadically fails with "out of shared memory / You might need to increase max_locks_per_transaction". Append the tuned values to postgresql.conf, restart the service container, and wait for readiness before running tests. GHA services can't set command args directly, so we name the container and docker exec into it after startup.
| done | ||
| echo "postgres did not become ready after restart" >&2 | ||
| exit 1 | ||
|
|
There was a problem hiding this comment.
Maybe this could be in a dedicated PR
| is_minor: bool | None, | ||
| user_id: str, | ||
| edition_id: UUID, | ||
| values: dict, |
There was a problem hiding this comment.
Could you type the dict or pass a schema?
| Captain = models_raid.RaidParticipant.__table__.alias("captain_p") | ||
| Second = models_raid.RaidParticipant.__table__.alias("second_p") |
There was a problem hiding this comment.
Why can you not use the relationship? Could you add a comment explaining the issue?
| db: AsyncSession, | ||
| ) -> list[schemas_raid.RaidEdition]: | ||
| result = await db.execute(select(models_raid.RaidEdition)) | ||
| return [schemas_raid.RaidEdition.model_validate(e) for e in result.scalars().all()] |
There was a problem hiding this comment.
Please instanciate the schema manually, to allow the type checker to detect any inconsistancy
| return [schemas_raid.RaidEdition.model_validate(e) for e in result.scalars().all()] | |
| return [ | |
| schemas_raid.RaidEdition( | |
| id=edition.id, | |
| year=edition.year, | |
| name=edition.name, | |
| start_date=edition.start_date, | |
| end_date=edition.end_date, | |
| registering_end_date=edition.registering_end_date, | |
| active=edition.active, | |
| inscription_enabled=edition.inscription_enabled, | |
| ) for e in result.scalars().all()] |
| ), | ||
| ) | ||
| model = result.scalars().first() | ||
| return schemas_raid.RaidEdition.model_validate(model) if model else None |
There was a problem hiding this comment.
Please instanciate the schema manually, to allow the type checker to detect any inconsistancy
| ), | ||
| ) | ||
| model = result.scalars().first() | ||
| return schemas_raid.RaidEdition.model_validate(model) if model else None |
There was a problem hiding this comment.
Please instanciate the schema manually, to allow the type checker to detect any inconsistancy
| await db.execute( | ||
| update(models_raid.RaidEdition) | ||
| .where(models_raid.RaidEdition.id == edition_id) | ||
| .values(**values), |
There was a problem hiding this comment.
| .values(**values), | |
| .values(**values.exclude_unset()), |
| async def get_participant_or_404( | ||
| user_id: str, | ||
| edition_id: UUID, | ||
| db: AsyncSession, | ||
| ) -> schemas_raid.RaidParticipant: |
There was a problem hiding this comment.
If this is a dependency, it should use db: AsyncSession = Depends(get_db), and be called with Depends(get_participant_or_404). Otherwise it should be an util
| other = "other" | ||
|
|
||
|
|
||
| DEFAULT_EDITION_ID = uuid.UUID("00000000-0000-0000-0000-000000000001") |
| alembic_runner: "MigrationContext", | ||
| alembic_connection: sa.Connection, | ||
| ) -> None: | ||
| pass |
There was a problem hiding this comment.
Given the complexity of the migration, I would suggest populating the db with some data during tests to ensure the migration pass without failing
|
Main coverage drop by 0.8%, it could be great to add a few additionnal tests, especially given the complexity of the module |
Description
Summary
Restructuring some of raid registering to match challenger idea :
Classification
Type of Change
Impact & Scope
Testing
Documentation
"Docstrings#Inline comments