approvals / approvals/Approvals.NodeJS

Directory-level configuration

Open
#56 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
125
Forks
46
Avg merge
2m
Merged PRs (30d)
16

Description

We have a number of ways to specify configuration which drives approvals behavior.

One ideal piece of configuration I would like to get to would be project-level (err directory level) config files.

Say you have a test project that looks like this.

├───src
│       main.js
│
└───tests
    ├───folder1
    │       test1.js
    │
    └───folder2
            test2.js

Also say the approval tests in folder require different "configuration" than the rest of the project?

You can do this by passing a common configuration object at the verify method level like (.verify(__dirname, "test-file-name", "the thing to verify", {...config here...}); but I would like to at minimum see a project-level configuration where we can look up the folder-tree from the test for a .approvalsConfig file in hopes to allow for more configuration-over-explicit-coding (is that a term?).

Anyway, what if you could drop .approvalsConfig in the project like such:

│   .approvalsConfig           <--- project root config
│
├───src
│       main.js
│
└───tests
    ├───folder1
    │       .approvalsConfig    <--- folder specific config overrides root project config
    │       test1.js
    │
    └───folder2
            test2.js

This could allow for an overall project-level set of configuration, as well as the ability to override some configuration properties at a specific folder level.

Contributor guide

Open the contributing guide

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 tracing the verify method, especially how its configuration object is currently handled. Define how lookup should walk from a test’s folder toward the project root, how .approvalsConfig files override parent values, and how this should be validated against the folder1 and folder2 examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, typescript
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.