Conversation
|
Size Change: 0 B Total Size: 532 kB ℹ️ View Unchanged
|
check the following places: - .nvmrc - riff-raff.yaml - Containerfile
e020058 to
6383812
Compare
|
would this work better as a commit hook that checks all those files if any of them appear in the list of changed files? |
What’s the benefit of a commit hook over a CI check? Is it only about how quickly the developer is informed of the error? Is there any risk that it could be disabled in certain contexts? |
yes, basically. if we're going to check something, why wait until last possible moment to check it?
not really, you'd have to work quite hard to get round husky while still finding a way to install NPM packages. that said, would it work better as part of |
|
I appreciate the suggestions, but the main issue is that would make Deno a hard requirement for contributors to commit on this codebase, which is not currently the case. Considering that at the current cadence LTS versions of Node are released at most once a year in late October, this proposal attempts to catch a bug which can only happen on very rare occasions. Ideally, I would leave further tweaks and refinements for @guardian/dotcom-platform to implement. |
if the idea is to catch a mistake, and mistakes are best caught as early as possible, then is deno the right technology to use here? our choice of technology should be guided by our requirements – this could be written in Node or bash without adding any new dependencies. i reckon we could also get away with a regex check in all 3 files, that should be enough? that way we can remove the dependencies of the current deno script too |
|
I implemented this quickly as a reaction to a chat thread that asked whether it would be technically feasible, but have little time to implement a different approach. If this PR is deemed unsatisfactory for any reason I’ll simply close it and let the team figure out a solution by end of April 2025.
My aim here was to maximise safety by using a strongly-typed and fully parsed approach. The issues with alternatives are as follows:
|
|
Closing in favour of an incoming pre-commit hook using a |
What does this change?
Compare node versions in
.nvmrc,riff-raff.yamlandContainerfileto ensure that they are aligned.Why?
Helps with updates such as #7948
Left as an exercise to the reader
Implement a check for
@types/node😉