codequality: make our dependency on jq < 182MiB
Our .gitlab-ci.yml
has this job:
codequality:
<<: *except-docs
<<: *pull-cache
stage: test
image: docker:latest
# ...
script:
- ./scripts/codequality analyze -f json > raw_codeclimate.json || true
# The following line keeps only the fields used in the MR widget, reducing the JSON artifact size
- cat raw_codeclimate.json | docker run -i stedolan/jq -c 'map({check_name,description,fingerprint,location})' > codeclimate.json
artifacts:
paths: [codeclimate.json]
expire_in: 1 week
That second script link jq
is a 24KiB binary. We're downloading a 182MiB docker image to run it. And since this is dind, I believe we're doing that every single time.
A few alternatives:
- We could remove the jq dependency by including a small script for whatever interpreters the
docker:latest
image includes - We could build a custom image off
docker:latest
that comes withjq
installed - We could switch to an image that contains
jq
but is "only" 12MiB, e.g. https://hub.docker.com/r/pinterb/jq/