Auto: Strictly validate autorc config before any release

Created on 6 Jan 2019  ·  10Comments  ·  Source: intuit/auto

Is your feature request related to a problem? Please describe.

A few of us at Artsy are working on migrating a lot of repos over to use auto-release. In a batch session, I somehow managed to mess up the config and used noReleaseLabels instead of skipReleaseLabels on several of the projects. This caused some unnecessary releases.

Describe the solution you'd like

I think the config should be strictly validated. If there are values present that aren't a part of the config (i.e. noReleaseLabels), the release process should fail. Invalid configuration likely means someone is in for a bad time. Similarly if a config object doesn't match an expected type, etc. It seems like there's a start to a json schema that could be used for this purpose (auto-rc.json).

Describe alternatives you've considered

If you want to take a lighter approach I'd recommend at the very least having a validate command that checks the validity of the configuration.

enhancement hacktoberfest released

Most helpful comment

I'm all about both of those things. I can work on this, but it'll have to wait until the weekend. I'm gonna take it easy tonight, ha. I'll see if I can set up the typescript interface to json-schema process. Don't think it'll be too hard. Hardest part is really just figuring out what should go in the schema.

All 10 comments

I'm working through creating a schema via quicktype.

https://app.quicktype.io?share=vgnvzBMgaixe5c9qUCD2.

It actually also generates code to automatically validate it... https://app.quicktype.io?share=yxg2tubeMvnazWyklgkz. We could use something like that?

Probably shouldn't build something if it requires a human accessing an external website IMO, in Danger I generate JSON schemas from TypeScript types via a node module and automate them on deploys, then it'll never get out of sync

I like that
On Tue, Jan 8, 2019 at 5:54 AM Orta notifications@github.com wrote:

Probably shouldn't build something if it requires a human accessing an
external website IMO, in Danger I generate
https://github.com/danger/danger-js/blob/master/package.json#L60 JSON
schemas
https://github.com/danger/danger-js/blob/master/source/danger-incoming-process-schema.json
from TypeScript types via a node module and automate them on deploys, then
it'll never get out of sync


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/intuit/auto-release/issues/143#issuecomment-452306127,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIyBDiYG4uWFKH6IdjG862e1UPEQCr3ks5vBKMugaJpZM4ZyUU6
.

quicktype is an npm package, it just has a web interface too. I agree, it should be automated.

can it take a TS interface and create a JSON schema? that would be awesome

looks like your quicktype links do what i'm describing. that's so cool! Making this part of our release process would be pretty cool.

Maybe we could even make a plugin to do publishing as a VSCode extension

I'm all about both of those things. I can work on this, but it'll have to wait until the weekend. I'm gonna take it easy tonight, ha. I'll see if I can set up the typescript interface to json-schema process. Don't think it'll be too hard. Hardest part is really just figuring out what should go in the schema.


:rocket: Issue was released in v9.15.0 :rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sethomas picture sethomas  ·  5Comments

bbrinx picture bbrinx  ·  8Comments

aleclarson picture aleclarson  ·  9Comments

thuringia picture thuringia  ·  14Comments

theAdhocracy picture theAdhocracy  ·  6Comments