-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add more webhooks support #82
Conversation
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.
LGTM I especially appreciate the addition to the Readme.
I just had a thought about camelize
, but it's fine for me as well if you keep the current version.
|
||
private | ||
|
||
def camelize(term) |
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'm wondering if it would make sense to copy the Rails' implementation as that's what I'd expect most people using the gem are familiar with. Otherwise there might be subtle differences.
See https://apidock.com/rails/v6.1.3.1/String/camelize. Rails 7's is harder to read in my opinion: https://github.com/rails/rails/blob/de53ba56cab69fb9707785a397a59ac4aaee9d6f/activesupport/lib/active_support/inflector/methods.rb#L96.
Maybe it would also be nice to extract the function to a module as camelize
is a concept that makes sense for all parts of the app.
What do you think @eikes?
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.
It is in fact copied from rails 7 here: https://github.com/rails/rails/blob/de53ba56cab69fb9707785a397a59ac4aaee9d6f/activesupport/lib/active_support/inflector/methods.rb#L69
But I had to remove everything related to inflections. Finally I had to replace the $1 and $2, because rubocop didn't like that.
In general though, I'd prefer to use ActiveSupport, but I was told not to. What are your thoughts on using integrating ActiveSupport? It would let us remove some reimplementations like this and everyone uses it anyways...
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.
Huh. I looked at that method as well and didn't recognise it. Odd. I'd personally be Ok with ActiveSupport, but was also told not to use it and I'd stick with that. I think the next best option would be to have a module for "the stuff copied from Rails" with some comments and links to the original source.
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.
OK, let's create a Ioki::Support module after merging this!
Co-authored-by: Andreas Hellwig <a5308y@gmail.com>
Webhooks require a validation of the
x-signature
HTTP header which is implemented here.Additionally a helper class to convert the incoming webhook event into a Ioki::Webhooks::Model model is provided.