lambdaisland / lambdaisland/kaocha

Pre-validate config

Open
#219 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ergonomics onboarding
Dominant language
Clojure
Stars
860
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Certain configuration mistakes still cause rather unhelpful error messages, because we validate the config after normalizing it, so errors during normalization aren't cleanly handled.

Case in point, I just accidentally did this

#kaocha/v1
{:tests {:id :cljs
         :type :kaocha.type/cljs}}

Which should have been

#kaocha/v1
{:tests [{:id :cljs :type :kaocha.type/cljs}]}

Which gave me this error

Execution error (IllegalArgumentException) at meta-merge.core/meta-merge (core.cljc:100).
Don't know how to create ISeq from: clojure.lang.Keyword

Full report at:
/tmp/clojure-7895642946752562024.edn

This one's a bit annoying because we do have specs for config maps, but they only apply after normalization, adding defaults, renaming non-qualified keys etc. We'll need seperate specs (or a different validation strategy) if we want to validate the raw tests.edn.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the malformed tests.edn configuration and trace the existing config specs and normalization step. Determine how raw configuration can be validated before normalization, then confirm that the example produces a clear validation error instead of the meta-merge exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.