Generate compass.yml file
Asked by Dmitry Pashkevich:

I'm currently trying out compass. I like how I can quickly create and configure components via a point-and-click UI. I also appreciate the configuration-as-code support and using compass.yml as a source of truth, which we'd probably want to do in the long run. However, manually crafting the [compass.yml](https://developer.atlassian.com/cloud/compass/config-as-code/structure-and-contents-of-a-compass-yml-file/) file from scratch can be tedious (especially generating/looking up those long component/team ids). I'd love the ability to do the initial component configuration via the Compass UI, and then use a feature to "Generate compass.yml" and switch to config-as-code at that point. Is that somethign that the team has considered?


Answers:
author: Henry Olson
body: Hi [@Dmitry Pashkevich](/t5/user/viewprofilepage/user-id/1805098) and [@Orlando Kelly](/t5/user/viewprofilepage/user-id/4172792) ! Thanks for the feedback. This is actually possible in the current state, it's just a little tricky to find :)  

First, you'll want to install an SCM integration in the Apps page (Bitbucket, GitHub, or GitLab). Once that's installed and configured, you'll be ready to manage compass.yml files in external repos. On any component, click the "Config as Code" tab in the lefthand bar, and you'll be given a page of instructions, including a copyable compass.yml based on that component's data. For example:  

![Screen Shot 2022-07-07 at 9.52.42 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/205042iEEBD098F5F7D6D80/image-size/large?v=v2&px=999 "Screen Shot 2022-07-07 at 9.52.42 AM.png")  

You can then copy and paste this file into your repository. Once that change is merged, the component should be "managed by compass.yml" and UI changes will be locked down. Hope this helps!  

Henry

comments: author: Dmitry Pashkevich
body: Ah, I see, thanks for pointing that out! I haven't set up the SCM integration because I'm not an org admin in our GitHub account, so I didn't have access to the feature.


author: Richard Simpson
body: It might be a stretch, but when that's integrated is there a chance a feature will be added to "commit" the generated config? Rather than having to checkout and add.


author: Henry Olson
body: [@Dmitry Pashkevich](/t5/user/viewprofilepage/user-id/1805098) That's a good point - as a non-admin, would you find it useful to be able to start adding compass.yml files even before the integration is set up? I think if you just _install_ the GitHub app without configuring it, it should let you access the Config-as-Code screen, but the UI fields won't be locked down and the system won't sync compass.yml changes back to the UI until the integration is actually configured.  

[@rich](/t5/user/viewprofilepage/user-id/783237) Once you've set up your SCM integration, you can Import repos as Compass Components, and you can select an option to have it auto-generate a compass.yml file for each imported repo. The app will actually raise a PR in the repo to add it. But that only works on new repo import. [@Dave Parrish _Atlassian_](/t5/user/viewprofilepage/user-id/853503) - it would be cool if there was a button to raise a compass.yml PR for an existing component :D


author: Richard Simpson
body: [@Henry Olson](/t5/user/viewprofilepage/user-id/3854038) is that a new feature? Does that support GitHub? That's entirely news to me I admit, and very awesome!


author: Dmitry Pashkevich
body: [@Henry Olson](/t5/user/viewprofilepage/user-id/3854038) yes, I think it would help discoverability of the feature. I was originally expecting the option to view compass.yml to be here:

![Clipboard 1.png](https://community.atlassian.com/t5/image/serverpage/image-id/205063i8121393E6B8823FF/image-size/large?v=v2&px=999 "Clipboard 1.png")

I also see how where the feature is placed today is appropriate: you'd only want to copy-paste the generated code when setting up config-as-code and VCS integration. There is just no indication that yml code generation *will* be available when you get to that step. So I assumed it's not possible when evaluating Compass.


author: Henry Olson
body: [@Richard Simpson](/t5/user/viewprofilepage/user-id/2907666) Actually, I just checked and the create PR feature is only available in Bitbucket right now. I believe we have plans to enable it for GitHub, but I'll raise it again with our team.  

[@Dmitry Pashkevich](/t5/user/viewprofilepage/user-id/1805098) That's great feedback, I really appreciate it! I think we could definitely consider exposing the pre-generated compass.yml earlier in the flow. If you have compass.yml files in your repos and then set up an SCM integration later, they should automatically become "managed by compass.yml."


author: Luis Plaza
body: Hi! I use compass.yml but I only see as automatically populated metrics the "Deployment Frequency" and "PR Cycle Time" but not the "Build Success Rate" and others. Is there something I have to do?


author: Orlando Kelly
body: Great Idea, I would second this.