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

Adds an optional config section to the help ouput for bundles #1011

Merged
merged 1 commit into from
Oct 6, 2016

Conversation

mpeck
Copy link
Contributor

@mpeck mpeck commented Oct 5, 2016

This adds an optional config section to the help output for bundles. The section contains notes and a list of env vars. Both notes and env vars are optional.

Note that I didn't add the config section info to the bundle version model. I'm just pulling straight from the config file in the template. Since the data was already available in the config file and it's not used anywhere else right now, I figured that was the easiest solution.

Example config.yaml excert:

...
config:
  notes:
    The cfn bundle makes use of CloudFormation stack templates and stack policies that are
    defined in JSON documents and stored in pre-defined S3 locations. These locations are
    defined with the 'CFN_TEMPLATE_URL' and 'CFN_POLICY_URL' configuration variables.
  env:
    - var: AWS_REGION
    - var: AWS_ACCESS_KEY_ID
    - var: AWS_SECRET_ACCESS_KEY
    - var: AWS_STS_ROLE_ARN
      description: STS role ARN that should be assumed. Defined as 'arn:aws:iam::<account_number>:role/<role_name>'.
    - var: CFN_TEMPLATE_URL
      description: S3 Location of your stack templates. Defined as 's3://<bucket>/<path>'.
    - var: CFN_POLICY_URL
      description: S3 Location of your stack policies. Defined as 's3://<bucket>/<path>'.
...

Help output:
screen shot 2016-10-05 at 12 46 15 pm

resolves #948
depends on operable/spanner#77

@mpeck mpeck force-pushed the peck/config-section branch from 34e22b4 to 06d4224 Compare October 6, 2016 13:35
@@ -8,6 +8,13 @@ defmodule Cog.Chat.Slack.Templates.Embedded.HelpBundleTest do
"commands" => [%{"name" => "test-command",
"description" => "does just one thing"}],
"author" => "vanstee",
"config_file" => %{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little weird. I know we don't have a db column for this stuff, but it'd still be nice if we rendered it all as if it was one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. Are you saying that we should add virtual fields for the config bits? I don't think that would change the test here, would it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think I misunderstood what was going on here. But it still seems weird that we need access to the config_file in the template. I'd be happier if we rendered the config key in the json as if it was a normal model attribute. This is probably fine though.

~end~
~br~
~end~

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since config is typically "set and forget" I think it should probably go near the bottom. Maybe just above the homepage and author.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually why I put it at the top. I was thinking that the most important stuff was the command bits and I didn't want them to get pushed off the screen.

@mpeck mpeck merged commit 06d4224 into master Oct 6, 2016
@mpeck mpeck removed the review label Oct 6, 2016
@mpeck mpeck deleted the peck/config-section branch October 6, 2016 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include config section in bundle docs for env vars
2 participants