Schema file for `atlantis.yaml`
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- [ ] I'd be willing to implement this feature (contributing guide)
Describe the user story
As a developer, I'd like to have intellisense on the atlantis.yaml file, and a schema file available to validate changes are correct, for example using pre-commit hooks before a file is pushed
Describe the solution you'd like
I would like a json schema published of the fields one can set for the atlantis.yaml file
Describe the drawbacks of your solution
Maintaining and updating the schema file would rely on somehow getting all the schemas out of server/config/core/raw and in to a json file: https://github.com/runatlantis/atlantis/tree/fb91fafcb8db44f1f4416027128e5be8957c4914/server/core/config/raw
Any updates to this file would mean backwards compatibility is potentially broken, so some form of versioning would need to be maintained. It could follow the release cycle of Atlantis
Describe alternatives you've considered
Feeding a bunch of Atlantis files to some AI and having it produce a schema file for me, but I'd like to see a first party solution
That’s a great idea — having a published schema would definitely help with validation. It could also open the door for an IDE extension that provides intellisense/autocomplete directly in atlantis.yaml, similar to how Kubernetes manifests benefit from schema-aware tooling. Would such an IDE extension be helpful to you?
Absolutely 100x over it would be a great extension to have!!
So far I've beaten the AI in to making a schema based off the documentation provided on the site: https://gist.github.com/userbradley/794a9ffa4af40f9705b4fce03a6daa2d
And that works for pre-commit
CUE can be used as the source of truth for defining the schema and from it you can generate go structs and jsonschema. Using the schema as the source of truth would prevent drift.
CUE also allows to publish schemas into a registry and it is the means I currently generate and validate K8s and Argo Workflows YAML manifests.
I've used https://github.com/omissis/go-jsonschema in another project, you can run a command line pointing at the schema file and it creates all the types and has hooks so you can run validation as well, that might be an interesting way forward