-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added Schedules restrictions with command who-s-on-call #117
Conversation
We would want to update the README file to document the new setting. |
@stephenyeargin README.md updated: 👍 |
src/scripts/pagerduty.coffee
Outdated
renderSchedule = (s, cb) -> | ||
withCurrentOncall msg, s, (username, schedule) -> | ||
if (username) | ||
messages.push("* #{username} is on call for #{schedule.name} - #{schedule.html_url}") | ||
if !allowed_schedules or (allowed_schedules and schedule.id in allowed_schedules) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could simpler:
if !allowed_schedules or schedule.id in allowed_schedules
Also, unless process.env.HUBOT_PAGERDUTY_SCHEDULES
is always defined, reading it can yield an undefined
value and split
is only defined for strings (iirc), so I would rewrite this as:
allowed_schedules = pagerDutySchedules?.split(",")
Depending on whether it is desired to treat empty pagerDutySchedules
as unspecified:
if !pagerDutySchedules?.length or schedule.id in allowed_schedules
which should probably be mentioned in the documentation as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a-palchikov is that okay now?
Released with |
Added PagerDuty rescrition option (basic feature) to restrict the
who's on call
command.Re: #109 (comment)