Skip to content

fix #36463: preserve sort order of exclusive labels from template repo#36931

Open
cyx25 wants to merge 4 commits intogo-gitea:mainfrom
cyx25:fix/36463-preserve-template-label-exclusive-order
Open

fix #36463: preserve sort order of exclusive labels from template repo#36931
cyx25 wants to merge 4 commits intogo-gitea:mainfrom
cyx25:fix/36463-preserve-template-label-exclusive-order

Conversation

@cyx25
Copy link

@cyx25 cyx25 commented Mar 19, 2026

Description

When creating a new repository and copying issue labels from a template, the explicit sort order of exclusive labels was previously being lost (resetting to 0). This fix ensures that the original sort order for exclusive labels (e.g., 1, 2) is properly copied and retained in the newly created repository.

Fixes #36463

Changes

  • Modified template.go to explicitly copy the ExclusiveOrder field during the label generation process.
  • Updated integration test TestGenerateRepository to allow IssueLabels option and verify that labels in the generated repository match the template's labels, by inserting template labels dynamically into the database.

…late repo

When creating a new repository and copying issue labels from a
template, the explicit sort order of exclusive labels was previously
being lost (resetting to 0). This fix ensures that the original sort
order for exclusive labels (e.g., 1, 2) is properly copied and
retained in the newly created repository.

Closes go-gitea#36463

Signed-off-by: Paulo Chen <paulochen@tecnico.ulisboa.pt>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 19, 2026
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 19, 2026
cyx25 and others added 2 commits March 20, 2026 10:17
Signed-off-by: Paulo Chen <paulochen@tecnico.ulisboa.pt>
@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 Mar 20, 2026
@wxiaoguang wxiaoguang added this to the 1.26.0 milestone Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/go Pull requests that update Go code type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclusive issue label sort order not preserved when using a template repository

3 participants