Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to use a jq module for custom functions in jq-template #84

Conversation

LaurentGoderre
Copy link
Member

@LaurentGoderre LaurentGoderre commented Sep 29, 2023

This works by creating a ./jq-template.jq at the same level as the jq-template.awk. A standard jq-template.jq can then be pulled which contain shared function or templates to use across DOI

If checks at the same location as the awk file for a jq module called jq-template.jq. If the modules it loads it to extend the templating function with custom jq functions and filters

@codecov-commenter
Copy link

Codecov Report

Merging #84 (d7dab48) into master (6334a4f) will not change coverage.
Report is 2 commits behind head on master.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##           master      #84   +/-   ##
=======================================
  Coverage   73.10%   73.10%           
=======================================
  Files           7        7           
  Lines         714      714           
=======================================
  Hits          522      522           
  Misses        162      162           
  Partials       30       30           

@LaurentGoderre LaurentGoderre changed the title Add the ability to jq template to use modules for custom functions Add the ability to use a jq module for custom functions in jq-template Oct 2, 2023
@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2023

I'm not certain we should auto-include other jq files. I think that if each repo's apply-templates scripts will already need to opt-in to grab an extra jq helper functions file, then it'd be better to just make them also include it in their Dockerfile templates that use it. It'll make it clearer where any extra functions that aren't defined locally come from.

We have a repo-local shared.jq file used across multiple templates in docker: cli, dind, and dind-rootless.

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.

3 participants