-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Pass alias in Robot constructor. Fixes issue #1002. #1003
Pass alias in Robot constructor. Fixes issue #1002. #1003
Conversation
Based on what I see, I like it. I'm not too familiar with this part of the code though. I'll try to find time to read through and gain context... |
This makes sense to me. One thought was about what else might be touching The other thought was that adding more parameters to the constructor, might be time to pass in an object rather than an array of parameters, but that can be a later refactoring. |
Nope :) That behavior is unchanged. You'd be getting That's because the new signature of the constructor is: On passing object to the constructor: That's an excellent idea for refactoring but I have one concern: |
@sdimkov I was being a bit verbose to try to demostrate the type of things I look for in changes, but yeah, my conclusion was that it didn't change anything 😁
They will be pretty few and far between. hubot-mock-adapter is the only one that comes to mind. Probably could do some trickery with checking the |
Okay, maybe we can merge this now ? I don't mind writing the object-based constructor but that should be a separate PR. |
…structor Conflicts: src/robot.coffee
Guys, it's sad to see this still being open. I don't understand why fixing bugs is such a low priority here. I personally believe that stability and polish are at this point far more important than adding a new feature X or Y. Is there anything more I can do to get this merged? |
Yeah, I know... We're all just a little short on free time 😓 I think this looks good as-is, with the one possibility of adding a test case for the default alias state. What do you think @technicalpickles? |
Pass alias in Robot constructor. Fixes issue #1002.
This PR enables passing alias to robot's constructor. It fixes #1002. It also does not disturb in any way any existing 3rd party code as it doesn't change the behavior of robot's constructor without the extra param being passed.
But why?
Because both Robot name and alias should be provided during creation of the robot. In the current design they can not be changed later and are hard-coded into every listener's regex. Therefore modifying alias or name after the robot is created is wrong and could cause problems.