You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am sometimes getting a ERROR: error getting current Parameters section from README when using the precommit hook given in the README.
Problem
I experienced precommit running in parallel multiple instance of the javascript code in some setup.
Because it was running several times in parallel, I sometimes ended up with a failing job (race condition ?):
INFO: Inserting the new table into the README...
INFO: Checking missing metadata...
INFO: Metadata is correct!
INFO: Found parameters section at line: 3
INFO: The parameters section seems to be the last section in the file
INFO: Last parameter table line found at line: 190
chart/README.md # console.log(readmeFilePath)
[ 3, 190 ] # console.log(paramsSectionLimits);
INFO: Inserting the new table into the README...
INFO: Checking missing metadata...
INFO: Metadata is correct!
chart/README.md # console.log(readmeFilePath)
[] # console.log(paramsSectionLimits);
ERROR: error getting current Parameters section from README. Limits: 0
/home/lacroix/.cache/pre-commit/repodm9qdawz/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/lib/render.js:123
throw new Error('ERROR: error getting current Parameters section from README');
^
Error: ERROR: error getting current Parameters section from README
at insertReadmeTable (/home/lacroix/.cache/pre-commit/repodm9qdawz/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/lib/render.js:123:11)
at runReadmeGenerator (/home/lacroix/.cache/pre-commit/repodm9qdawz/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/index.js:59:7)
at Object.<anonymous> (/home/lacroix/.cache/pre-commit/repodm9qdawz/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/bin/index.js:22:1)
at Module._compile (node:internal/modules/cjs/loader:1375:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
at node:internal/main/run_main_module:28:49
I added some console.log to the code to see what’s going on.
Solution
On the client side, just add some hook options solves the problem:
Hello, I am sometimes getting a
ERROR: error getting current Parameters section from README
when using the precommit hook given in the README.Problem
I experienced precommit running in parallel multiple instance of the javascript code in some setup.
Because it was running several times in parallel, I sometimes ended up with a failing job (race condition ?):
I added some console.log to the code to see what’s going on.
Solution
On the client side, just add some hook options solves the problem:
This prevent precommit to run multiple times (see (see pre-commit/pre-commit#1636).
We should update the README.md to add this options to the hook.
The text was updated successfully, but these errors were encountered: