Skip to content

Conversation

@Gustrb
Copy link

@Gustrb Gustrb commented Nov 4, 2025

I still have some stuff do do before marking it as "Ready to Review"

  • Write some tests
  • Validate locally everything works fine
  • Validate the text message, I added some simple copy, might not be good enough

I am just starting with this so might take some time :) All advice is appreciated

Closes #452

@Gustrb Gustrb marked this pull request as draft November 4, 2025 12:56
@bncer
Copy link

bncer commented Nov 4, 2025

Hi, @Gustrb!
I also was working on it.
Here is my version - [block approval commit] (bncer@c2493ad)
I included - OctocrabMergeableState::Blocked noticing here

@Gustrb
Copy link
Author

Gustrb commented Nov 4, 2025

Hey @bncer should we maybe merge the OctocrabMergeableState::Blocked state as well?
Don't know if there are more to this than that, but we can collaborate if you wish :)

@bncer
Copy link

bncer commented Nov 5, 2025

Yeah, definitely we can work together.

As for MergeableState::Blocked octocrab uses enum what was provided from github api. I can only find API doc from GraphQL API. I think it should be included in merge conflict state.

@bncer
Copy link

bncer commented Nov 5, 2025

@Gustrb I set up local environment by hard coding some required fields.
I can help to setup, if you have some issues.

@Kobzol
Copy link
Member

Kobzol commented Nov 5, 2025

Hi, thanks for the PR! :) I just wanted to note that I'm having a very busy week right now, and probably won't have time to take a look until next week.

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! Left some comments, but otherwise the PR looks great.

return Ok(Some(approve_non_open_pr_comment()));
}

if matches!(pr.github.mergeable_state, MergeableState::Dirty) {
Copy link
Member

Choose a reason for hiding this comment

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

We do indeed treat both Dirty and Blocked as having conflicts. Could you please construct database::MergeableState from the GH state using its From impl, and then check if the resulting state is mergeable? To use the same logic everywhere. Thanks!


pub fn approve_non_clean_pr() -> Comment {
Comment::new(
r":clipboard: Looks like this PR is not ready to be merged, ignoring approval.".to_string(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
r":clipboard: Looks like this PR is not ready to be merged, ignoring approval.".to_string(),
r":clipboard: This pull request has merge conflicts. These have to be resolved before the PR can be approved.".to_string(),

self.status = PullRequestStatus::Draft;
}

pub fn dirty_pull_request(&mut self) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub fn dirty_pull_request(&mut self) {
pub fn make_merge_conflict(&mut self) {

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.

Do not allow approving PRs with a merge conflict

3 participants