Skip to content

Fix mirror sync parser and fix mirror messages#36504

Merged
lunny merged 4 commits intogo-gitea:mainfrom
lunny:lunny/fix_mirror_message
Feb 11, 2026
Merged

Fix mirror sync parser and fix mirror messages#36504
lunny merged 4 commits intogo-gitea:mainfrom
lunny:lunny/fix_mirror_message

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented Jan 31, 2026

Fix #36474

It also fixed a bug when sync deleted branches.

@lunny lunny added the type/bug label Jan 31, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 31, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/templates This PR modifies the template files labels Jan 31, 2026
Copy link
Copy Markdown
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

looks like a nice cleanup

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 31, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 1, 2026
@silverwind silverwind requested a review from Copilot February 1, 2026 10:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the mirror sync reference tracking system to fix a bug where deleted branches were incorrectly identified as tags in activity logs, and improves how branch/tag synchronization results are tracked and reported.

Changes:

  • Introduces a new SyncResult struct to track reference changes during sync operations instead of parsing git command output
  • Updates SyncRepoBranchesWithRepo and SyncReleasesWithTags to return structured sync results
  • Fixes display of mirror sync activities to show correct reference paths (e.g., refs/heads/test for branches vs refs/tags/test for tags)

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/repository/branch.go Adds SyncResult struct and updates SyncRepoBranchesWithRepo to return sync results; fixes handling of recreated deleted branches
modules/repository/repo.go Updates SyncReleasesWithTags to return sync results for tag operations
services/mirror/mirror_pull.go Removes old git output parsing logic; now uses structured sync results from repository modules
services/mirror/mirror_pull_test.go Removes obsolete test for removed parsing function
templates/user/dashboard/feeds.tmpl Changes mirror sync messages to use .RefName instead of .GetBranch for correct reference display
routers/web/feed/convert.go Similar template changes for feed conversion
services/repository/migrate.go Updates caller to handle new return signature
services/repository/fork.go Updates caller to handle new return signature
services/repository/adopt.go Updates caller to handle new return signature
services/migrations/gitea_uploader.go Updates caller to handle new return signature
cmd/admin.go Updates caller to handle new return signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@silverwind silverwind self-requested a review February 1, 2026 10:42
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Feb 1, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 10, 2026
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 10, 2026
@lunny lunny enabled auto-merge (squash) February 10, 2026 23:47
@lunny lunny merged commit 18ccee0 into go-gitea:main Feb 11, 2026
24 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 11, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 11, 2026
@lunny lunny deleted the lunny/fix_mirror_message branch February 11, 2026 00:16
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 12, 2026
* origin/main: (34 commits)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  Fix mirror sync parser and fix mirror messages (go-gitea#36504)
  Update JS and PY deps (go-gitea#36576)
  Add viewer controller for mermaid (zoom, drag) (go-gitea#36557)
  Misc typescript tweaks (go-gitea#36523)
  Use full-file highlighting for diff sections (go-gitea#36561)
  fix(diff): reprocess htmx content after loading more files (go-gitea#36568)
  [skip ci] Updated translations via Crowdin
  Add wrap to runner label list (go-gitea#36565)
  fix: add dnf5 command for Fedora in RPM package instructions (go-gitea#36527)
  Enable pagination on GiteaDownloader.getIssueReactions() (go-gitea#36549)
  Refactor merge conan and container auth preserve actions taskID (go-gitea#36560)
  Fix assignee sidebar links and empty placeholder after go-gitea#32465 refactor (go-gitea#36559)
  Fix various version parsing problems (go-gitea#36553)
  ...
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 12, 2026
* origin/main: (152 commits)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  Fix mirror sync parser and fix mirror messages (go-gitea#36504)
  Update JS and PY deps (go-gitea#36576)
  Add viewer controller for mermaid (zoom, drag) (go-gitea#36557)
  Misc typescript tweaks (go-gitea#36523)
  Use full-file highlighting for diff sections (go-gitea#36561)
  fix(diff): reprocess htmx content after loading more files (go-gitea#36568)
  [skip ci] Updated translations via Crowdin
  Add wrap to runner label list (go-gitea#36565)
  fix: add dnf5 command for Fedora in RPM package instructions (go-gitea#36527)
  Enable pagination on GiteaDownloader.getIssueReactions() (go-gitea#36549)
  Refactor merge conan and container auth preserve actions taskID (go-gitea#36560)
  Fix assignee sidebar links and empty placeholder after go-gitea#32465 refactor (go-gitea#36559)
  Fix various version parsing problems (go-gitea#36553)
  ...
Sirherobrine23 pushed a commit to Sirherobrine23/gitea that referenced this pull request Mar 4, 2026
Fix go-gitea#36474 

It also fixed a bug when sync deleted branches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect branch reference name in the mirror repository activity log

5 participants