Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

WIP: Custom config support #8

Closed
wants to merge 8 commits into from
Closed

WIP: Custom config support #8

wants to merge 8 commits into from

Conversation

z0al
Copy link
Owner

@z0al z0al commented Feb 28, 2018

This PR adds support for custom commitlint configuration (i.e. .commitlint.yml, .commitlint.json ..etc) by proposing a new workflow inspired by code coverage services (e.g. CodeCov)

Workflow

  • Whenever new commits pushed to a pull request we queue the request by saving its payload to Redis-backed In-memory storage.
  • Then we report back to GitHub that we are waiting for configs to be uploaded (state => pending)
  • We should provide a script that runs inside a CI environment and reports the configs to our backend. E.g. in Travis we would add something like this:
after_success:
    - npx commitlint-config-uploader ...
  • The script mainly runs commitlint CLI and passes --format=json flag (thanks to @marionebl) (marionebl/commitlint#169) to get fully resolved configuration as JSON, then it uploads those configs in addition to some other info e.g pull request number, repository slug ..etc.

  • Once uploaded, the app will dequeue the original request (currently we use commit SHA as an identifier) and restore its payload + the uploaded configs.

  • Now we do the actuall linting and report the final status back to GitHub

That the general idea, but feel free to ask questions if something isn't clear (I was sleepy when I wrote this description :p ).

Also, this still a work-in-progress and I'm open for suggestions and improvements!

Todos

  • Get/Set wrapper for our store
  • Basic upload API (/api/upload)
  • Trigger linting on upload
  • CLI script (to be used inside e.g. Travis CI, Circle CI ..etc) to upload configurations.
  • General refactoring
  • Testing

Resolves #1

/cc @caarlos0 @paulirish @marionebl and @ you for feedback

@z0al z0al closed this Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: custom configuration
1 participant