-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Simplify healthcheck build #2530
Conversation
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.
LGMT
Sorry, I was intended to write it in Javascript, just because I am not familiar with the syntax of bash/sh. I will be in trouble if I will modify it in the future. Since it is not for end users and usually the installation of Node.js image layers are cached, it won't be too slow in my case. So I chose JavaScript for better readability and maintainability. |
Bash isn't a hard language to learn, there's plenty of help/tutorials/examples on the internet. Stack overflow has answers for pretty much everything you would ever want to do in bash. Also there's loads of people here who can help if really get stuck (looking at the PR/issues/star counts). I don't feel that closing becuase you don't want to learn is a good reason, and hinders contributions to make a really cool tool even better. The saying goes, 'use the right tool for the job' and JS is really not the right tool here. I understand that for the majority of users, this is something they won't see. However there are a different subset of users, myself included, who want to control what code they run and so will wish to build the code and docker images themselves, and this does impact those users. |
Sorry, it is maybe my personal choice.
In my opinion, JS is the best tool here. All functions names are very clear and easy to understand and remember. Anyway, thanks for your work, I would recommend that we should have a discussion first as our pull request rules stated. |
Specifically:
Google is your friend However it's contradictory that you don't understand And you added a comment explaining what it does in f0ac3c8 Why are |
No hard feelings. The main issue is not about Google. The issue is maybe after a year, I will completely forget what are the meaning of those syntax.
Your example is good, I cannot believe I actually added a comment for JS here is very clear, fs.existsSync, fs.rmSync etc I will probably remember them in my life.
|
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Simplifies healthcheck build. Installing node into the Golang container just for scripting purposes adds a lot of time overhead to solve a simple problem. Bash is already available in the container and can easily do everything required.
I've tested the behaviour and is identical to the original JS implementation.
Type of change
Please delete any options that are not relevant.
Checklist
(including JSDoc for methods)
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.