Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix sync fork for consistency#33147

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lunny merged 11 commits intogo-gitea:mainfromchangchaishi:fix-sync-fork
Jan 10, 2025
Merged

Conversation

@changchaishi
Copy link
Contributor

Fixes#33145

An integration test could be added.

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelJan 8, 2025
@github-actionsgithub-actionsbot added the modifies/goPull requests that update Go code labelJan 8, 2025
@lunnylunny requested a review fromwxiaoguangJanuary 8, 2025 06:11
@changchaishichangchaishi marked this pull request as draftJanuary 8, 2025 06:12
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJan 8, 2025
edited
Loading

An integration test could be added.

I have some tests and will add them (see Improve "merge upstream" (sync fork)#33148 )

But I am not sure whether we should still use the "add remote" trick here, it seems fragile and I am not sure whether it is really helpful in daily usage.

@changchaishi
Copy link
ContributorAuthor

But I am not sure whether we should still use the "add remote" trick here, it seems fragile and I am not sure whether it is really helpful in daily usage.

This is really what I am concerned about before submitting the PR.

One more bug I found onservices/repository/merge_upstream.go:35, the current sync fork is not correct, should be base repo's defaultBranch.

https://github.com/orgs/community/discussions/11729

@wxiaoguang
Copy link
Contributor

But I am not sure whether we should still use the "add remote" trick here, it seems fragile and I am not sure whether it is really helpful in daily usage.

This is really what I am concerned about before submitting the PR.

One more bug I found onservices/repository/merge_upstream.go:35, the current sync fork is not correct, should be base repo's defaultBranch.

https://github.com/orgs/community/discussions/11729

If you have more ideas about the problem, feel free to take#33148 (there are more tests, I could close my PR if you'd like to use it in your PR)

@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJan 8, 2025
edited
Loading

One more bug I found onservices/repository/merge_upstream.go:35, the current sync fork is not correct, should be base repo's defaultBranch.

https://github.com/orgs/community/discussions/11729

At the moment, there is something unclear in my mind.

There could be 2 behaviors:

  1. "Sync fork" only sync the default branch (or name-matched branch), the current behavior:
    • The typical workflow is like this: the user forks the repo, then base repo's default changes a lot, then the user sync the default branch into the fork, and start a new branch from the fork's default branch.
    • In this case, if a user would like to update (sync) a PR, they could just go to the PR's page and click the "update" button there
  2. "Sync fork" sync everything basing on the base repo's default branch (your suggestion?)
    • There will be more edge cases to handle conflicts, and it duplicates with the "update" button on the PR page.

@changchaishi
Copy link
ContributorAuthor

I see~

For 1. I did not notice this is the intended behavior of Gitea right now, as I am studying the code, I refer to GitHub a lot, Github has
the Number 2 behavior, so I thought this was a kind of bug.

I think we can simplify this PR without this issue first.

One more bug I found on services/repository/merge_upstream.go:35, the current sync fork is not correct, should be the base repo's defaultBranch.

https://github.com/orgs/community/discussions/11729


If you have more ideas about the problem, feel free to take#33148 (there are more tests, I could close my PR if you'd like to use it in your PR)

I reviewed it, and this is nice, how can I use the test? Must you close it so that I can use it, or I can just reference it to create something likerepo_sync_fork_rest.py

@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJan 8, 2025
edited
Loading

Actually I am not sure which behavior is better for end users. Maybe following GitHub's behavior is better since it is widely used. 🤣


If you have more ideas about the problem, feel free to take#33148 (there are more tests, I could close my PR if you'd like to use it in your PR)

I reviewed it, and this is nice, how can I use the test? Must you close it so that I can use it, or I can just reference it to create something likerepo_sync_fork_rest.py

Some possible choices:

@pull-request-sizepull-request-sizebot added size/L and removed size/M labelsJan 9, 2025
@changchaishichangchaishi changed the title[WIP] Fix sync fork for consistencyFix sync fork for consistencyJan 9, 2025
@changchaishichangchaishi marked this pull request as ready for reviewJanuary 9, 2025 10:15
@wxiaoguang
Copy link
Contributor

If you don't mind, I think I can merge#33148 here, then we do not need to use a separate PR to handle the similar tests.

changchaishi reacted with thumbs up emoji

@github-actionsgithub-actionsbot added the modifies/apiThis PR adds API routes or modifies them labelJan 10, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedJan 10, 2025
edited
Loading

Made some new changes:

  1. mergeWIP: Improve "merge upstream" (sync fork) #33148 and reuse the tests
    • the new case is covered byBaseChangeAfterHeadChange
  2. use base repo's default branch to sync (as you suggested and as GitHub does)
changchaishi reacted with hooray emoji

@github-actionsgithub-actionsbot added the modifies/templatesThis PR modifies the template files labelJan 10, 2025
@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsJan 10, 2025
@wxiaoguangwxiaoguang added this to the1.24.0 milestoneJan 10, 2025
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsJan 10, 2025
@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJan 10, 2025
@lunnylunnyenabled auto-merge (squash)January 10, 2025 05:27
@lunnylunny merged commite5f3c16 intogo-gitea:mainJan 10, 2025
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJan 10, 2025
@changchaishichangchaishi deleted the fix-sync-fork branchJanuary 10, 2025 05:30
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull requestJan 10, 2025
Fixesgo-gitea#33145An integration test could be added.---------Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBotGiteaBot added the backport/doneAll backports for this PR have been created labelJan 10, 2025
wxiaoguang added a commit that referenced this pull requestJan 10, 2025
Backport#33147 by changchaishiFixes#33145An integration test could be added.---------Co-authored-by: Chai-Shi <changchaishi@gmail.com>Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull requestJan 14, 2025
* giteaofficial/main: (21 commits)  Support public code/issue access for private repositories (go-gitea#33127)  Validate that the tag doesn't exist when creating a tag via the web (go-gitea#33241)  [skip ci] Updated translations via Crowdin  Switch back to `vue-tsc` (go-gitea#33248)  Let API create and edit system webhooks, attempt 2 (go-gitea#33180)  Fix incorrect ref "blob" (go-gitea#33240)  Refactor RefName (go-gitea#33234)  Refactor context RefName and RepoAssignment (go-gitea#33226)  [skip ci] Updated translations via Crowdin  Fix upload file form (go-gitea#33230)  Fix mirror bug (go-gitea#33224)  Remove unused CSS styles and move some styles to proper files (go-gitea#33217)  Refactor context repository (go-gitea#33202)  [skip ci] Updated translations via Crowdin  Fix unpin hint on the pinned pull requests (go-gitea#33207)  fix(cache): cache test triggered by non memory cache (go-gitea#33220)  Update README.md (go-gitea#33149)  Fix editor markdown not incrementing in a numbered list (go-gitea#33187)  Some small refactors (go-gitea#33144)  Fix sync fork for consistency (go-gitea#33147)  ...
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsApr 10, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@lunnylunnylunny approved these changes

@wxiaoguangwxiaoguangwxiaoguang approved these changes

Assignees

No one assigned

Labels

backport/doneAll backports for this PR have been createdlgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go codemodifies/templatesThis PR modifies the template filestype/bug

Projects

None yet

Milestone

1.24.0

Development

Successfully merging this pull request may close these issues.

Strange behaviors of the Sync Fork feature

4 participants

@changchaishi@wxiaoguang@lunny@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp