osu-wiki icon indicating copy to clipboard operation
osu-wiki copied to clipboard

Run CI checks locally using Docker

Open TicClick opened this issue 3 years ago • 9 comments

this is necessary to make them portable and comfortable for use, without users investing in bootstrapping and maintenance of their very own local environment specifically for testing purposes. in https://github.com/ppy/osu-wiki/pull/7222, some attempts were made, and the script "mostly works" due to a number of platform-dependent hacks (see the PR discussion) and Windows having being left unsupported.

  • what I wanted: mount the osu! wiki repository into a prebuilt container with deps, which would leave no traces in the repo (for example, one of my attempts included making a symlink for node_modules to be recognized by node, which obviously polluted the original repo)
  • a Dockerfile I managed to draft, and its shortcomings -- feel free to start from there
  • a small note that if everything is put into a container, we can edit run-ci.sh however we want -- maybe make it a single docker exec command with desired args, even

TicClick avatar Jun 13 '22 23:06 TicClick

This is counterproductive to making osu!wiki a contributor-friendly space, as Docker is not exactly very beginner friendly. There must be better alternatives that had been evaluated before we proceed with such a change.

sr229 avatar Jun 14 '22 02:06 sr229

more options for people who may be more familiar/comfortable with Docker than setting up their own python environment (:raised_hand_with_fingers_splayed:) can't hurt. I agree this still wouldn't be "beginner-friendly" in the sense that it's a big leap past editing markdown files, but all that means is it shouldn't be presented as a true beginner's option, wherever it gets mentioned

real beginner's option is to not worry about any of these tools in the first place, I think

cl8n avatar Jun 14 '22 03:06 cl8n

I think more developers these days have docker than have python and whatever other requirements are currently required to make scripts run. I'd argue docker is more friendly. At the end of the day the user is installing one dependency and running one command. It's not rocket science.

As I said in previous discussion, from a security perspective I feel much more comfortable running the CI scripts on this repo within docker, especially as they contain third party scripts that I haven't checked thoroughly.

peppy avatar Jun 14 '22 08:06 peppy

This is counterproductive to making osu!wiki a contributor-friendly space, as Docker is not exactly very beginner friendly

first off, beginners can send their PRs and have them automatically checked anyway, and this issue covers local runs only. now, in our CI we have shell scripts, Python scripts, and Node.js utilities, and I imagine it would be much easier to run a single script executing a command inside a container than to set up two environments (three, if you are under Windows and really want those shell scripts) just to check if you missed a link.

TicClick avatar Jun 14 '22 12:06 TicClick

I mean, if there's a better/more friendly solution I may be as well unaware of, I would totally welcome it (vagrant? but it's more obscure and fit better for another task, although it seemingly doesn't require root privileges)

TicClick avatar Jun 14 '22 13:06 TicClick

Docker does not require root these days.

peppy avatar Jun 14 '22 14:06 peppy

might off-topic, I still wanna to do CI-check on my local environment so i could make sure all commits pushed to this repo are CI passed. Is it currently possible?

RushFTK avatar Sep 20 '22 02:09 RushFTK

You can check what's being done by github here: https://github.com/ppy/osu-wiki/blob/master/.github/workflows/continuous-integration.yml

peppy avatar Sep 20 '22 03:09 peppy

ok, i will have a look, thanks very much

RushFTK avatar Sep 21 '22 02:09 RushFTK