-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
remove references to external programs in favor of packages #2172
Conversation
6a56ba8
to
d2cd200
Compare
This is ready for review. Switched to Definitely needs some testing in the area listed above. |
Is it relevant that I see a direct use of |
That's the perl |
This pull request has merge conflicts that need to be resolved. |
64c5a3d
to
46242bc
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.
I haven't testing things yet, but I see some things that need to be fixed in the code.
46242bc
to
69a09ff
Compare
@drgrice1 Just made updates. |
ef111d4
to
fb3f690
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.
There are still some things that aren't right.
Also, I don't really think it is worth introducing the Archive::Extract
module when the Archive::Tar
module covers this and is a core module.
2166fe6
to
6f15637
Compare
@drgrice1 Fixed these. I've noticed in HardCopy and HardcopyRenderedProblem.pm there are a bunch of file IO that could benefit from using |
@pstaabp: Have you tested your latest changes? |
6f15637
to
7f3cf8f
Compare
I had tested the course admin features and didn't test the hardcopy creation. Fixed the error. |
87748e4
to
abc058e
Compare
abc058e
to
51abfd5
Compare
@drgrice1 and others, when you get a chance, this is ready to be looked at and tested gain. |
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.
Please, just revert to using Archive::Zip
in HardcopyRenderedProblem.pm
and Hardcopy.pm
. Here are the justifications for this request:
Archive::Zip
is already NOT using a reference to an external program, and so this change does not fit into this pull request as titled.Archive::Zip
is still needed becauseArchive::Zip::SimpleZip
can not do archive extraction.Archive::Zip
has a nicer API thanArchive::Zip::SimpleZip
. Look at how much more code it took to implement the same thing inHardcopyRenderedProblem.pm
andHardcopy.pm
withArchive::Zip::SimpleZip
than withArchive::Zip
.- Quite frankly we wouldn't be using
Archive::Zip::SimpleZip
at all if it weren't for the bug inArchive::Zip
with adding symbolic links to zip archives. The zip files created in these two modules don't have symbolic links, so that is irrelevant here.
In fact, please revert all changes to HardcopyRenderedProblem.pm
in this pull request. Other than switching from Archive::Zip
to Archive::Zip::SimpleZip
, you change several cases where the Mojo::File::path
method was called into Mojo::File->new
calls. You do realize that the path
call is just a shorthand for Mojo::File->new
don't you? The definition of the path
method in Mojo::File
is sub path { __PACKAGE__->new(@_) }
. The path
method could also be imported and used in the CourseManagement.pm
file. Do NOT do this in Hardcopy.pm
(or any module that derives from ContentGenerator.pm
), because that module has another path
method that will conflict if the path
method is imported from Mojo::File
.
51abfd5
to
62ddf67
Compare
reverted to |
62ddf67
to
a0ccbc6
Compare
This has still not been addressed. |
a0ccbc6
to
e851dda
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.
Just a few minor issues to be fixed, and then this is ready to go.
and improve tar ball creation without chdir
87c3428
to
130ba37
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.
I just noticed that you added the usage of the module File::Copy::Recursive, but did not add it to the check_modules.pl
script. Make sure to add that.
Good catch. Updated. |
mkdir $courseDir | ||
or warn | ||
"Failed to create $courseDirName directory '$courseDir': $!. You will have to create this directory manually.\n"; | ||
eval { Mojo::File($courseDir)->make_path }; |
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.
Is this an error? Should be Mojo::File->new
?
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.
If so and if someone confirms how I should fix it, I can fix it in #2290.
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.
Yes, that should be eval { Mojo::File->new($courseDir)->make_path };
. Good catch.
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.
OK, less of a catch though than just debugging when testing #2290.
The dependence on File::Copy::Recursive module was added in openwebwork#2172, but not added to the docker build. Start using node 20 in the docker build. The node 16 install script from nodesource is deprecated, and they have imposed a 60 second install delay when you use it. Fix the ownership on the courses directory and admin course directory when the docker entrypoint runs. Fixing the ownership on the courses directory will not cause any slow down to the execution of that script. It is not a recursive ownership change, just a single directory ownership change which is super fast.
The dependence on File::Copy::Recursive module was added in openwebwork#2172, but not added to the docker build. Start using node 20 in the docker build. The node 16 install script from nodesource is deprecated, and they have imposed a 60 second install delay when you use it. Fix the ownership on the courses directory and admin course directory when the docker entrypoint runs. Fixing the ownership on the courses directory and admin course directory will not cause any slow down to the execution of that script. It is not a recursive ownership change, just two directories for which ownership is changed which is super fast.
This removes the use of the programs mv, cp, rm, mkdir, tar, gzip (some were no longer used). Instead, use functions in perl modules.
This should be tested on a few different platforms. Especially