Skip to content

[rel-DB] Complete checker tests#3216

Merged
vkrasnovyd merged 13 commits intoOpenSlides:feature/relational-dbfrom
vkrasnovyd:rel-db-checker-tests
Nov 27, 2025
Merged

[rel-DB] Complete checker tests#3216
vkrasnovyd merged 13 commits intoOpenSlides:feature/relational-dbfrom
vkrasnovyd:rel-db-checker-tests

Conversation

@vkrasnovyd
Copy link
Copy Markdown
Contributor

@vkrasnovyd vkrasnovyd commented Nov 24, 2025

Changes to presenters and tests:

  • As discussed with Raimund, preserved the logic of the presenters and deleted only the tests with inconsistent data. The remaining tests make sure that the checker does not scream when data is correct;
  • Removed fields that are not in export_helper.get_fields_for_export in the check_database_all (logic similar to export_meeting). Reason: checker was screaming because of the calculated fields pulled from db (like mediafile.owner_id_organization_id or projection.content_object_id_meeting_id).

Changes to checker:

  • Added more precise field type validation for GenericRelationField and GenericRelationListField to get errors about incorrect field value type;
  • Remove TODO-comment without actually making any changes. reason: the 2 areas are making slightly different checks so I'd better leave optimizing them for rel-DB 2;
  • Added some missing points, fixed number of whitespaces for better readability;
  • Merged "state_extension" and "recommendation_extension" validation in check_special_fields(). Reasons:
    • Logic is completely the same.
    • Error message for recommendation_extension had duplications. Example:
motion/1/recommendation_extension: Relation Error: Found motion/3 in recommendation_extension but not in models.
motion/1/recommendation_extension: Relation Error: Found theme/1 but only motion is allowed.
motion/1/recommendation_extension: Relation Error: Found motion/3 in recommendation_extension but not in models.
motion/1/recommendation_extension: Relation Error: Found theme/1 but only motion is allowed.

@vkrasnovyd vkrasnovyd marked this pull request as draft November 24, 2025 10:56
@vkrasnovyd vkrasnovyd marked this pull request as ready for review November 24, 2025 13:38
@vkrasnovyd vkrasnovyd requested a review from hjanott November 24, 2025 13:38
Copy link
Copy Markdown
Member

@hjanott hjanott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see many beautiful changes.

Comment thread openslides_backend/models/checker.py Outdated
Comment thread openslides_backend/models/checker.py Outdated
Comment thread tests/unit/test_checker.py Outdated
Comment thread tests/unit/test_checker.py Outdated
Comment thread openslides_backend/models/checker.py Outdated
Comment thread openslides_backend/models/checker.py Outdated
@hjanott hjanott assigned vkrasnovyd and unassigned hjanott Nov 24, 2025
@vkrasnovyd vkrasnovyd requested a review from hjanott November 25, 2025 11:31
@vkrasnovyd vkrasnovyd assigned hjanott and unassigned vkrasnovyd Nov 25, 2025
Copy link
Copy Markdown
Member

@hjanott hjanott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found one line that should be removed before merging.

Comment thread openslides_backend/models/checker.py Outdated
Comment thread tests/unit/test_checker.py Outdated
@hjanott hjanott assigned vkrasnovyd and unassigned hjanott Nov 25, 2025
vkrasnovyd and others added 3 commits November 25, 2025 17:28
Co-authored-by: Hannes Janott <hannes.janott@openslides.com>
@vkrasnovyd
Copy link
Copy Markdown
Contributor Author

@hjanott added some missing test cases, did a bit of cleanup in the checker itself and added a couple of todos for rel-db-2. Also re-enabled migration index check in the checker.

@vkrasnovyd vkrasnovyd requested a review from hjanott November 26, 2025 09:58
@vkrasnovyd vkrasnovyd assigned hjanott and unassigned vkrasnovyd Nov 26, 2025
@vkrasnovyd vkrasnovyd merged commit fe6890d into OpenSlides:feature/relational-db Nov 27, 2025
5 of 6 checks passed
@vkrasnovyd vkrasnovyd deleted the rel-db-checker-tests branch November 27, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants