Skip to content

Add to mergeable queue on PR push, open and reopen #275

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
Apr 28, 2025

Conversation

Sakib25800
Copy link
Contributor

Related #218

This PR adds to the mergeable queue on:

  • PR open
  • PR reopen
  • Push to PR

db.set_pr_status(
let pr = &payload.pull_request;
let pr_number = pr.number;
db.get_or_create_pull_request(
Copy link
Contributor Author

@Sakib25800 Sakib25800 Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be named db.upsert_pull_request(...) rather than db.get_or_create_pull_request(...) because it updates the PR's base_branch, mergeable_state and status.

Will update it if you agree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, a more accurate name is get_or_update, which is essentially just upsert.

.lock()
.get_pr_mut(default_pr_number())
.mergeable_state = OctocrabMergeableState::Unknown;
tester
Copy link
Contributor

@Kobzol Kobzol Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know that a push always sets the unknown state, so we could add the logic of setting Unknown directly to push_to_pr, to make sure that we don't forget it, and so that we don't have to do it in every test that checks the mergeability status.

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!

@Kobzol
Copy link
Contributor

Kobzol commented Apr 28, 2025

Needs a reformat :)

@Sakib25800 Sakib25800 force-pushed the add-async-merge-checks branch from 0a17b58 to 3a4348b Compare April 28, 2025 15:41
@Sakib25800 Sakib25800 force-pushed the add-async-merge-checks branch from 3a4348b to c0ce5fc Compare April 28, 2025 15:42
@Kobzol Kobzol added this pull request to the merge queue Apr 28, 2025
Merged via the queue into rust-lang:main with commit c643593 Apr 28, 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