Skip to content

Conversation

@mostafa630
Copy link
Contributor

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:

  1. Retrieve the build using its commit_sha.

  2. Find the PR associated with that build.

  3. Locate the TryBuildStarted comment for that PR.

  4. Fetch the workflows linked to the build.

  5. Retrieve the comment’s current content (via GraphQL).

  6. Append the workflow links to the content to generate the updated version.

  7. Update the comment with this new content.

tests

getting the comment content and updating it require us to extend the github.rs mock file to handle them
so I change the logic to check if the request is query or mutation
then handle each case based on operation name

@mostafa630 mostafa630 force-pushed the add_workflow_links_to_try_build_started_comments branch 2 times, most recently from 5efa333 to cbf754d Compare September 21, 2025 21:29
@mostafa630
Copy link
Contributor Author

@Kobzol
I’ve completed the changes for this PR , Please let me know if any further adjustments are needed.

Copy link
Member

@Kobzol Kobzol left a 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.

@mostafa630 mostafa630 force-pushed the add_workflow_links_to_try_build_started_comments branch 2 times, most recently from aab6d9d to b273c9e Compare September 22, 2025 16:58
@mostafa630 mostafa630 force-pushed the add_workflow_links_to_try_build_started_comments branch from b273c9e to 5a76e5e Compare September 22, 2025 17:16
@mostafa630
Copy link
Contributor Author

@Kobzol
thanks a lot for the review and feedback , I’ve made the suggested changes. I’m not fully sure about the tests and test infra, so it would be great if you could add them. Thanks again for your support!

@Kobzol
Copy link
Member

Kobzol commented Sep 22, 2025

Added the tests, and did some test refactoring before that. Thank you, this looks pretty nice!

@Kobzol
Copy link
Member

Kobzol commented Sep 22, 2025

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!

@Kobzol Kobzol force-pushed the add_workflow_links_to_try_build_started_comments branch from bf71a2c to 4e9f649 Compare September 22, 2025 20:29
@Kobzol Kobzol enabled auto-merge September 22, 2025 20:30
@Kobzol Kobzol added this pull request to the merge queue Sep 22, 2025
Merged via the queue into rust-lang:main with commit fd62aac Sep 22, 2025
2 checks passed
@mostafa630
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants