-
Notifications
You must be signed in to change notification settings - Fork 29
Fixes #259 Reflect file deletion by removing the whole entry #2922
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2922 +/- ##
=======================================
Coverage 69.31% 69.31%
=======================================
Files 211 211
Lines 6755 6755
=======================================
Hits 4682 4682
Misses 2073 2073 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your first PR and congratulations on fixing your first bug! I just checked the changes locally and think they are working as intended 👍
As you can imagine, I have a few comments and thoughts to share:
- Have you checked whether we can change the immediate DELETE to a regular deletion of the respective file during the PATCH? Maybe by setting
_destroy
and usingaccepts_nested_attributes_for :files, allow_destroy: true
? This way, we could remove the JavaScript alert and do any updates combined with the file deletion in one transaction. I would like to see this as a follow-up improvement. What do you think? - I know there is no spec for editing an exercise as a teacher. Wouldn't this be a good opportunity to start a (system) spec?
- Your commit message contains some typos, such as hole –> whole, or the first form –> from. Also, I've historically put the issue not as prominent in the message. We have different issue naming schemes for the projects. While it is common for openHPI / Xikolo to have a ticket as XI-1234 (similar to your style), in the other projects with local issues, we usually use
#1234
. It's a matter of taste, but I tend to include the ticket number as the last line (Fixes #1234
,Closes #1234
), allowing GitHub to link it. Of course, I see benefits in making the issue more prominent 🙂 If you haven't done so, I recommend checking out some of our internal guides, where you'll find more on this topic: https://confluence.hpi.de/x/xYGbB. In many GitHub projects, we derived from some parts, such as the branch naming convention, making your choice totally fine. As a last remark, I would suggest adding some JavaScript/form/exercise reference to the first line (if space permits), to distinguish from the other aspects where we handle files (in submissions, as downloadable artefacts, for executions).
Remove the whole file element from the exercise form when a file is deleted.
3955df3
to
ccb652e
Compare
Thank you very much for your comment.
I wasn't sure about the policy of adding system tests. I am wary of adding too many system tests because of the brittleness UI tests introduce. Deleting the file from the form might be worth testing 🤔 What we should test is: What do you think?
Maybe the form could be improved in this manner. I am not a big fan of the To improve this form, my thought was to separate creating exercises and files. This would make the UI simpler and the implementation of each part smaller. At this point, I don't know who is using this form and what he main challenges are. So I refrained from making functional changes until I know a little bit more. |
Sounds good! Of course, UI tests come at a cost, particularly the tight relationship to the UI and the slow execution. Hence, I agree to use them mainly for important parts. I would consider the exercise creation and update to be such a part and think it can help to find/prevent errors.
I definitely see that and think there are better options. However, we currently use
I am very open to new ideas and improvements. How would the workflow look then? I am not sure a total separation (and linking) makes sense, since a file can (currently) only exist as part of a submission or exercise.
The form is only used by educators; changing the files is (in my opinion) one of the most used tasks when dealing with exercises after their initial creation. Despite the room for improvement, the existing appearance was mostly fine for many educators. Hence, I would go with incremental improvements here first, and gain a better overview of the system and (technical) challenges. |
Remove the hole file element form the exercise form when a file is deleted.
This issue is described in #259