Skip to content

Use node instead of jq to parse values from REPOSITORY_SETTINGS#386

Open
davisagli wants to merge 1 commit into
mainfrom
remove-jq
Open

Use node instead of jq to parse values from REPOSITORY_SETTINGS#386
davisagli wants to merge 1 commit into
mainfrom
remove-jq

Conversation

@davisagli
Copy link
Copy Markdown
Member

Avoids undocumented dependency on jq

Fixes #382

@ericof
Copy link
Copy Markdown
Member

ericof commented Apr 14, 2026

I think the better solution here is to document the need of jq being installed -- and add this check to pre_prompt.py hook

The same pattern of using jq is also present on the ci templates, and I would prefer not to have two patterns of extracting this information.

@davisagli
Copy link
Copy Markdown
Member Author

@ericof I disagree. Requiring another program to be installed adds burden on the developer using the template. And it's obviously very easy to do this with Node instead of jq.

@davisagli
Copy link
Copy Markdown
Member Author

davisagli commented Apr 14, 2026

To be honest, adding a dependency on jq here was a breaking change that we did not notice. If we keep it, the docs about prerequisites need to be updated. (e.g. https://6.docs.plone.org/install/create-project-cookieplone.html#prerequisites-for-installation). I will not do that myself, since it would require researching the best way to install it on each OS. I thought what I proposed in this PR is simpler.

@yurj
Copy link
Copy Markdown

yurj commented Apr 15, 2026

This PR run the same code multiple times. Can this be compacted in a single place? Than it will be easier to find better solutions (from grep -Po to uv run -).

By myself, I would use uv:
uv run - <<EOF
import json
print(json.loads(os.environ['REPOSITORY_SETTINGS']))
EOF

Fun note: uv run is faster than jq for this task :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make install fails on the addon template when jq is not installed

3 participants