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

ci: clang-tidy: no repo ref #2925

Merged
merged 1 commit into from
Mar 20, 2025
Merged

ci: clang-tidy: no repo ref #2925

merged 1 commit into from
Mar 20, 2025

Conversation

hmaciak
Copy link
Contributor

@hmaciak hmaciak commented Mar 20, 2025

This PR provides fix for fork repositories check.

@hmaciak hmaciak requested a review from a team as a code owner March 20, 2025 09:31
@github-actions github-actions bot added the devops Github automation label Mar 20, 2025
@hmaciak
Copy link
Contributor Author

hmaciak commented Mar 20, 2025

@vpirogov
Copy link
Contributor

I don't understand what this change does exactly. Please explain.

The issue we have after PR #2911 got promoted is that clang-tidy runs on files from the main branch (either fork or main repo), instead of the PR branch.

@atkassen
Copy link
Contributor

I don't understand what this change does exactly. Please explain.

The issue we have after PR #2911 got promoted is that clang-tidy runs on files from the main branch (either fork or main repo), instead of the PR branch.

Looks like it is now running against a merge commit of the two branches that GitHub creates for the PR in the base repo.

In the log for #2924:

/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +8f65a5f3d4cd70134dc97eea365c75bc6b2cce39:refs/remotes/pull/2924/merge
...
/usr/bin/git checkout --progress --force refs/remotes/pull/2924/merge

@vpirogov
Copy link
Contributor

Looks like it is now running against a merge commit of the two branches that GitHub creates for the PR in the base repo.

This sounds reasonable, as it would reflect the state after the PR is merged.

Shall we test whether it works like that for forks as well?

@hmaciak
Copy link
Contributor Author

hmaciak commented Mar 20, 2025

This test is for fork. This #2911 worked fine for branches and it uses PR merge branch (example: https://github.com/uxlfoundation/oneDNN/actions/runs/13972297648/job/39116992717). The only issue is for forks, and deleting repo ref fixes the issue and allows default checkout to merge commit.

@atkassen
Copy link
Contributor

Shall we test whether it works like that for forks as well?

I just meant that the merge exists as part of the base repo. The merge commit is made from the base branch and the head branch (be it in a fork or not). @hmaciak's test was with the branch from my fork and everything looked good.

@vpirogov
Copy link
Contributor

Thanks for the explanation, @hmaciak and @atkassen!

@hmaciak hmaciak merged commit edd2a3e into main Mar 20, 2025
8 checks passed
@hmaciak hmaciak deleted the hmaiak/fix_fork_clang-tidy branch March 20, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Github automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants