OpenFn / OpenFn/adaptors

validate `configuration-schema.json`

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tooling
Dominant language
JavaScript
Stars
24
Forks
41
Avg merge
3d 13h
Merged PRs (30d)
12

Description

We should add a step somewhere in the build process to report an error if configuration-schema.json isn't found.

This will need designing. Not all adaptors have a credential schema so maybe it's a warning rather than an error.

This could be a build step in the build tools simply to check if the schema exists.

Alternatively, we could introduce a new validation tool (and this is probably where I lean, but with caveats). This could analyse either a built tarball or an adaptor's source. It should report on things like whether the adaptor has an ast.json, a docs folder and a configuration-schema.json. Maybe it could validate the package.json to ensure a standard build script etc.

In practice I'm a bit worried about this... what if there's an ast.json but it's an empty array because there's little or no jsdoc? What about packages which just don't have the schema yet? Should it throw warnings or prevent a build, merge or even release of the adaptor? Is this not just a human level thing to check in a PR before merging? In which case it's solved by #14.

It's probably more important to check that, if a schema file does exist in the repo, it also exists in the built tarball. Which points to a validation tool which runs on the built package. Which would be neat!

Simple ast already does a bunch of validation on docs. Could it inherit the responsibility?

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

Start by reviewing the proposed validation responsibilities around configuration-schema.json, ast.json, the docs folder, and package.json, including the existing validation performed by Simple AST and the approach in #14. Decide whether validation should inspect adaptor source or a built tarball, and whether missing files produce warnings or errors. Done means the chosen validation behavior is defined and consistently applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.