refactor: rename pretalx namespaces to eventyay for talks suite - submission#3356
Draft
ViRUS-0-0 wants to merge 1 commit intofossasia:devfrom
Draft
refactor: rename pretalx namespaces to eventyay for talks suite - submission#3356ViRUS-0-0 wants to merge 1 commit intofossasia:devfrom
ViRUS-0-0 wants to merge 1 commit intofossasia:devfrom
Conversation
Contributor
Reviewer's GuideRefactors remaining pretalx-era namespaces and organiser/organizer fields in talk tests and submission-related code to match the current eventyay data model, adjusts reviewer permission handling, and wires in a dummy plugin app so the submission test suite runs cleanly under the new schema. Class diagram for submission reviewer access contextclassDiagram
class User {
}
class Submission {
+Event event
+ReviewerSet assigned_reviewers
}
class Event {
+ReviewPhase active_review_phase
}
class ReviewerSet {
+bool contains(user User)
+ReviewerSet all()
}
class ReviewPhase {
+bool allows_reviewer(user User, submission Submission)
}
class PermissionsModule {
+bool has_reviewer_access(user User, obj Object)
}
PermissionsModule --> Submission : uses
PermissionsModule --> User : uses
Submission --> Event : event
Submission --> ReviewerSet : assigned_reviewers
Event --> ReviewPhase : active_review_phase
ReviewerSet --> User : contains
Flow diagram for updated has_reviewer_access permission checkflowchart TD
A["has_reviewer_access(user, obj)"] --> B{obj has submission attribute}
B -- Yes --> C["obj = obj.submission"]
B -- No --> D["obj unchanged"]
C --> E{obj is instance of Submission}
D --> E
E -- No --> F["return False"]
E -- Yes --> G{user in obj.assigned_reviewers}
G -- Yes --> H["return True"]
G -- No --> I["phase = obj.event.active_review_phase"]
I --> J{phase allows reviewer}
J -- Yes --> H
J -- No --> F
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Changing
has_reviewer_accessto returnFalseinstead of raising on non‑Submissionobjects alters its contract and can hide incorrect call sites; consider at least logging, asserting in debug, or keeping the exception in non-production contexts so misuse is still surfaced during development. - The test-only plugin registration in
INSTALLED_APPS('tests.talk.dummy_app.PluginApp') hardcodes a deep path into the main settings; consider using a dedicated test settings override or a shorter app label to decouple core settings from the tests’ package structure. - In
test_submission_assign_code, the alias namepretalx_submissionforeventyay.base.models.submissionis now misleading; renaming the alias to match the new namespace will make the intent of the test clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Changing `has_reviewer_access` to return `False` instead of raising on non‑`Submission` objects alters its contract and can hide incorrect call sites; consider at least logging, asserting in debug, or keeping the exception in non-production contexts so misuse is still surfaced during development.
- The test-only plugin registration in `INSTALLED_APPS` (`'tests.talk.dummy_app.PluginApp'`) hardcodes a deep path into the main settings; consider using a dedicated test settings override or a shorter app label to decouple core settings from the tests’ package structure.
- In `test_submission_assign_code`, the alias name `pretalx_submission` for `eventyay.base.models.submission` is now misleading; renaming the alias to match the new namespace will make the intent of the test clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2292 - Submission Tests
This PR fixes the legacy pretalx import in the
submissiontests to their equivalent equivalent model.The changes outside the
submissionfolder were necessary to fix global test setup errors, such as outdated database field names (likeorganizervsorganiser) and incorrect namespaces (eventyayvspretalx), which were causing the submission tests to fail before they even started.To run the tests
docker compose build web docker compose up -d docker compose run exec pytest tests/talk/submissionThe submission tests now run successfully
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html Results (153.21s (0:02:33)): 190 passedNote : With the change in the
conftest.pyfile from pretalx to eventyay model, tests other thansubmissionwill stop working because they still have the legacy namespace.Summary by Sourcery
Update talk submission tests and related configuration to use the current eventyay models and plugins instead of legacy pretalx namespaces, ensuring the submission test suite runs successfully.
Bug Fixes:
Enhancements: