Skip to content

feat: track mergeability #219

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 1 commit into from
Mar 17, 2025

Conversation

Sakib25800
Copy link
Contributor

@Sakib25800 Sakib25800 commented Mar 7, 2025

Related issue: #218

This PR tracks merge ability. It adds a new column: merge_state.

Homu Implementation

  • Mergeable status is tracked via the mergeable column in the pull table
  • On PR open / reopen / edit / push: mergeable is set to None
  • On PR edit: mergeable is set to None only if base branch has changed
  • On branch push event:
    • All PRs targeting the given branch have merge_state set to None
    • If still null, then wait 5s
    • If still null, then add to queue
  • Async: all PRs with a mergeable of None are scheduled to refetch in a background task via a queue

Proposed Implementation

  • Mergeable status is tracked via the merge_state column in the pull_request table
  • On PR open / reopen / push: merge_state is set to unknown
  • On PR edit: merge_state is set based on payload value
    • The reason we don't do this only if base branch changes is because the payload value can actually be something else other than unknown, whereas with the other events it is always unknown (due to the nature of the events)
  • On branch push event: all PRs targeting the given branch have merge_state set to unknown
  • Async: needs further thought -> left for another PR

@Sakib25800 Sakib25800 changed the title feat: detect unmergeability feat: track mergeability Mar 10, 2025
@Sakib25800
Copy link
Contributor Author

@Kobzol is the goal now just to track merge ability, more specifically mergeable_state in the database?

@Kobzol
Copy link
Member

Kobzol commented Mar 10, 2025

Yes, I think that is a good start :)

@Sakib25800 Sakib25800 force-pushed the feat/detect-unmergeability branch 2 times, most recently from 2563e3f to 75a3781 Compare March 11, 2025 13:56
@Sakib25800 Sakib25800 marked this pull request as ready for review March 11, 2025 14:09
@Sakib25800 Sakib25800 force-pushed the feat/detect-unmergeability branch 2 times, most recently from ca57e00 to 08b50c6 Compare March 12, 2025 00:28
@Sakib25800 Sakib25800 mentioned this pull request Mar 13, 2025
@Sakib25800
Copy link
Contributor Author

Sakib25800 commented Mar 13, 2025

Due to this PR becoming an absolute beast, part of it has been split - see #230.

Once that has been merged, this one will continue on from there.

@Sakib25800 Sakib25800 force-pushed the feat/detect-unmergeability branch from 8264122 to a6f30b0 Compare March 15, 2025 14:58
@Sakib25800 Sakib25800 marked this pull request as draft March 15, 2025 14:58
@Sakib25800 Sakib25800 marked this pull request as ready for review March 16, 2025 02:49
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.

Thank you for the PR! Left a few comments.

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.

Thank you! Please squash and we can merge it.

@Sakib25800 Sakib25800 force-pushed the feat/detect-unmergeability branch from 8099e0c to f872320 Compare March 17, 2025 14:30
@Sakib25800
Copy link
Contributor Author

Squashed.

@Kobzol Kobzol mentioned this pull request Mar 17, 2025
2 tasks
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.

Thank you! I modified the PR description, as this doesn't fully fix #218 yet.

@Kobzol Kobzol added this pull request to the merge queue Mar 17, 2025
Merged via the queue into rust-lang:main with commit 48d9a4e Mar 17, 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.

2 participants