Closed erikmd closed 6 months ago
Hi @AltGr @yurug, I believe I addressed all your suggestions.
@AltGr
while I agree that code-wise they are pretty different, from a user-perspective, they're both options concerning the server though (as the name implies!) -- and with similar use-cases so it would be best to have them closer to each other.
We could cheat by keeping this organisation in the code, but hardcoding ~docs to still put it in the SERVER section of the manpage (COMMON OPTIONS implicitely means the union of the commands, here we're dealing with the intersection :) )
Very good point, thanks! I fixed it as suggested.
Thanks again for your advice and help!
With this last tweak (and rebase), CI is green.
@AltGr @yurug If you don't object, I will merge the PR today at 16:00 or so.
Kind: feature
Close #594
Description
Good news, @AltGr @yurug !
I was able (with Louis' advice from last week) to implement #594.
Regarding the naming of the CLI command, I now propose
--serve-during-build
(better than my initial try,--fork-replace
)Each commit comes with a detailed description (or motivation), in particular note that:
--replace
PR) due to the fact alpine's defaultlsof
supports no option; unlike thelsof
package;Learnocaml_server.kill_running
;Learnocaml v1.1.0 running
instead ofLearnocaml v.1.1.0 running
, which was making less sense given our current git tag convention).I thoroughly tested the new option as summarized in the message of the main commit https://github.com/ocaml-sf/learn-ocaml/commit/f0108a34ae70ab45d22c21252b51e1bfb8a6c5ca but as suggested by @AltGr, I didn't turn the option on by default in the Dockerfile.
Regarding performance, I ran an experiment on learn-ocaml-corpus endowed with the following docker-compose.yml:
```yaml services: lo-test: image: learn-ocaml # build using ( sudo make docker-images ) volumes: - ../learn-ocaml-corpus:/repository - lo-test-serve-during-build-sync:/sync ports: - '8080:8080' restart: unless-stopped environment: - 'LEARNOCAML_SERVE_DURING_BUILD=true' volumes: lo-test-serve-during-build-sync: driver: local ```docker-compose.yml
along with the following script:
shell session
``` $ sudo make docker-images $ sudo docker compose up -d $ sudo docker compose logs -t lo-test $ sudo docker compose stop $ touch ../learn-ocaml-corpus/exercises/fpottier/*/test.ml # touch 26 exercises $ sudo docker compose restart $ sudo docker compose logs -t lo-test ```And I got:
So I believe the effort was worth it for this quite standard use case :)
Now, let's wait for the CI ! and let me know if you have review comments.
And last hint: we shouldn't squash-merge this PR but rather do a regular merge (to preserve the atomic commits).
Checklist
Note to maintainers
Close #…
if a related issue exists.