-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fixes #37319 - Allow setting IDs for outputs #135
Conversation
@@ -37,18 +37,20 @@ def humanize | |||
raw_outputs.map { |output| output['output'] }.join("\n") | |||
end | |||
|
|||
def add_exception(context, exception, timestamp = Time.now.getlocal) | |||
add_output(context + ": #{exception.class} - #{exception.message}", 'debug', timestamp) | |||
def add_exception(context, exception, timestamp: Time.now.getlocal, id: nil) |
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.
Isn't this an API change?
def add_exception(context, exception, timestamp = 'now')
puts timestamp
end
def add_exception_new(context, exception, timestamp: 'now')
puts timestamp
end
add_exception('a', 'b')
add_exception('a', 'b', 'explicit')
add_exception_new('a', 'b')
add_exception_new('a', 'b', 'explicit')
$ ruby test2.rb
now
explicit
now
test2.rb:5:in `add_exception_new': wrong number of arguments (given 3, expected 2) (ArgumentError)
from test2.rb:13:in `<main>'
Or do you accept it since it only appears to be used internally.
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.
While this isn't strictly private api, none of the smart proxy plugins which depend on sp-dynflow seem to use this, so I'd be willing to let it slide.
def add_output(*args, **kwargs) | ||
add_raw_output(self.class.format_output(*args, **kwargs)) |
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.
Would it make sense to also just forward the arguments here?
def add_output(*args, **kwargs) | |
add_raw_output(self.class.format_output(*args, **kwargs)) | |
def add_output(...) | |
add_raw_output(self.class.format_output(...)) |
and switch runner output interface to be keyword based.
and switch runner output interface to be keyword based.