Feature/git hook i18n translate#3172
Conversation
zeke
left a comment
There was a problem hiding this comment.
Looks good. I left a few suggestions for refactoring.
|
@JoseJPR Could you resolve suggested changes? |
alexandrtovmach
left a comment
There was a problem hiding this comment.
So far so good. Could you move and rename file:
.git-hooks/locale.js -> tests/scripts/protect-i18n.js
it looks semantic correctly for me
|
@alexandrtovmach Yes, in the morning we'll have progress. |
Co-authored-by: Zeke Sikelianos <zeke@github.com>
Co-authored-by: Alexandr Tovmach <alexandrtovmach@gmail.com>
Co-authored-by: Alexandr Tovmach <alexandrtovmach@gmail.com>
alexandrtovmach
left a comment
There was a problem hiding this comment.
Few more suggestions 😉
|
Husky was removed from the nodejs.dev project because of developer friction. I don't think we should add it here |
Co-authored-by: Alexandr Tovmach <alexandrtovmach@gmail.com>
Co-authored-by: Alexandr Tovmach <alexandrtovmach@gmail.com>
|
Hi @nschonni for me there would be no problem with define a hoot without "husky". @zeke and @alexandrtovmach what do you think? |
|
@nschonni I believe we're not: Could you provide any related info? Husky it's not something bad, and I think it's just one possible way to prevent making translations in wrong way on initial steps by protecting from commit. Please check related issue here: |
|
nodejs/nodejs.dev#733 is re-removing it, and links to the original removal. It wasn't Husky before, but was removed here #2711 |
|
Okay I see. The same thing should be for nodejs.org. You removed husky to speed up CI, but it's not a fix. We need just to configure what should run on CI, what shouldn't. |
|
In case of this PR - husky is only one tool that can help with our goal to prevent wrong translations process as soon as possible |
|
@zeke Please take a look |
zeke
left a comment
There was a problem hiding this comment.
Left some more feedback. Sorry for the delay.
| */ | ||
|
|
||
| 'use strict' | ||
|
|
There was a problem hiding this comment.
We still want Actions workflows to be able to change these files, so let's make the Actions environment exempt from this check by adding something like this toward the top of the file:
if (process.env.CI) process.exit()There was a problem hiding this comment.
In the Github Actions documentation (https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) it refers to some predefined environment variables and there is the one you comment, process.env.CI, so just adding the line you propose would be enough.
There was a problem hiding this comment.
Co-authored-by: Zeke Sikelianos <zeke@github.com>
Co-authored-by: Zeke Sikelianos <zeke@github.com>
obensource
left a comment
There was a problem hiding this comment.
Please see my comment regarding the reintroduction of husky. Thanks a million for all your fantastic work @JoseJPR – it's very appreciated! 🙏
| "cross-env": "^7.0.2", | ||
| "delay-cli": "^1.1.0", | ||
| "faucet": "0.0.1", | ||
| "husky": "^4.2.5", |
There was a problem hiding this comment.
Since husky has been regarded as a footgun for developers by some of our contributors – and seeing that it has been added and removed from this repo multiple times due to that friction: elevating the conversation about how we want to handle commit-linting across the project (as @MylesBorins mentioned here) seems like the right thing to do – rather than reintroducing it here just to help the i18n initiative protect one repo that consumes its exports from commits made directly to it (which unintentionally green-lights its use for other cases in /nodejs.org). Imo, I agree that when there is project-wide consensus on how we want to enforce commit linting (eg. via husky or as a CI job), then we can be more confident on how we want 'source of truth' repos like /i18n to handle this in order to prevent direct commits elsewhere. 👍
Given that, I'm going to request that we at the very least:
- Hear more opinions here about approving this PR which reintroduces
huskyinto this repo, and hopefully get greater consensus on that beyond the folks who're involved withi18nandnodejs.org. - Elevate the conversation accordingly to the TSC via admin.
There was a problem hiding this comment.
Co-authored-by: Aissaoui Ahmed <algarabi05@gmail.com>
Co-authored-by: Aissaoui Ahmed <algarabi05@gmail.com>
Co-authored-by: Aissaoui Ahmed <algarabi05@gmail.com>
|
It's been a year and a half since it began, however we don't use "Husky" any more according to some discussions, so this PR will be closed and can also be opened for futher discussion. |
The main idea of this PR is to provide a new script that controls through the "Husky" npm library with a pre-commit that a contributor cannot upload modified files from the "locale" folder.
A new layer of security to ensure that the contributions in translations are made with Crowdin.
If you modify a file in the "locale" folder you should be notified as you can see in the screenshot.
The main issue: nodejs/i18n#283
@alexandrtovmach
@zeke