-
Notifications
You must be signed in to change notification settings - Fork 46
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
Make Moodle Install Clone step optional #305
base: main
Are you sure you want to change the base?
Make Moodle Install Clone step optional #305
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #305 +/- ##
============================================
- Coverage 88.23% 88.19% -0.04%
- Complexity 735 736 +1
============================================
Files 76 76
Lines 2270 2271 +1
============================================
Hits 2003 2003
- Misses 267 268 +1 ☔ View full report in Codecov by Sentry. |
Hi @jay-oswald, thanks for the contribution. Thinking about situation when that directory could exist, but will be empty, unlikely to happen in standard setups, but may be it needs to throw exception in that case. Also, at the current workflow you can point |
Thanks for the reply @kabalin I didn't actually realise I still think there is a use case for making it optional when running on actions runners with caching enabled, allowing the command to be constant and it will clone or not depending on if the cache maintains folder or not. Though can probably just use the 2 commands, and have it fall back to the url in repo if using a path fails |
Hey @kabalin I just tried to use
|
Hi @jay-oswald, unless I'm wrong, Ciao :-) |
Thanks for the suggestion @stronk7 https://github.com/moodlehq/moodle-plugin-ci/blob/main/src%2FValidate.php#L96 From what I can tell that's the function that validates the repo string that's passed in, so it needs to be git, ssh or https. So passing in file like you suggested won't work. Unless I'm wrong about the validation. Even if it did work it would still try to run the git clone command which would throw an error at the folder not being empty. So I think really does need to do something along the lines of my PR, I'll need to fix it up to pass tests etc |
Just contradicting my previous message, I think that And, unless I'm reading it wrong, only git/ssh/https URLs are accepted. So, if we want local repos to be allowed... we need to modify that validation. Ciao :-) |
Hah, @jay-oswald, snap! |
It is good we did some research 👍Cloning from the path is standard
Not sure I have got this. Cloning would use local path as remote, so it would clone from specified directory to I don't mind if we merge @jay-oswald patch too, kind of adds flexibility, but it needs to throw if directory is empty I guess, what do you think @stronk7 ? |
I fully agree with this, allowing to clone from local repos cannot but be good (for cases requiring it). I'd suggest to create different issue, because this one, though related, is a different beast, IMO.
I think that what @jay-oswald is trying to achieve here is as simple as to allow the git clone operation to be completely skipped if the To be honest, personally, instead of relying on directories existence (or contents, or any other heuristic...) what I'd do is to have a Ciao :-) |
Created #306.
I agree, simple and clear approach. |
@stronk7 Happy if I just update this one, and add the option, thinking just a simple |
I think that the Other than that, of course, you're welcome! Ciao :-) |
I would like to propose that we make the
git clone
step of Moodle install an optional step.The Rational behind this is we have a custom docker image that runs our tests on Gitlab when we push code. We would like to bake Moodle itself into the docker image. Baking in moodle, and then running
moodle-plugin-ci install --moodle /moodle
.This does 2 main things
As it checks for if the folder exists, it will run like it does now if the folder does not exist, having no impact on people already using it.
Doing this approach allows actions to cache the location of the install, so repeated runs can all run the same command, and if the cache has been cleared it will run the
git clone
command, and if the cache exists the step will just be skipped