Skip to content

Tree Closing and Opening #223

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

Merged
merged 3 commits into from
Mar 12, 2025
Merged

Conversation

Rhythm1710
Copy link
Contributor

@Rhythm1710 Rhythm1710 commented Mar 8, 2025

Fixes: #207

Copy link
Contributor

@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.

Thanks for the changes. Left a few more comments.

I wonder if we should pre-fill the DB with known repositories when bors starts, because it does know the list of repositories at the beginning. Then we wouldn't have to assume everywhere in code that the repository might be missing. Although there are some edge cases around a repository being added to bors while it is running (although we will ~never hit that in practice). Anyway, that can be done in a separate PR.

@Rhythm1710
Copy link
Contributor Author

Rhythm1710 commented Mar 9, 2025

Thanks for the changes. Left a few more comments.

I wonder if we should pre-fill the DB with known repositories when bors starts, because it does know the list of repositories at the beginning. Then we wouldn't have to assume everywhere in code that the repository might be missing. Although there are some edge cases around a repository being added to bors while it is running (although we will ~never hit that in practice). Anyway, that can be done in a separate PR.

I think that is a better approach. If you want I can add this in this PR only .

@Kobzol
Copy link
Contributor

Kobzol commented Mar 10, 2025

No let's keep that for the future, it's a larger change and I need to think about it more.

@Kobzol Kobzol mentioned this pull request Mar 11, 2025
18 tasks
@Rhythm1710 Rhythm1710 closed this Mar 11, 2025
@Rhythm1710 Rhythm1710 force-pushed the tree_opening_closing branch from 3bf044a to dd83a79 Compare March 11, 2025 10:09
@Rhythm1710 Rhythm1710 reopened this Mar 11, 2025
@Rhythm1710 Rhythm1710 force-pushed the tree_opening_closing branch 3 times, most recently from e293621 to 3bf044a Compare March 11, 2025 10:31
@Kobzol Kobzol force-pushed the tree_opening_closing branch 2 times, most recently from 4e7dc09 to fa717b5 Compare March 11, 2025 15:56
@Kobzol
Copy link
Contributor

Kobzol commented Mar 11, 2025

I rebased the PR and refactored some parts a bit. I left one TODO for you to resolve, to fill in the source of the tree closed message. It should be a URL pointing to the PR comment that closed the tree.

@Rhythm1710
Copy link
Contributor Author

I rebased the PR and refactored some parts a bit. I left one TODO for you to resolve, to fill in the source of the tree closed message. It should be a URL pointing to the PR comment that closed the tree.

Implemented this using

Function:- source: format!( "https://github.com/{}/pull/{}", repo_state.repository(), pr.number ),

Test:-source: format!( "https://github.com/{}/pull/{}", default_repo_name(), default_pr_number() ),

@Rhythm1710 Rhythm1710 force-pushed the tree_opening_closing branch from d532996 to 8e279bf Compare March 11, 2025 17:02
@Kobzol
Copy link
Contributor

Kobzol commented Mar 11, 2025

We want to have a link to the specific comment that closed the tree, not just the PR, that could have a lot of comments (we want to see the reason why the tree was closed).
The issue_comment webhook contains a property comment.html_url, which contains a HTML URL link to the comment. It should be parsed from the webhook and stored in the parsed pull request.

We can then use that as the tree closed source.

@Kobzol
Copy link
Contributor

Kobzol commented Mar 12, 2025

Thank you!

@Kobzol Kobzol added this pull request to the merge queue Mar 12, 2025
Merged via the queue into rust-lang:main with commit 8cd1601 Mar 12, 2025
2 checks passed
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.

Implement tree closing and opening
2 participants