Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Add the ability to pass config data in as a flag #24

Merged
merged 25 commits into from
Nov 11, 2016
Merged

Conversation

emmahsax
Copy link

@emmahsax emmahsax commented Nov 9, 2016

Description and Impact

Give the option for passing config information in as a flag, instead of as a file.

Deploy Plan

Does Platform Operations need to know anything special about this deploy? Are migrations present?

Rollback Plan

  • To roll back this change, revert the merge with: git revert -m 1 MERGE_SHA and perform another deploy.

URLs

Links to bug tickets or user stories.

QA Plan

  • GLI_DEBUG=true bin/sport-ngin-aws-auditor audit --config_hash="{:slack=>{:username=>\"AWS Auditor\", :icon_url=>\"http://i.imgur.com/86x8PSg.jpg\", :channel=>\"#[slack channel]\", :webhook=>\"[a valid webhook url]"}}" -s [account] and see this work!
  • GLI_DEBUG=true bin/sport-ngin-aws-auditor audit [account] to just make sure it works when using a config file

@emmahsax emmahsax changed the title Add the ability to pass the channel in as a flag Add the ability to pass config data in as a flag Nov 10, 2016
@@ -7,6 +7,7 @@
c.switch [:r, :reserved], :desc => "Shows reserved instance counts"
c.switch [:i, :instances], :desc => "Shows current instance counts"
c.flag [:t, :tag], :default_value => "no-reserved-instance", :desc => "Read a tag and group separately during audit"
c.flag [:h, :config_hash], :default_value => nil, :desc => "Print the audit according to this config hash instead of to config file"

Choose a reason for hiding this comment

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

that should probably be json

Choose a reason for hiding this comment

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

Hmm this should somehow describe that it's json. I sort of think we should change the name maybe config_json or j

end
end

def perform
if SportNginAwsAuditor::Config.slack
if SportNginAwsAuditor::Config.slack || config_hash

Choose a reason for hiding this comment

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

seems like we should merge these together with the config_hash options overriding the config file

@@ -2,23 +2,30 @@

module SportNginAwsAuditor
class NotifySlack
attr_accessor :text, :channel, :webhook, :username, :icon_url, :icon_emoji, :attachments
attr_accessor :text, :channel, :webhook, :username, :icon_url, :icon_emoji, :attachments, :config_hash

Choose a reason for hiding this comment

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

Hmm seems like config is an ok name not sure hash really adds anything

@anfleene
Copy link

CR looks good 👍

@anfleene
Copy link

Regression QA is good. Just need to test passing in the config

@anfleene
Copy link

The new config option works as well 👍

@production-status-check
Copy link

:octocat: Has QA approval

@emmahsax emmahsax merged commit d7403ce into master Nov 11, 2016
@emmahsax emmahsax deleted the add-channel-option branch December 14, 2016 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants