Skip to content

Refactor triggers to its own class#51

Merged
burmanm merged 2 commits intohawkular:masterfrom
burmanm:refactor_alerts
Oct 9, 2017
Merged

Refactor triggers to its own class#51
burmanm merged 2 commits intohawkular:masterfrom
burmanm:refactor_alerts

Conversation

@burmanm
Copy link
Copy Markdown
Contributor

@burmanm burmanm commented Oct 8, 2017

Also:

  • Implement status() method
  • In tests: assertItemsEqual to avoid order errors

Tested with 2.0.0.Final-SNAPSHOT

@rubenvp8510 Or did you have some better way than .triggers() in mind?

Implement status() method

assertItemsEqual to avoid order errors
@rubenvp8510
Copy link
Copy Markdown
Contributor

overall looks good, I left some comments on the PR,

Just one question, if you are testing with 2.0.0.Final-SNAPSHOT, Do you think it worth to update the Travis to test against that version of hawkular?

@burmanm
Copy link
Copy Markdown
Contributor Author

burmanm commented Oct 9, 2017

I can't see any of your comments? As for the Alerts, yes.. I'd say it should be updated (I used the newest docker image). Since that's the target for new versions in any case

Comment thread hawkular/alerts/common.py Outdated

super(HawkularAlertsClient, self)._setup_path()

def triggers(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why have a method that returns a new instance of AlertsTriggerClient each time it's invoked? This could be just a property with the instance assigned, and it could be used likehawkularclient.triggers.<whatever_triggers_method>instead of hawkularclient.triggers().<whatever_triggers_method> IMHO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, there's no reason to create a new one each time (not that it matters as it does not store any state).

Yeah, I guess triggers.function() would make more sense, I'll change it to that one too

@burmanm burmanm merged commit 5551a35 into hawkular:master Oct 9, 2017
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.

2 participants