-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strictly validate autorc config before any release #143
Comments
Jest has a JSON config validator - https://github.com/facebook/jest/tree/master/packages/jest-validate#jest-validate |
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 ***@***.***> 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
<#143 (comment)>,
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. |
🚀 Issue was released in |
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 ofskipReleaseLabels
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.The text was updated successfully, but these errors were encountered: