-
Notifications
You must be signed in to change notification settings - Fork 7
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
create GenServer process to merge errors together #134
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
==========================================
+ Coverage 98.32% 98.64% +0.31%
==========================================
Files 23 26 +3
Lines 179 221 +42
==========================================
+ Hits 176 218 +42
Misses 3 3
Continue to review full report at Codecov.
|
@moduledoc """ | ||
join rules together when necesssary: | ||
- in-progress label added: combine no_assignee with no_estimation | ||
- multiple reviewers added: combine add assignees rule |
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'll implement this (combine reviewers errors) on another PR, this one is full enough I think
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.
Code looks great @SimonLab
nil | ||
iex>get_error_by_type([%{error_type: "type_1"}], "type_1") | ||
%{error_type: "type_1"} | ||
""" |
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 like this. Very helpful 👍
iex>get_id(%{"repository" => %{"full_name" => "repo"}, "issue" => %{"number" => 42}}) | ||
"repo/42" | ||
""" | ||
def get_id(payload) when is_map(payload)do |
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.
Nice use of guard 👍
I should have asked this earlier @SimonLab, better late than never. How should we be going about testing the code to make sure it works (besides the tests)? What is the way you would recommend that we go about manually testing these prs? |
@Shouston3 your question remind me that I need to update the doc for this 👍 I'll update the doc soon like this you should be able to do some manual testing if you want. |
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.
@SimonLab already looks great! assign when you think it's ready. 👍
This PR needs a bit more work. dwylbot/web/controllers/processes/merge_errors.ex Lines 33 to 41 in d26e9f7
To resolve this we need to add another check on the merge function to check the origin of the errors. |
ref: #92 (how to combine multiple dwylbot comments)
this PR also provide the structure for #129 (combine dwylbot comment for reviewers rule)
This PR use GenServer to create a small server which will receive all the errors that need to be send to Github (all the errors of every repo where dwylbot is installed). Then every 5s the server will combine the errors together if needed and will comment/assign/label on Github depending of the dwylbot actions.
The only small issue with A GenServer which start a process every 5s is that we might need to have an Heroku dyno live 24h (which means that we might need to pay). But maybe Heroku will automatically stop the GenServer and restart it when needed, to test.