diff options
author | miripiruni <miripiruni@yandex-team.com> | 2023-09-14 18:09:12 +0300 |
---|---|---|
committer | miripiruni <miripiruni@yandex-team.com> | 2023-09-14 18:45:25 +0300 |
commit | 62d6fc989b5a722ebc8c7713a4ca9207341571bd (patch) | |
tree | b73e570188a4179c5690f1e703e38c402f7a4a6a | |
parent | ee4fc23004e0289f61db3af94ec7e2773323aa1f (diff) | |
download | ydb-62d6fc989b5a722ebc8c7713a4ca9207341571bd.tar.gz |
feat: check Node.js version
Изменения согласно анонсу
1. До изменений: пользователь видел [неочевидную ошибку при попытке использовать Node.js 12 и ниже](https://jing.yandex-team.ru/files/miripiruni/Screenshot%202023-09-14%20at%2013.03.15.png).
2. После изменений: при попытке использовать Node.js 12 и ниже [сборка падает с ошибкой конфигурации](https://jing.yandex-team.ru/files/miripiruni/Screenshot%202023-09-14%20at%2013.01.36.png).
3. После изменений: при попытке использовать Node.js 14 и 16 сборка [кидает WARN](https://jing.yandex-team.ru/files/miripiruni/Screenshot%202023-09-14%20at%2012.57.49.png).
-rw-r--r-- | build/plugins/nots.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build/plugins/nots.py b/build/plugins/nots.py index f6363dfd6f..385e82783f 100644 --- a/build/plugins/nots.py +++ b/build/plugins/nots.py @@ -138,6 +138,23 @@ def on_from_npm_lockfiles(unit, *args): unit.message(["WARN", "on_from_npm_lockfiles exception: {}".format(e)]) pass +def _check_nodejs_version(unit, major): + if major < 14: + raise Exception( + "Node.js {} is unsupported. Update Node.js please. See https://nda.ya.ru/t/joB9Mivm6h4znu".format( + major + ) + ) + + if major < 18: + unit.message( + [ + "WARN", + "Node.js {} is deprecated. Update Node.js please. See https://nda.ya.ru/t/joB9Mivm6h4znu".format( + major + ), + ] + ) @_with_report_configure_error def on_peerdir_ts_resource(unit, *resources): @@ -148,6 +165,8 @@ def on_peerdir_ts_resource(unit, *resources): nodejs_version = _select_matching_version(erm_json, "nodejs", pj.get_nodejs_version()) + _check_nodejs_version(unit, nodejs_version.major) + for tool in resources: if tool == "nodejs": dirs.append(os.path.join("build", "platform", tool, str(nodejs_version))) |