-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Support multiple projects #27984
Support multiple projects #27984
Conversation
var ips []int64 | ||
if err := db.GetEngine(ctx).Table("project_issue").Select("project_id"). | ||
Where("issue_id=?", issue.ID).Find(&ips); err != nil { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err
should not be ignored. I know the previous code should still be corrected.
I'm not sure if this functionality should be merged at all
|
df5261d
to
b9c8d5d
Compare
<a class="text muted flex-text-block"> | ||
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> | ||
<strong>{{ctx.locale.Tr "repo.issues.new.projects"}}</strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change ctx.Locale.Tr
to ctx.locale.Tr
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, this is likely something that was done by @tyroneyeh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.Locale.Tr
is from #27231 changed, ctx.locale.Tr
is old version's
<div class="ui select-project list"> | ||
<span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> | ||
<div class="ui projects list"> | ||
<span class="no-select item {{if .Issue.Projects}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
left -= limit | ||
issueIDs = issueIDs[limit:] | ||
for _, projectIssue := range projects { | ||
issue := issueMap[projectIssue.IssueID] | ||
issue.Projects = append(issue.Projects, projectIssue.Project) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to check whether projectIssue.Project
is already in issue.Projects
here.
Maybe stop making these assumptions? But I mean where specifically, and why? Seems like a strange assumption to make to me.
Why? Can you elaborate?
How is this not just you saying the same things you've already said?
Multiple issues have been filed about this: and also a previous PR: conceptually restricting issues to a single project is very "worse is better" of you, but I guess I shouldn't expect anything different from the go community. In any case, I'm not particularly interested in negotiating a bunch to get this merged. I can probably just run from this on my own self hosted instance, but I thought that maybe others would be interested in keeping the original pr up to date, and maybe eventually someone who is motivated enough or a core contributor could use this as a base/foundation. I kind of expect that people will not want to merge this, but at least its linked to the original pr and linked to the original issue in case people are interested. Also, @delvh seems like this is listed as something @lunny (major contributor... who are you?) was at least somewhat interested in (see #14710). Your super dismissive attitude here is honestly kind of offputting. |
} else if has { | ||
issue.Project = &p | ||
} | ||
Where("project_issue.issue_id = ?", issue.ID).OrderBy("title"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need to order the result here?
And maybe it is better to convert the function name into LoadProjects
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is just a holdover from @tyroneyeh 's original thing. All I did was try to resolve the conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry. I was just reviewing this PR and didn't notice your comment above.
Are you planning to continually improve this PR or just resolve the conflicts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sorting applies to the sidebar menu list order
@@ -26,7 +26,7 @@ type IndexerData struct { | |||
LabelIDs []int64 `json:"label_ids"` | |||
NoLabel bool `json:"no_label"` // True if LabelIDs is empty | |||
MilestoneID int64 `json:"milestone_id"` | |||
ProjectID int64 `json:"project_id"` | |||
ProjectIDs []int64 `json:"project_id"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProjectIDs []int64 `json:"project_id"` | |
ProjectIDs []int64 `json:"project_ids"` |
Other places also need to be modified.
var projectIDs []int64 | ||
for _, project := range issue.Projects { | ||
projectIDs = append(projectIDs, project.ID) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a function is better? Just a suggestion. Then we can use it in other places if necessary.
I am not the one making these assumptions. Gitea is a project that is led by PRs from volunteers, many of whom have no in-depth knowledge of the code. These assumptions are coming automatically when you don't know the codebase well. That's what I mean by will be buggy.
The current UI is set up to support exactly one project, both when assigning a project as well as displaying it (inside the issue, issue list, milestone, pull requests).
Understandable
I don't understand what the Go community has to do with this.
Understandable. So, in conclusion, no, I'm not promoting |
We should seek official help to implement this feature. Instead of submitting wrong code and causing everyone trouble, Thanks, |
As we added organization/individual level project support in the early of this year, |
Hmm… Makes sense. |
Why would you limit things in that way. Furthermore, the database design already supports the one to many. Seems silly to insist on limiting things. |
IMO the UI seems to imply that issues might have multiple projects: For our co-op, this is a critical feature that would let us do things such as show a "master board" of all issues across all our FOSS projects, something we really like on Github, and a big part of why we're migrating off github is the paywall behind having more than 5 FOSS projects feed automatically into another table. Even if we have to manually add issues per-project, it's still really nice. So for us, that would be 1 repo level, and at least 1 organization-level project, but honestly possibly more if we can, for various organization reasons. I'm looking through the code now and I don't quite understand why arbitrary vs 1 org and 1 user is significantly different in complication, seems the future proof solution is better, but I defer to those more familiar with the codebase. For what it's worth, I got 70 folks over here with time, unsure how many are interested in helping with this, but I and some others I were talking today are, so if "it's too complicated" is a major blocker, maybe we can throw our weight into the ring to help alleviate that concern? |
@delvh you seem to have the right sense of side-effects, that's good to have in a PR reviewer imo, I'm glad to see this project doesn't do "LGTM" and merges. It sounds like the main blocker for this PR right now is insufficient documentation of all the places that this change could effect (and actually handling those places in the code), is that right? If so I'm happy to start documenting all the places at least in the UI that I suspect might be affected by this change. I'm still getting familiar with gitea (I'm just using in through codeberg right now, which isn't even really gitea lol) so I need to get a local deployment working and get familiar with the codebase, so any assistance connecting what I see in the UI with where that's reflected in code would be really helpful. |
Compiling UI locations I can see that will probably be affected by this change:
The "Projects" list per new issue Also, the "projects" list dropdown on the same page may be affected Note for above, these issues might be created with a milestone preselected via query parameter:
The notifications chain for an issue may be affected, as it indicates when an issue was added to a project Also, that same page has likely the same component for the "projects" list and "projects" dropdown.
However, clicking "new issue" seems to redirect to the issue UI already mentioned above. I couldn't find any dropdown style or "live-add" functionality (such as github has) that would be affected by this change. Maybe I missed it? Obviously, the kanban board view will be affected
Potentially the "project" dropdown for a repo under issues tab might be affected? The above URLs all can swap {org} for {user} and have the same ux, so, if those are handled differently in code, then those locations as well will be affected. Surprisingly, I couldn't find any other locations in UX that might be affected. What other places am I missing? |
Try new modifying #30163 again |
So we can close this one? |
Maybe? |
Another use-case for allowing multiple projects per issue. I'm tracking a data migration process from multiple (related) data sources via Gitea issue tracker. Same textual data formatting rules apply to every data source / project. I have one issue for this textual data formatting and I would like to link it to all these projects. |
Close according to #27984 (comment) For #30381, I think it is almost there if it could follow the new sidebar design: #30381 (comment) |
Revival of @tyroneyeh 's PR here #25164
Related #12974
Might still need some work