Giter Site home page Giter Site logo

Comments (6)

johnseekins-pathccm avatar johnseekins-pathccm commented on September 2, 2024 1

Looks promising:

hubot-dev> @hubot-dev pager me Incident Commander Secondary 5
{"level":20,"time":1712238728522,"pid":19547,"hostname":"John-Seekins-MacBook-Pro-16-inch-2023-","name":"hubot-dev","msg":"Message '@hubot-dev pager me Incident Commander Secondary 5' matched regex //^\\s*[@]?hubot\\-dev[:,]?\\s*(?:pager( me)? (?!schedules?\\b|overrides?\\b|my schedule\\b)(.+) (\\d+)$)/i/; listener.options = { id: null }"}

from hubot-pager-me.

stephenyeargin avatar stephenyeargin commented on September 2, 2024 1

Released with v4.0.3

from hubot-pager-me.

stephenyeargin avatar stephenyeargin commented on September 2, 2024

Tagging #49, because it would make it a lot easier to debug if we could put a test case around it.

So what I think is happening is that it is looking up an incident named "Commander 5". I don't think that's what you intended. Either way, it shouldn't bomb out when it can't find a matching incident. Going to knock that out.

hubot pager schedule Incident Commander 5 may be more what you're looking for.

from hubot-pager-me.

johnseekins-pathccm avatar johnseekins-pathccm commented on September 2, 2024

hubot pager schedule <schedule> [days] - show <schedule>'s shifts for the next x [days] (default 30 days)

vs.

hubot pager me <schedule> <minutes> - take the pager for <minutes> minutes

Those seem to do very different things.

Is the take away from this issue that this plugin can't support overriding PagerDuty schedules with names that start with "Incident"? It seems like ensuring regexes in the plugin are case sensitive would address my issue...

from hubot-pager-me.

stephenyeargin avatar stephenyeargin commented on September 2, 2024

Ah, I track now. One reason to keep the commands case insensitive is because we've all goofed up when typing something in a hurry. What I think we can do, though, is address the inadvertent collision between the commands.

robot.respond(/(pager|major)( me)? incident (.*)$/i, function (msg) {
msg.finish();

This is a rather greedy regex. The only two formats an incident ID can take are \w+ or \d+, with the latter being the more likely of the two used in chat. L96 tells the processor to stop looking for anything else. Because the schedule lookup is registered after the incident lookup, it never falls through to it.

Aside from the fix in #224 to keep the bot from crashing, tightening up that line would likely resolve the issue you're seeing.

from hubot-pager-me.

stephenyeargin avatar stephenyeargin commented on September 2, 2024

@johnseekins-pathccm Try out 4fc0cdf

from hubot-pager-me.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.