Skip to content
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

Cross Repo Issue Dependencies #7405

Closed
jag3773 opened this issue Jul 9, 2019 · 15 comments
Closed

Cross Repo Issue Dependencies #7405

jag3773 opened this issue Jul 9, 2019 · 15 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@jag3773
Copy link

jag3773 commented Jul 9, 2019

Description

As a follow on to #2531, it would be excellent if this could be extended to allow cross repo dependencies. Being able to link across different projects would be a powerful way to model dependencies between projects.

Use case: as a project manager I want to be able to create a dependency between issues in different projects (repos). For example, I may have an API codebase in a separate repo than a UI codebase. I have a feature request to add something to the UI that depends on building the API component first.

Implementation Notes

I wouldn't want the suggestion list to explode to any possible issue on a server but it would seem reasonable to suggest issues that the user has recently visited (Trello uses this method in their attachment UI). However, even without that, simply being able to paste in any issue URL would be acceptable functionality (for me).

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jul 10, 2019
@bhalbright
Copy link
Contributor

Hello, just wanted to post that I am working on this in a fork. I haven't pushed any changes up yet but changing to query across repos that the user has access to seems straightforward, but some of the things that fall out afterwards require some thought. For example, when a user looks at an issue with a dependency to an issue in another repo that they can't access, what do they see? Also I think the view in the search to add a dependency (and the list of dependencies) should indicate what repo the issue originated from (like possibly show the repo's avatar). Anyway, any thoughts please let me know, thanks!

@lunny
Copy link
Member

lunny commented Aug 13, 2019

Users who have read permission of issues units on both repositories could do a reference.

@jag3773
Copy link
Author

jag3773 commented Aug 14, 2019

Somewhat related, probably using GitHub's org/repo#1234 syntax would be good for showing and maybe even typing in relations (in addition to straight urls).

For example, this issue is #7405 (go-gitea/gitea#7405).

This regex (?P<org>[a-zA-Z0-9_-]+)/(?P<repo>[a-zA-Z0-9_-]+)#(?P<id>[0-9]+) should map into https://example.com/%(org)s/%(repo)s/issues/%(id)s.

@bhalbright
Copy link
Contributor

bhalbright commented Aug 24, 2019

Thoughts on this layout of showing the dependencies? This is the same as how the issues are displayed on the issues page at http:///issues. Plus I think this is the same or similar to @jag3733's suggestion

view

@guillep2k
Copy link
Member

The gray button style looks very much like topics do (those are not bold, though). What about something like this?:

image

I think that it's useful that the color palette is the same as for "normal" issues.

In my company repository names are much longer than "repo2", though. For example, "lib-comunicaciones" or "ProductDesignNotes". I don't know how would that look. Another possibility is to use only the issue number and leave some visual indication that the issue is not local (e.g. instead of #236 use #235*) and use some kind of mouseover tooltip for the full repository name.

Anyway, this is just for the sake of leaving you some feedback. I'm cool with leaving it the way you propose.

@bhalbright
Copy link
Contributor

Thanks for the feedback, I like your suggestions, what do you think about this idea that emphasizes the issue name and shows the repo name on a separate line...

image

@bhalbright
Copy link
Contributor

also, FWIW here is a possible view of the search results

image

@guillep2k
Copy link
Member

It looks OK. The fact that the issue titles are all made up might confuse a little, because they look less relevant than the numbers (i.e. [#1] looks more relevant than this is a cool issue!), but in real life the issues will have better titles.

I'd separate the repository name from the number with a space (balbright/Repo2 #2 vs. balbright/Repo2#2) because when they are together the look like HTTP anchored links.

@bhalbright
Copy link
Contributor

@guillep2k thanks, sorry for the delay didn't have much time last week to work on this...wanted to run one more by you guys, hope I'm not beating a dead horse. The layout in the view where you list the dependencies below is based on what github does when you search for issues across all of github. I wanted to do the same in the search dropdown but floating the issue # to the right didn't look right in the small box so I put it to the left of the title there.

image

@guillep2k
Copy link
Member

Looks good to me.

lunny pushed a commit that referenced this issue Oct 31, 2019
* in progress changes for #7405, added ability to add cross-repo dependencies

* removed unused repolink var

* fixed query that was breaking ci tests; fixed check in issue dependency add so that the id of the issue and dependency is checked rather than the indexes

* reverted removal of string in local files becasue these are done via crowdin, not updated manually

* removed 'Select("issue.*")' from getBlockedByDependencies and getBlockingDependencies based on comments in PR review

* changed getBlockedByDependencies and getBlockingDependencies to use a more xorm-like query, also updated the sidebar as a result

* simplified the getBlockingDependencies and getBlockedByDependencies methods; changed the sidebar to show the dependencies in a different format where you can see the name of the repository

* made some changes to the issue view in the dependencies (issue name on top, repo full name on separate line). Change view of issue in the dependency search results (also showing the full repo name on separate line)

* replace call to FindUserAccessibleRepoIDs with SearchRepositoryByName. The former was hardcoded to use isPrivate = false on the repo search, but this code needed it to be true. The SearchRepositoryByName method is used more in the code including on the user's dashboard

* some more tweaks to the layout of the issues when showing dependencies and in the search box when you add new dependencies

* added Name to the RepositoryMeta struct

* updated swagger doc

* fixed total count for link header on SearchIssues

* fixed indentation

* fixed aligment of remove icon on dependencies in issue sidebar

* removed unnecessary nil check (unnecessary because issue.loadRepo is called prior to this block)

* reverting .css change, somehow missed or forgot that less is used

* updated less file and generated css; updated sidebar template with styles to line up delete and issue index

* added ordering to the blocked by/depends on queries

* fixed sorting in issue dependency search and the depends on/blocks views to show issues from the current repo first, then by created date descending; added a "all cross repository dependencies" setting to allow this feature to be turned off, if turned off, the issue dependency search will work the way it did before (restricted to the current repository)

* re-applied my swagger changes after merge

* fixed split string condition in issue search

* changed ALLOW_CROSS_REPOSITORY_DEPENDENCIES description to sound more global than just the issue dependency search; returning 400 in the cross repo issue search api method if not enabled; fixed bug where the issue count did not respect the state parameter

* when adding a dependency to an issue, added a check to make sure the issue and dependency are in the same repo if cross repo dependencies is not enabled

* updated sortIssuesSession call in PullRequests, another commit moved this method from pull.go to pull_list.go so I had to re-apply my change here

* fixed incorrect setting of user id parameter in search repos call
@mappu
Copy link
Contributor

mappu commented Jan 16, 2020

Cross-repository dependencies have appeared in my 1.11.0-rc1 installation.

But there is a problem with mentions - the inline "X added a new dependency" message still links to the current repository, not the target repository

@lunny
Copy link
Member

lunny commented Jan 16, 2020

@mappu could you fire another issue to report that? I will close this one since it has been implemented.

@lunny lunny added this to the 1.11.0 milestone Jan 16, 2020
@guillep2k
Copy link
Member

guillep2k commented Jan 16, 2020

Cross-repository dependencies have appeared in my 1.11.0-rc1 installation.

But there is a problem with mentions - the inline "X added a new dependency" message still links to the current repository, not the target repository

@mappu that bug has already been reported at #9765 👍

@6543
Copy link
Member

6543 commented Jan 17, 2020

does #7901 not close this issue ?!?

@bhalbright
Copy link
Contributor

does #7901 not close this issue ?!?

yeah I would agree the issue could be closed

@lunny lunny closed this as completed Jan 17, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

6 participants