Skip to content
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

Closed
zephraph opened this issue Jan 6, 2019 · 10 comments · Fixed by #998
Closed

Strictly validate autorc config before any release #143

zephraph opened this issue Jan 6, 2019 · 10 comments · Fixed by #998
Labels
enhancement New feature or request hacktoberfest released This issue/pull request has been released.

Comments

@zephraph
Copy link
Collaborator

zephraph commented Jan 6, 2019

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.

@zephraph zephraph added the enhancement New feature or request label Jan 6, 2019
@orta
Copy link
Contributor

orta commented Jan 7, 2019

Jest has a JSON config validator - https://github.com/facebook/jest/tree/master/packages/jest-validate#jest-validate

@zephraph
Copy link
Collaborator Author

zephraph commented Jan 7, 2019

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?

@orta
Copy link
Contributor

orta commented Jan 8, 2019

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

@hipstersmoothie
Copy link
Collaborator

hipstersmoothie commented Jan 8, 2019 via email

@zephraph
Copy link
Collaborator Author

zephraph commented Jan 8, 2019

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

@hipstersmoothie
Copy link
Collaborator

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

@hipstersmoothie
Copy link
Collaborator

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

@zephraph
Copy link
Collaborator Author

zephraph commented Jan 9, 2019

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.

@adierkens
Copy link
Collaborator

🚀 Issue was released in v9.15.0 🚀

@adierkens adierkens added the released This issue/pull request has been released. label Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants