Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Studydocs: Always require type and add options. #423

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

NotSpecial
Copy link
Contributor

We do not wish to allow studydocs without type anymore, so the type field is not not nullable and required.

Furthermore, we wish to differentiate between spring and autumn exams for better filtering, so the previous exam type is replaced.

Closes #422

@NotSpecial
Copy link
Contributor Author

Something seems wrong with CI. But I got no time to investigate right now..

@temparus
Copy link
Member

temparus commented Feb 6, 2021

The tests for amivapi/tests/studydocs/test_studydocs_auth.py and amivapi/tests/studydocs/test_summary.py are failing.

@NotSpecial
Copy link
Contributor Author

Ah, because type is now required, and of course the old tests do not specify the type.

@NotSpecial
Copy link
Contributor Author

If anybody has time, this should be an easy fix. I'll do it as soon as I can, but not sure when that will be :/

NotSpecial and others added 2 commits May 24, 2022 18:17
We do not wish to allow studydocs without type anymore, so the `type` field is not not nullable and required.

Furthermore, we wish to differentiate between spring and autumn exams for better filtering, so the previous exam type is replaced.

Closes #422
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2cbe03f) 94.75% compared to head (8bd9cdb) 94.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   94.75%   94.77%   +0.02%     
==========================================
  Files          75       75              
  Lines        4329     4329              
==========================================
+ Hits         4102     4103       +1     
+ Misses        227      226       -1     
Flag Coverage Δ
unittests 94.77% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@temparus
Copy link
Member

temparus commented May 25, 2022

@NotSpecial The change of the type options for study documents do not come with any data migrations, so the existing study documents will still come with the type exams. This case is not covered by the tests as the API does not accept an item with type exams anymore.

Do you have any idea how the API handles this situation?

@temparus
Copy link
Member

I just saw the use of self.load_fixture(...) in other tests. We could add some additional tests to cover that scenario by adding the entities with load_fixture instead of the regular POST endpoint of the API.

@NotSpecial
Copy link
Contributor Author

The API will enforce the new type for all new requests. Existing data will be returned as-is. We would need to migrate it ourselves.

@temparus
Copy link
Member

temparus commented Jun 6, 2022

Migration of existing data is difficult because we can only partially automate the process by looking up lectures in the course catalogue of ETH and match those lectures which still exist with the same name.
If we keep the old entries as is, we might need to have additional filter options in addition to the document types officially supported by the API in order to be able to find all documents by filtering. This is also not ideal.

@NotSpecial
Copy link
Contributor Author

I'm not sure what to tell you 😅

Data migration is always a difficult task, that's why changes to the data schema are only done when really necessary.

So considering that, is the split into autumn/spring exams really that necessary?
We could easily revert this part of the PR and go back to just exam.

I was just implementing the suggestion in #422, but now that I see it again I am not sure whether it's really that helpful to split the exam types up.

What's your opinion? Should we just keep exam as before? I mean usually, the exam is in the same semester as the lecture, so looking for lectures in HS with an exam is the same as looking for lectures with an autumn exam.

@temparus
Copy link
Member

temparus commented Jun 9, 2022

I think that having the document type exam would be sufficient.
It can happen that a lecture gets moved from the autumn semester to the spring semester or vice versa. When this happens, I would want to be able to get all exams for that lecture from the previous years nonetheless. So in this case, splitting the type would rather introduce more confusion.

I will check with the current board members how we should proceed and then get back to you.

@d-portenier
Copy link
Contributor

d-portenier commented Jun 10, 2022

I haven't talked to the rest of the Board, but I think the separation into spring/ autumn exams is more hindering than helpful, as if I'm looking for old exams, I also want to find the ones in the off-season.

Additionally, people often mix things up. In the past, I downloaded old exams with e.g. 'spring20' in the doc-title, but the exam date was February 20 and should therefore have been 'autumn19'.

@NotSpecial
Copy link
Contributor Author

In that case, we should probably revert this part of the change and go back to a single exam type.

@temparus
Copy link
Member

Please note that we might still have existing documents where this information is not set, so these documents should be migrated after this change has been deployed.

@temparus temparus requested review from suisseWalter and removed request for alexander-schoch-linuxdays December 17, 2023 18:00
Copy link
Contributor

@suisseWalter suisseWalter left a comment

Choose a reason for hiding this comment

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

overall I like the idea.
But I'm concerned about migration.
also, because we will be migrating to community solutions in the future it might not make sense to do a lot of work on the migration, if that requires a lot of work.

amivapi/tests/studydocs/test_summary.py Show resolved Hide resolved
@temparus
Copy link
Member

temparus commented Dec 17, 2023

overall I like the idea. But I'm concerned about migration. also, because we will be migrating to community solutions in the future it might not make sense to do a lot of work on the migration, if that requires a lot of work.

The existing documents must be migrated to the new platform, so if there is more structured data available to perform this migration as automated as possible the better it is.
This change only applies to newly uploaded or edited documents, but those documents are less likely to require manual review for migration. So I think this a change like this still makes sense to complete especially in this case where the work has already been done.

The only change which might also be necessary is that the website form has to also enforce those fields for better feedback to the user.

@suisseWalter
Copy link
Contributor

ok if there is no need to migrate old documents then I'm happy with this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New necessary fields for the Study Documents
4 participants