Allow multiple projects per issue and pull requests#36784
Open
icyavocado wants to merge 71 commits intogo-gitea:mainfrom
Open
Allow multiple projects per issue and pull requests#36784icyavocado wants to merge 71 commits intogo-gitea:mainfrom
icyavocado wants to merge 71 commits intogo-gitea:mainfrom
Conversation
This reverts commit 7e6750e.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Icy Avocado <avocado@ovacoda.com>
- instead of using shared projectDB for both query, split to two. One to delete, and the other to update sorting
b180da7 to
a5dbb63
Compare
icyavocado
commented
Feb 28, 2026
Author
icyavocado
left a comment
There was a problem hiding this comment.
Addressing previous concerns in #34386
| return 0 | ||
| func (issue *Issue) projectIDs(ctx context.Context) ([]int64, error) { | ||
| var pis []project_model.ProjectIssue | ||
| if err := db.GetEngine(ctx).Table("project_issue").Where("issue_id = ?", issue.ID).Cols("project_id").Find(&pis); err != nil { |
Author
There was a problem hiding this comment.
It's not safe to ignore the err, in case the SQL would be wrong.
Catched error and return nill.
| // It adds projects that are in newProjectIDs but not currently assigned, and removes | ||
| // projects that are currently assigned but not in newProjectIDs. If newProjectIDs is | ||
| // empty or nil, all projects are removed from the issue. | ||
| func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_model.User, newProjectIDs []int64, newColumnID int64) error { |
Author
There was a problem hiding this comment.
How could it be right?
Why
newColumnIDcould apply to allnewProjectIDs?
Target the default column of a project (if exists) defaultColumn, err := newProject.MustDefaultColumn(ctx)
| NoLabel bool `json:"no_label"` // True if LabelIDs is empty | ||
| MilestoneID int64 `json:"milestone_id"` | ||
| ProjectID int64 `json:"project_id"` | ||
| ProjectIDs []int64 `json:"project_ids"` |
Author
There was a problem hiding this comment.
I do not think the change is right for indexers, I am pretty sure it breaks existing indexers and the JSON field type doesn't match.
Force a reindex to projectIDs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ability to add and remove multiple projects per issue and pull request.
E2E test video: video.webm
No breaking change expected.
Copilot was used to review changes, syntax and help with commit messages.
Resolve #12974