-
Notifications
You must be signed in to change notification settings - Fork 28
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
Proforma: reuse existing files on import, if possible #2538
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 #2538 +/- ##
==========================================
+ Coverage 69.28% 69.40% +0.11%
==========================================
Files 210 210
Lines 6749 6775 +26
==========================================
+ Hits 4676 4702 +26
Misses 2073 2073 ☔ View full report in Codecov by Sentry. |
218f9b9
to
a7affb4
Compare
Yes that would absolutely make sense! |
a7affb4
to
4d3198e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
4d3198e
to
ac0fe42
Compare
This comment was marked as resolved.
This comment was marked as resolved.
38f45b0
to
20a2705
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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.
Nicely done, thank you! The current code changes look good and I've understand them.
Unfortunately, I still had issues verifying the code changes. Once again, I was using the already well-known file changes from here:
First of all, when the new version was in CodeHarbor and I tried uploading the old version, I got an exception there (the other direction from old to new works). Then, even when resolving this in CodeHarbor, I still couldn't import the old version in CodeOcean if the new version was stored already.
The error I got was: Validation failed: Files feedback message must be blank
. The problematic file is:
#<CodeOcean::File id: 67823922, content: "# actual tests here (in functions)\r\nfrom z_helpers...", context_id: 1101, context_type: "Exercise", file_id: nil, file_type_id: 8, hidden: true, name: "p51test", read_only: true, created_at: "2024-09-25 19:28:50.331358000 +0000", updated_at: "2024-09-25 19:29:34.363568000 +0000", native_file: nil, role: "regular_file", hashed_content: "70721d58fcbac5c9570e63633e778d9c", feedback_message: "Feedback", weight: nil, path: nil, file_template_id: nil, hidden_feedback: false, xml_id_path: ["63332861"]>
Despite the listed issue, I also found an issue with the proglang
method. Below is the fixed entry that also works if no execution_environment
has been selected:
def proglang
regex = %r{^openhpi/co_execenv_(?<language>[^:]*):(?<version>[^-]*)(?>-.*)?$}
match = regex.match @exercise&.execution_environment&.docker_image
match ? {name: match[:language], version: match[:version]} : nil
end
Could you include that, too, please (ideally with a test)?
708bb5d
to
ebef98c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
0ad75ef
to
fefb056
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d3e3727
to
7e9974e
Compare
Use xml_id_path to recreate proforma structure with tests and model_solutions containing multiple files
7e9974e
to
c4a8dfe
Compare
c4a8dfe
to
ed1c88c
Compare
Co-authored-by: Sebastian Serth <[email protected]>
ed1c88c
to
a2d98c9
Compare
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.
To assist finishing this PR, I tested the changes locally and think they are fine domain-wise. Thanks again, Karol!
Use
xml_id_path
to recreate proforma structure with tests and model_solutions containing multiple filesalso sets
xml_id_path
for exported files, if it is not set. (similiar to uuid)