-
Notifications
You must be signed in to change notification settings - Fork 37
Add workflow links to try build started comments #434
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 workflow links to try build started comments #434
Conversation
5efa333 to
cbf754d
Compare
|
@Kobzol |
Kobzol
left a comment
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.
Hi, this looks great, thank you! I left some small comments, but pretty much the only thing left is to write a test. Let me know if you want help with that, I can push the test to this PR if you want.
aab6d9d to
b273c9e
Compare
b273c9e to
5a76e5e
Compare
|
@Kobzol |
|
Added the tests, and did some test refactoring before that. Thank you, this looks pretty nice! |
|
There were some bugs in the GraphQL calls that I found when testing this on a live repository. But at least it forced me to implement proper GraphQL error handling :) I fixed the bugs and the tests and it seems to work great now, thanks! |
bf71a2c to
4e9f649
Compare
|
Thanks a lot for merging this and for taking care of the tests and final touches I really appreciate it , happy I could contribute and help move things forward! |
This PR introduces support for adding workflow links to the comment that gets created when a try build starts.
Implementation details
Within
handle_workflow_started, we now invoke a new function:add_workflow_links_to_try_build_start_comment.That function performs the following steps:
Retrieve the build using its commit_sha.
Find the PR associated with that build.
Locate the TryBuildStarted comment for that PR.
Fetch the workflows linked to the build.
Retrieve the comment’s current content (via GraphQL).
Append the workflow links to the content to generate the updated version.
Update the comment with this new content.
tests
getting the comment content and updating it require us to extend the
github.rsmock file to handle themso I change the logic to check if the request is query or mutation
then handle each case based on operation name