Skip to content

CODEOWNERS test against diff towards HEAD of target branch instead of merge-base #29763

@baronjeppe

Description

@baronjeppe

Description

When a new PR is opened the CODEOWNERS functionality tests against the diff towards refs/heads/ as seen here:

changedFiles, err := repo.GetFilesChangedBetween(git.BranchPrefix+pr.BaseBranch, pr.GetGitRefName())

This means that if the source branch for the PR is not up to date with the target the diff will contain all the changes added to the target branch since merge base - this seems like the wrong behavior to me.

I think it should use merge base instead of head - which i also assume is the logic used to determine which changes needs to be reviewed in a PR.

I am not familiar with the codebase of gitea, so i am not comfortable make the pr to change this, but if it is agreed that this change should be made, and nobody else has the bandwidth to do it, i might give it a try.

Gitea Version

1.21.8

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Not relevant

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions