这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Conversation

@csm
Copy link

@csm csm commented Oct 14, 2014

Before, the simianarmy.calendar.isMonkeyTime could have three states: true, false, or unset. If unset, the property is ignored; if true, it's always monkey time; if false, it's never monkey time.

Arguably, given the documentation, this is the correct behavior.

Before, the `simianarmy.calendar.isMonkeyTime` could have *three* states: true, false, or unset. If unset, the property is ignored; if true, it's always monkey time; if false, it's never monkey time.

Arguably, given the documentation, this is the correct behavior.
@cloudbees-pull-request-builder

SimianArmy-pull-requests #154 SUCCESS
This pull request looks good

@ebukoski
Copy link
Contributor

From the wiki, setting simianarmy.calendar.isMonkeyTime=false is a setting intended to prevent the Monkeys from running at any time of day. This PR would change that behavior and reduce current functionality.

I'm missing where the code or documentation is in error on this.

@csm
Copy link
Author

csm commented Jul 22, 2015

No, I think this change is in support of what the docs say.

The documentation implies that there are three states for that property:

  1. Set to true, it is always monkey time, no matter if it is business hours or not.
  2. Set to false, it is never monkey time, no matter the hour.
  3. If not set, it is monkey time based on the calendar config.

This was a problem for us, because we removed the simianarmy.calendar.isMonkeyTime=true line from our config files, and the monkeys never ran. If we kept it there, they always ran, even if it wasn't business hours. IIRC, it interpreted the bool as false if the property wasn't set.

@ebukoski
Copy link
Contributor

Interesting, we don't have isMonkeyTime set and it runs without this change. Maybe isMonkeyTime=false was sneaking in from somewhere else?

Can you write a test that demonstrates what is fixed?

@csm
Copy link
Author

csm commented Jul 22, 2015

I can try coming up with a test. But also, look at the code. As long as cfg is non-null, the rest of the isMonkeyTime function never executes. I think the cfg field is always non-null, at least if everything is constructed properly.

IIRC, this calendar is used by certain monkeys (I forget which ones; I know we use JanitorMonkey more than anything else, and that we tried getting unused volume deletion running). For your use case it might not affect you, but the code simply looks wrong to me.

@csm
Copy link
Author

csm commented Jul 22, 2015

Actually, I'm confused now. This might have been my mistake (it was a while ago).

@csm csm closed this Jul 22, 2015
@ebukoski
Copy link
Contributor

ebukoski commented Dec 4, 2015

Circling back on this, I finally understood the context of the original request. There really are three states associated with isMonkeyTime. PR #224 is basically the same as this one with some debug logging.

Thanks for the contribution and apologies for the delays.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants