[PR #2531] [MERGED] Added dependencies for issues (#2196) #16447

Closed
opened 2025-11-02 12:10:51 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2531
Author: @kolaente
Created: 9/17/2017
Status: Merged
Merged: 7/17/2018
Merged by: @techknowlogick

Base: masterHead: master


📝 Commits (10+)

📊 Changes

29 files changed (+967 additions, -48 deletions)

View changed files

📝 custom/conf/app.ini.sample (+3 -0)
📝 docs/content/doc/advanced/config-cheat-sheet.en-us.md (+1 -0)
📝 models/action.go (+4 -0)
📝 models/error.go (+85 -0)
📝 models/issue.go (+44 -0)
📝 models/issue_comment.go (+94 -43)
models/issue_dependency.go (+137 -0)
models/issue_dependency_test.go (+57 -0)
📝 models/migrations/migrations.go (+2 -0)
models/migrations/v70.go (+100 -0)
📝 models/models.go (+1 -0)
📝 models/repo.go (+5 -1)
📝 models/repo_unit.go (+1 -1)
📝 modules/auth/repo_form.go (+1 -0)
📝 modules/context/repo.go (+5 -0)
📝 modules/setting/setting.go (+2 -0)
📝 options/locale/locale_en-US.ini (+28 -0)
📝 public/js/index.js (+39 -0)
📝 routers/api/v1/repo/issue.go (+9 -0)
📝 routers/api/v1/repo/pull.go (+5 -0)

...and 9 more files

📄 Description

Introduction

This PR implements dependencies for issues, as described in #2196.

It lets you define anonther issue as a dependency for an issue. You the cannot close the issue if it has any dependent issues which aren't closed. If you try to autoclose an issue via commit message which still has dependencies left, autoclose will simply not close the issue, but the commit will not fail.

You can disable dependencies in the repo settings.

Example: You set #2, #3 and #4 as a dependency of #1. Now you need to close all #2, #3 and #4, before you can close #1.

Screenshots

Overview of Issue Dependencies (sidebar):
Overview of Issue Dependencies (sidebar):

Comments after adding a new dependency:
Comments after adding a new dependency

Questions

Currently, i would describe this as "working, but not finished", as there are some questions i have:

  1. For now, you need the issue ID (not the index) to create a dependency. This is not very user-friendly, I'd like to have some kind of search bar where you search for the issue title/index select it, and it'll do the rest. Problem: There is no API-Endpoint to search for issues like that (Or just returns a list of all issues as JSON). I think this should be implemented first.
    If such thing already exists, please point me to it, I haven't found any.
  2. It is currently possible to create dependencies with issues from other repositories. Is this okay? Or should one not be able to do this, as it could create a massive overhead with all permission-checking etc.
  3. There is some work to be done with migrations etc, currently i simply put the xorm-call at the beginning of the function, which probably shouldn't be there. Where is the appropriate place to put this?

This is my first time I've done something like this in Go, before i've only played around with Go but never really did anything bigger. So, there are probably some things I didn't got right as a novice. Looking forward to hear your improvents to be made! Also thanks to @JonasFranzDEV who has helped me a lot.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2531 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 9/17/2017 **Status:** ✅ Merged **Merged:** 7/17/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`c5992f5`](https://github.com/go-gitea/gitea/commit/c5992f51c36ebe449d63cfa7f67311bd9e5ecf76) Fixed translation issue - [`021a7e0`](https://github.com/go-gitea/gitea/commit/021a7e0ecf93f3f383bde7469e4cc74998334798) Fixed whitespace - [`55f6cf9`](https://github.com/go-gitea/gitea/commit/55f6cf9c913282ef5be57c93b1efbbde0c30d0a6) Fixed issue where an issue could not be closed because of non-existing unresolved dependencies - [`30fe97a`](https://github.com/go-gitea/gitea/commit/30fe97a55e356644af5eddc33b8b2ad493014762) Merge branch 'master' of https://github.com/go-gitea/gitea - [`751bbee`](https://github.com/go-gitea/gitea/commit/751bbee53439ec2f6d6c05de8ee68060c97af129) Merge branch 'master' of https://github.com/go-gitea/gitea - [`913584a`](https://github.com/go-gitea/gitea/commit/913584aa6f27f4d3ed86062741c3beb1256217b4) fmt - [`53ec08f`](https://github.com/go-gitea/gitea/commit/53ec08fc7113680a344dab7bdf214b2199a5e0af) fmt - [`14aa1d2`](https://github.com/go-gitea/gitea/commit/14aa1d205296ddae341621f4ea4d1b139fbf685c) When adding a dependency, the current issue is not shown in the list anymore. - [`0bbc695`](https://github.com/go-gitea/gitea/commit/0bbc695915cf53a3e3bcd0fd746147d64a9b0285) Fixed a bug where a border in the issue dependency list was on the wrong place - [`a651cc3`](https://github.com/go-gitea/gitea/commit/a651cc36464207947f651ae00de25430de98a304) Rebased Font-awesome with master ### 📊 Changes **29 files changed** (+967 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `custom/conf/app.ini.sample` (+3 -0) 📝 `docs/content/doc/advanced/config-cheat-sheet.en-us.md` (+1 -0) 📝 `models/action.go` (+4 -0) 📝 `models/error.go` (+85 -0) 📝 `models/issue.go` (+44 -0) 📝 `models/issue_comment.go` (+94 -43) ➕ `models/issue_dependency.go` (+137 -0) ➕ `models/issue_dependency_test.go` (+57 -0) 📝 `models/migrations/migrations.go` (+2 -0) ➕ `models/migrations/v70.go` (+100 -0) 📝 `models/models.go` (+1 -0) 📝 `models/repo.go` (+5 -1) 📝 `models/repo_unit.go` (+1 -1) 📝 `modules/auth/repo_form.go` (+1 -0) 📝 `modules/context/repo.go` (+5 -0) 📝 `modules/setting/setting.go` (+2 -0) 📝 `options/locale/locale_en-US.ini` (+28 -0) 📝 `public/js/index.js` (+39 -0) 📝 `routers/api/v1/repo/issue.go` (+9 -0) 📝 `routers/api/v1/repo/pull.go` (+5 -0) _...and 9 more files_ </details> ### 📄 Description ## Introduction This PR implements dependencies for issues, as described in #2196. It lets you define anonther issue as a dependency for an issue. You the cannot close the issue if it has any dependent issues which aren't closed. If you try to autoclose an issue via commit message which still has dependencies left, autoclose will simply not close the issue, but the commit will **not** fail. You can disable dependencies in the repo settings. Example: You set #2, #3 and #4 as a dependency of #1. Now you need to close all #2, #3 and #4, before you can close #1. ## Screenshots Overview of Issue Dependencies (sidebar): ![Overview of Issue Dependencies (sidebar):](https://user-images.githubusercontent.com/13721712/32279237-6efc96b0-bf18-11e7-97f7-503b4ff0b2aa.png) Comments after adding a new dependency: ![Comments after adding a new dependency](https://user-images.githubusercontent.com/13721712/30785473-63149718-a167-11e7-801c-d987426b124a.png) ## Questions Currently, i would describe this as "working, but not finished", as there are some questions i have: 1. For now, you need the issue ID (not the index) to create a dependency. This is not very user-friendly, I'd like to have some kind of search bar where you search for the issue title/index select it, and it'll do the rest. **Problem:** There is no API-Endpoint to search for issues like that (Or just returns a list of all issues as JSON). I think this should be implemented first. If such thing already exists, please point me to it, I haven't found any. 2. It is currently possible to create dependencies with issues from other repositories. Is this okay? Or should one not be able to do this, as it could create a massive overhead with all permission-checking etc. 3. There is some work to be done with migrations etc, currently i simply put the xorm-call at the beginning of the function, which probably shouldn't be there. Where is the appropriate place to put this? This is my first time I've done something like this in Go, before i've only played around with Go but never really did anything bigger. So, there are probably some things I didn't got right as a novice. Looking forward to hear your improvents to be made! Also thanks to @JonasFranzDEV who has helped me a lot. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:10:51 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16447