Skip to content
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

Codeowner change detection doesn't work for outdated branches #28135

Closed
otbutz opened this issue Nov 20, 2023 · 5 comments
Closed

Codeowner change detection doesn't work for outdated branches #28135

otbutz opened this issue Nov 20, 2023 · 5 comments
Labels

Comments

@otbutz
Copy link

otbutz commented Nov 20, 2023

Description

If the branch of a pull request is behind its target branch, any changes from missing commits on the target branch will also trigger their associated rules.

The codeowner detection should rather be based on the actual diff output that is shown in the pull request page.

Gitea Version

1.21.0

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?

Binary started via systemd behind a caddy reverse proxy.

Database

None

@bt90
Copy link
Contributor

bt90 commented Nov 20, 2023

@cl-bvl I wonder if this intentional behaviour or should the list of files be computed from the actual diff?

@m3rtl
Copy link

m3rtl commented Feb 5, 2024

Is there anything new on this?

@zowers
Copy link

zowers commented Feb 27, 2024

owners of files unrelated to the PR are notified, please consider fixing

@zowers
Copy link

zowers commented Feb 27, 2024

Caused by how list of changed files is computed: between base branch and pr branch

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

here:
https://github.com/go-gitea/gitea/pull/24910/files#diff-bc78d680355495193dadf6796c153e5f1bf55e91c3005e0c3055ee72a7fe2c7cR931 (#24921 )

same in main:

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

probably pr.HeadCommitID must be used instead of git.BranchPrefix+pr.BaseBranch

@lunny
Copy link
Member

lunny commented Mar 27, 2024

This has been resolved by #29783

@lunny lunny closed this as completed Mar 27, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants