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

Added dependencies for issues (#2196) #2531

Merged
merged 380 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
380 commits
Select commit Hold shift + click to select a range
c5992f5
Fixed translation issue
kolaente Oct 28, 2017
021a7e0
Fixed whitespace
kolaente Oct 28, 2017
55f6cf9
Fixed issue where an issue could not be closed because of non-existin…
kolaente Oct 28, 2017
30fe97a
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Oct 30, 2017
751bbee
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Oct 30, 2017
913584a
fmt
kolaente Oct 30, 2017
53ec08f
fmt
kolaente Oct 30, 2017
14aa1d2
When adding a dependency, the current issue is not shown in the list …
kolaente Oct 31, 2017
0bbc695
Fixed a bug where a border in the issue dependency list was on the wr…
kolaente Oct 31, 2017
a651cc3
Rebased Font-awesome with master
kolaente Nov 1, 2017
f188031
Rebased sidebar template to remove unrelated changes
kolaente Nov 1, 2017
58e7c2b
Rebased Font-awesome License file with master
kolaente Nov 1, 2017
5a9f273
Removed unrelated changes
kolaente Nov 1, 2017
ba734d6
Removed unrelated changes
kolaente Nov 1, 2017
5e4b6fc
Removed unrelated changes in locales
kolaente Nov 1, 2017
5302eca
Removed unrelated changes in gitgraph
kolaente Nov 1, 2017
2fe66c2
Removed unrelated changes in routes
kolaente Nov 1, 2017
a2b652e
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 1, 2017
762266f
Removed unrelated changes in routes
kolaente Nov 1, 2017
6b3a51a
Removed unrelated changes in locales
kolaente Nov 1, 2017
2dca487
gofmt
kolaente Nov 1, 2017
d1df4ec
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 1, 2017
dd24b9f
Implemented missing create table for Issue Dependencies table \
kolaente Nov 1, 2017
827291e
Cleanup
kolaente Nov 1, 2017
c0bc5e8
Fixed indetion
kolaente Nov 1, 2017
993a3c0
Fixed indention
kolaente Nov 1, 2017
3beecd2
Improved readability
kolaente Nov 1, 2017
4e9e1f8
Removed unused named returns
kolaente Nov 1, 2017
e364cfc
Improved Readability
kolaente Nov 1, 2017
c4ba8d6
Merge branch 'master' into master
kolaente Nov 6, 2017
9e9d8b9
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 6, 2017
80437f8
Merge remote-tracking branch 'origin/master'
kolaente Nov 6, 2017
a54f930
Removed wrong notification content in struct
kolaente Nov 6, 2017
d65fe40
Added unique to issue dependency struct for issueID and DependencyID
kolaente Nov 6, 2017
f38b3b4
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 13, 2017
f1f0607
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 14, 2017
6109fcf
Simplified check for open dependencies
kolaente Nov 14, 2017
85cdd94
Moved methods to get issue dependencies for a given issue from repo t…
kolaente Nov 14, 2017
a57bcf1
Added more specific error when creating a new dependency if it alread…
kolaente Nov 26, 2017
fc35252
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 26, 2017
33c5033
Started implementing settign for dependencies
kolaente Nov 27, 2017
c81041f
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 27, 2017
db4f578
Finished implementing setting for dependencies
kolaente Nov 27, 2017
03769da
gofmt
kolaente Nov 27, 2017
6eea6c6
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 29, 2017
d00eb86
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Nov 29, 2017
78dd6c1
Moved checking if dependencies are enabled to issue_dependency.go
kolaente Dec 2, 2017
1fded52
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 2, 2017
3566e9e
Added tests for issue dependencies
kolaente Dec 3, 2017
9af3aae
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 3, 2017
f61ba0f
gofmt
kolaente Dec 3, 2017
d0baadc
gofmt
kolaente Dec 3, 2017
9dd0cb1
Fixed misspell
kolaente Dec 3, 2017
fae4466
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 4, 2017
8bcb624
Added missing license header
kolaente Dec 4, 2017
25427ae
Using "sess" instead of "x" when removing a depencency
kolaente Dec 4, 2017
66433a9
gofmt
kolaente Dec 4, 2017
01f9e63
Modified import order
kolaente Dec 6, 2017
13f0e17
Fixed using xorm session
kolaente Dec 6, 2017
cdd322f
Merge branch 'master' into master
kolaente Dec 6, 2017
e98f92d
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 6, 2017
822c75c
Merge remote-tracking branch 'origin/master'
kolaente Dec 6, 2017
f02fd33
Fixed import order
kolaente Dec 7, 2017
7e93434
Merge branch 'master' into master
kolaente Dec 7, 2017
172b1f0
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 19, 2017
8354f2b
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 19, 2017
69769ec
gofmt
kolaente Dec 19, 2017
1608248
Fixed deleting a dependency when it going from the blocking one
kolaente Dec 19, 2017
46f099c
Merge remote-tracking branch 'origin/master'
kolaente Dec 19, 2017
e6aeeac
typo
kolaente Dec 19, 2017
08763cf
typo
kolaente Dec 19, 2017
32c5605
Added docs for dependencies
kolaente Dec 19, 2017
ed4a47d
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Dec 29, 2017
200f88d
Small fixes to xorm-stuff
kolaente Dec 29, 2017
9714024
Renamed "CanUseDependencies" to "CanCreateDependencies" to be more pr…
kolaente Dec 29, 2017
2c8103f
Fixed import order
kolaente Dec 29, 2017
1f0bac0
Fixed using strconvert
kolaente Dec 29, 2017
d29ca0c
Fixed comment
kolaente Dec 29, 2017
70589e6
Added Custom error types for issue dependencies
kolaente Dec 29, 2017
1064acc
Logging error
kolaente Dec 29, 2017
c176353
fixed typos
kolaente Dec 29, 2017
866beeb
Removed unsued code
kolaente Dec 29, 2017
5e20447
Replaced c with ctx for consistency
kolaente Dec 29, 2017
2058f4e
Fixed error message
kolaente Dec 29, 2017
5dc9c22
Renamed "c" to "ctx" for consistency
kolaente Dec 29, 2017
f48d6cd
Error messages moved to locale file
kolaente Dec 29, 2017
8931ced
Fixed error messages
kolaente Dec 29, 2017
df638db
Removed unused import
kolaente Dec 29, 2017
4855f83
Fixed indent
kolaente Dec 29, 2017
108edf9
Modified tests to work again with modified functions
kolaente Dec 29, 2017
2a249c4
gofmt
kolaente Dec 29, 2017
c534699
Fixed Lint suggestions
kolaente Dec 29, 2017
57a4f86
typo
kolaente Dec 29, 2017
fdb106d
typo
kolaente Dec 29, 2017
a2a6fed
Merge branch 'master' into master
kolaente Dec 30, 2017
436ea16
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 1, 2018
9eedb3f
Fixed check for issue is nil before getting issue details
kolaente Jan 1, 2018
b7ed097
Fixed localization
kolaente Jan 1, 2018
661bd7c
gofmt
kolaente Jan 1, 2018
632cca5
Merge branch 'master' into master
kolaente Jan 1, 2018
12c0093
Merge branch 'master' into master
kolaente Jan 2, 2018
96d6db4
Fixed an issue where it would make a request to get all issues even i…
kolaente Jan 2, 2018
0016a3e
Merge branch 'master' into master
kolaente Jan 3, 2018
cd47077
Merge branch 'master' into master
kolaente Jan 3, 2018
8735bc2
Merge branch 'master' into master
kolaente Jan 4, 2018
37dc550
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 6, 2018
f4cb1c7
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 6, 2018
8bc0947
Added more specific locale
kolaente Jan 6, 2018
86be828
Added more specific locale
kolaente Jan 6, 2018
eb295f4
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 6, 2018
171715b
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 6, 2018
4d15f28
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 8, 2018
1f8ef92
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 8, 2018
0fcc3b2
Merge branch 'master' into master
kolaente Jan 9, 2018
d5b1c33
Merge branch 'master' into master
kolaente Jan 11, 2018
5f187df
Fixed communicating errors to the user
kolaente Jan 11, 2018
c44e13b
typo
kolaente Jan 11, 2018
a5b696a
typo
kolaente Jan 11, 2018
cf1b573
Merge branch 'master' into master
kolaente Jan 13, 2018
f71f2d4
Removed unnessecary errorcheck
kolaente Jan 13, 2018
4277014
Fixed indention
kolaente Jan 13, 2018
31eff2f
Added displaying if dependencies are enabled by default or not on con…
kolaente Jan 13, 2018
30ae70a
Moved check for open dependencies to "changeStatus"
kolaente Jan 14, 2018
dd5cfbf
Simplified "CanCreateIssueDependencies"
kolaente Jan 14, 2018
fdabcf1
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 14, 2018
992e168
Fixed lint + gofmt
kolaente Jan 14, 2018
60834bc
Change nothing to trigger CI
kolaente Jan 14, 2018
18fe48e
Change nothing to trigger CI
kolaente Jan 14, 2018
647296c
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jan 21, 2018
cd734a3
Merge branch 'master' into master
kolaente Jan 24, 2018
f837429
Added only check if we're about to close an issue when closing an iss…
kolaente Jan 24, 2018
0ce2170
Added only check if we're about to close an issue when closing an iss…
kolaente Jan 24, 2018
9ee04eb
Merge remote-tracking branch 'origin/master'
kolaente Jan 24, 2018
cdb5d65
Merge branch 'master' into master
kolaente Jan 31, 2018
9e29f71
Merge branch 'master' into master
kolaente Feb 8, 2018
16b1636
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Feb 12, 2018
be51a47
Merged 'routers/issue_dependency_add' and 'routers/issue_dependency_r…
kolaente Feb 12, 2018
0ea51f8
Use xorm engine from pararmeter instead of global one
kolaente Feb 12, 2018
e322fa3
Added migration to update comments table
kolaente Feb 12, 2018
9584d3f
gofmt
kolaente Feb 12, 2018
1b63df7
Fixed status codes
kolaente Feb 12, 2018
7566292
Updated copyright header
kolaente Feb 12, 2018
421c9fa
Merge branch 'master' into master
jonasfranz Feb 12, 2018
bd3cf60
FIxed import order
kolaente Feb 12, 2018
b58363c
Merge remote-tracking branch 'origin/master'
kolaente Feb 12, 2018
bcaea09
FIxed import order
kolaente Feb 12, 2018
e842472
Merge branch 'master' into master
jonasfranz Feb 15, 2018
64e61d6
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Feb 15, 2018
637895b
Merge remote-tracking branch 'origin/master'
kolaente Feb 15, 2018
77cf3db
Merge branch 'master' into master
kolaente Feb 17, 2018
32db1b3
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Feb 19, 2018
ec0e693
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Feb 19, 2018
5e0a72c
Merge remote-tracking branch 'origin/master'
kolaente Feb 19, 2018
7d1df8b
Merge branch 'master' into master
kolaente Feb 20, 2018
b4f406c
Fixed lang
kolaente Feb 27, 2018
d2ab9e2
Fixed http status code on redirect
Feb 27, 2018
9313332
Cleanup + fmt
kolaente Feb 27, 2018
e4a6426
Added lazy load for issue list
kolaente Feb 27, 2018
138a80b
Grammar
kolaente Feb 27, 2018
264f895
Only check for open dependencies if they are enabled
kolaente Feb 27, 2018
0c6f56d
Remove redundant sprintf
kolaente Feb 27, 2018
250138f
Return JSON when trying to close issue dependencies and fail
kolaente Feb 27, 2018
91e0b53
Simplify redirect
kolaente Feb 27, 2018
5e5139f
Simplify error
kolaente Feb 27, 2018
5852b7c
Merge branch 'master' into master
kolaente Feb 27, 2018
e1f2a8e
Fixed lint
kolaente Feb 27, 2018
20ed1e9
Merge branch 'master' into master
lunny Mar 7, 2018
4d28a82
Implemented issue search via api when adding new dependencies
kolaente Mar 7, 2018
4f94a01
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Mar 11, 2018
2950021
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Mar 18, 2018
c3a5878
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Mar 18, 2018
7a57b6d
Merge remote-tracking branch 'upstream/master'
kolaente Mar 20, 2018
497628e
Merge branch 'master' into master
kolaente Mar 22, 2018
2edfbcd
Cosmetic
kolaente Mar 23, 2018
a25e1dd
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 3, 2018
f49dd29
re-added migration
kolaente Apr 3, 2018
3a24b65
Merge remote-tracking branch 'origin/master'
kolaente Apr 3, 2018
b589726
small improvements
kolaente Apr 4, 2018
c3818a9
fmt
kolaente Apr 4, 2018
7b26e2c
merge into master
kolaente Apr 10, 2018
3820fc4
Added extra error type for unknown dependency type
kolaente Apr 10, 2018
2f136fc
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 13, 2018
29dbc17
removed unused import
kolaente Apr 13, 2018
6f999a0
Fixed unnessecary nested code
kolaente Apr 14, 2018
7528664
More consitency when defining returned variables
kolaente Apr 14, 2018
be76631
Improvements when returning an error.
kolaente Apr 16, 2018
8d2015f
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 16, 2018
ee77151
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 17, 2018
82129b8
Simplified returning blocked/blocking dependencies
kolaente Apr 17, 2018
b00e209
semantics
kolaente Apr 17, 2018
414d1d0
Optimizations to removing a dependency (thanks @Morlinest)
kolaente Apr 17, 2018
9e11e77
Checking if a dependency exists and/or circular is is now done in two…
kolaente Apr 18, 2018
d0b7307
Merge with gitea-master
kolaente Apr 20, 2018
17b2d43
Simplified checking for circular dependencies
kolaente Apr 20, 2018
6af8ef7
Simplified comment creation of issue dependencies
kolaente Apr 20, 2018
2e096a5
Simplified creation of new dependencies
kolaente Apr 20, 2018
1a86536
removed unessecary comment
kolaente Apr 20, 2018
81b51d0
removed unessecary function call
kolaente Apr 20, 2018
b258bc0
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 21, 2018
6a5e138
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 23, 2018
c0cd0c3
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 29, 2018
022e9d2
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Apr 29, 2018
3cd497f
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 1, 2018
16533e9
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 1, 2018
0f8a212
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 2, 2018
a3a544e
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 2, 2018
8266510
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 5, 2018
edf661d
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 5, 2018
9185958
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 6, 2018
f0406c1
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 6, 2018
395c062
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 9, 2018
c877186
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 9, 2018
288cd40
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 9, 2018
d29f582
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 9, 2018
83b8831
fmt
kolaente May 9, 2018
617d8cd
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 11, 2018
6733682
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 18, 2018
236ad85
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 18, 2018
fbd78f4
pre-merge
kolaente May 20, 2018
ad353f0
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente May 20, 2018
5d8383e
Fixed UI bug
kolaente May 20, 2018
8c1f627
Merged with gitea-master
kolaente Jun 6, 2018
15aa9b1
Merged with gitea-master
kolaente Jun 6, 2018
0da2e34
Simplified error messages
kolaente Jun 6, 2018
e18627c
removed unnecessary index
kolaente Jun 6, 2018
39392de
removed unessecary comment
kolaente Jun 6, 2018
87f41c0
removed unnecessary index in xorm declaration
kolaente Jun 6, 2018
c52e970
Added title for error log when using via the api
kolaente Jun 6, 2018
c212a82
Moved check if the repo is allowed to have dependencies to the top of…
kolaente Jun 6, 2018
990985a
Added missing returns
kolaente Jun 6, 2018
05aaee2
Removed unnecessary setting dependent issue in comment creation
kolaente Jun 8, 2018
ec9797d
Fixed issue dependency comments not showing
kolaente Jun 8, 2018
0879a36
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jun 8, 2018
425e765
fixed lint + fmt
kolaente Jun 8, 2018
6514da4
Merge branch 'master' into master
kolaente Jun 11, 2018
12602c2
Merge branch 'master' into master
kolaente Jun 13, 2018
c760e6a
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jun 17, 2018
393013a
Changed delete endpoint to /delete
kolaente Jun 17, 2018
2d95ab1
Added missing return
kolaente Jun 17, 2018
10308a0
removed unused DependentIssue element
kolaente Jun 17, 2018
d89a136
pre-commit
kolaente Jun 19, 2018
8a6ba47
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jun 19, 2018
f01fdf6
fmt
kolaente Jun 20, 2018
e00e5dd
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jun 20, 2018
cf6d426
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jul 6, 2018
49c471f
Merge branch 'master' of https://github.com/go-gitea/gitea
kolaente Jul 6, 2018
a283309
Moved redirect to defer
kolaente Jul 6, 2018
b6e428d
Merge branch 'master' of github.com:go-gitea/gitea
kolaente Jul 15, 2018
c3a6210
Merge branch 'master' of github.com:go-gitea/gitea
kolaente Jul 16, 2018
b8aa1d8
Merge branch 'master' of github.com:go-gitea/gitea
kolaente Jul 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ DEFAULT_KEEP_EMAIL_PRIVATE = false
; Default value for AllowCreateOrganization
; New user will have rights set to create organizations depending on this setting
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
; Default value for EnableDependencies
; Repositories will use depencies by default depending on this setting
DEFAULT_ENABLE_DEPENDENCIES = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be off by default

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer this be on by default

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mee too. I also think we'd need to be consistent, if we disable this by default we'd need to disable timetracking by default too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many toggles isn't good either. Issue tracking on/off per project I do understand. But if you wish to have issues, why would you want to turn of dependencies? Just don't use it then, like labels. No need to use them. Dependencies on and no ability to turn off. Unless it's not stable, but in that case it should be fixed instead of being toggleable

Copy link
Member Author

@kolaente kolaente Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a quick benchmark of load times:
bildschirmfoto vom 2018-01-02 13-41-09

It don't seem to change much if dependencies are enabled or disabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ptman well you can still enable or disable them in repo settings. The only reason I could think of why you want to disable them is because of performance, but as the benchmark shows it doesn't have much of an impact if they are disabled or enabled...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every feature Gitea implement should not be turned off by default. That should be the highlight of the release. If some one don't want to use it, don't use it then. But to me every big/nice feature like this and time tracking and many more should be on by default. If benchmark is the scale, then i don't see any feature to be added to any application.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmarif4u I totally agree with you. And its not very motivating if you create a feature and in the end when its very close to be merged and some people say "sorry but i think we should hide the feature by default so if anyone wants to use it he would need to first know it exists and then activly edit the configuration to enable and use it".
I think it's enough there is the possibility to disable it if one doesn't want to use it. And apparently (see the benchmark) it doesn't really have an impact on load times if it is enabled or disabled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @mmarif4u here, as long as there's no performance issue we shouldn't be disabling features. And to extend on it, I don't think that defaults should be in app.ini at all but rather stored in the database per User.

; Default value for EnableTimetracking
; Repositories will use timetracking by default depending on this setting
DEFAULT_ENABLE_TIMETRACKING = true
Expand Down
1 change: 1 addition & 0 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration
for reverse authentication.
- `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration.
- `DEFAULT_ENABLE_DEPENDENCIES`: **true** Enable this to have dependencies enabled by default.

## Webhook (`webhook`)

Expand Down
4 changes: 4 additions & 0 deletions models/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err
}

if err = issue.ChangeStatus(doer, repo, true); err != nil {
// Don't return an error when dependencies are open as this would let the push fail
if IsErrDependenciesLeft(err) {
return nil
}
return err
}
Copy link
Member

@lunny lunny Jan 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to add a else here to notify the UI to say it cannot be closed since it has some dependencies not closed. @kolaente @bkcsoft

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it shows an error message if it cannot be closed because there are open dependencies 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like so
bildschirmfoto vom 2018-01-01 14-38-04

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolaente Yes, I thinks that's expected? Shouldn't that?

}
Expand Down
54 changes: 54 additions & 0 deletions models/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -1206,3 +1206,57 @@ func IsErrExternalLoginUserNotExist(err error) bool {
func (err ErrExternalLoginUserNotExist) Error() string {
return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
}

// .___ ________ .___ .__
// | | ______ ________ __ ____ \______ \ ____ ______ ____ ____ __| _/____ ____ ____ |__| ____ ______
// | |/ ___// ___/ | \_/ __ \ | | \_/ __ \\____ \_/ __ \ / \ / __ |/ __ \ / \_/ ___\| |/ __ \ / ___/
// | |\___ \ \___ \| | /\ ___/ | ` \ ___/| |_> > ___/| | \/ /_/ \ ___/| | \ \___| \ ___/ \___ \
// |___/____ >____ >____/ \___ >_______ /\___ > __/ \___ >___| /\____ |\___ >___| /\___ >__|\___ >____ >
// \/ \/ \/ \/ \/|__| \/ \/ \/ \/ \/ \/ \/ \/

// ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.
type ErrDependencyExists struct {
IssueID int64
DependencyID int64
}

// IsErrDependencyExists checks if an error is a ErrDependencyExists.
func IsErrDependencyExists(err error) bool {
_, ok := err.(ErrDependencyExists)
return ok
}

func (err ErrDependencyExists) Error() string {
return fmt.Sprintf("issue dependency does already exist [issue id: %d, dependency id: %d]", err.IssueID, err.DependencyID)
}

// ErrCircularDependency represents a "DependencyCircular" kind of error.
type ErrCircularDependency struct {
IssueID int64
DependencyID int64
}

// IsErrCircularDependency checks if an error is a ErrCircularDependency.
func IsErrCircularDependency(err error) bool {
_, ok := err.(ErrCircularDependency)
return ok
}

func (err ErrCircularDependency) Error() string {
return fmt.Sprintf("cannot create circular dependencies (two issues blocking each other) [issue id: %d, dependency id: %d]", err.IssueID, err.DependencyID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "cannot create circular dependencies" it should be like your other errors, something like "circular dependencies exists"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (as well as the message for dependencies left).

}

// ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.
type ErrDependenciesLeft struct {
IssueID int64
}

// IsErrDependenciesLeft checks if an error is a ErrCircularDependency.
func IsErrDependenciesLeft(err error) bool {
_, ok := err.(ErrDependenciesLeft)
return ok
}

func (err ErrDependenciesLeft) Error() string {
return fmt.Sprintf("cannot close this issue as it still has open dependencies [issue id: %d]", err.IssueID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"issue has open dependencies" + fix ErrDependenciesLeft comment

}
55 changes: 55 additions & 0 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,19 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository,
if issue.IsClosed == isClosed {
return nil
}

// Check for open dependencies
if isClosed { // only check if we're about to close an issue, otherwise reopening an issue would fail when there are unsatisfied dependencies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not check whether there are open deps if IsDependenciesEnabled is false.

noDeps, err := IssueNoDependenciesLeft(issue)
if err != nil {
return err
}

if !noDeps {
return ErrDependenciesLeft{issue.ID}
}
}

issue.IsClosed = isClosed

if err = updateIssueCols(e, issue, "is_closed"); err != nil {
Expand Down Expand Up @@ -1492,3 +1505,45 @@ func updateIssue(e Engine, issue *Issue) error {
func UpdateIssue(issue *Issue) error {
return updateIssue(x, issue)
}

// Get Blocked By Dependencies, aka all issues this issue is blocked by.
func (issue *Issue) getBlockedByDependencies(e Engine) (_ []*Issue, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO declaring variable names in function "header" (e.g. (_ []*Issue, err error)) is error prone and code does not look good (sometimes you type only return, sometimes you type return xyz). In this example you do not even use it and only one of two variables is declared.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that.

var issueDeps []*Issue

if err = e.
Table("issue_dependency").
Select("issue.*").
Join("INNER", "issue", "issue.id = issue_dependency.dependency_id").
Where("issue_id = ?", issue.ID).
Find(&issueDeps); err != nil {
return issueDeps, err
}

return issueDeps, nil
}

// Get Blocking Dependencies, aka all issues this issue blocks.
func (issue *Issue) getBlockingDependencies(e Engine) ([]*Issue, error) {
var issueDeps []*Issue

if err := e.
Table("issue_dependency").
Select("issue.*").
Join("INNER", "issue", "issue.id = issue_dependency.issue_id").
Where("dependency_id = ?", issue.ID).
Find(&issueDeps); err != nil {
return issueDeps, err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think return issueDeps, err and just return is same here, you do not need any if. When using (issueDeps []*Issue, err error) code is hard to read and error prone (What if you have some non important/recoverable error inside function that you want to skip? Do you want to return every variable defined all the time?).

Copy link
Member Author

@kolaente kolaente Apr 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems logic, I removed the if and replaced it with a single return.

}

return issueDeps, nil
}

// BlockedByDependencies finds all Dependencies an issue is blocked by
func (issue *Issue) BlockedByDependencies() (_ []*Issue, err error) {
return issue.getBlockedByDependencies(x)
}

// BlockingDependencies returns all blocking dependencies, aka all other issues a given issue blocks
func (issue *Issue) BlockingDependencies() (_ []*Issue, err error) {
return issue.getBlockingDependencies(x)
}
117 changes: 80 additions & 37 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const (
CommentTypeAddTimeManual
// Cancel a stopwatch for time tracking
CommentTypeCancelTracking
// Dependency added
CommentTypeAddDependency
//Dependency removed
CommentTypeRemoveDependency
)

// CommentTag defines comment tag type
Expand All @@ -75,23 +79,25 @@ const (

// Comment represents a comment in commit and issue page.
type Comment struct {
ID int64 `xorm:"pk autoincr"`
Type CommentType
PosterID int64 `xorm:"INDEX"`
Poster *User `xorm:"-"`
IssueID int64 `xorm:"INDEX"`
LabelID int64
Label *Label `xorm:"-"`
OldMilestoneID int64
MilestoneID int64
OldMilestone *Milestone `xorm:"-"`
Milestone *Milestone `xorm:"-"`
OldAssigneeID int64
AssigneeID int64
Assignee *User `xorm:"-"`
OldAssignee *User `xorm:"-"`
OldTitle string
NewTitle string
ID int64 `xorm:"pk autoincr"`
Type CommentType
PosterID int64 `xorm:"INDEX"`
Poster *User `xorm:"-"`
IssueID int64 `xorm:"INDEX"`
LabelID int64
Label *Label `xorm:"-"`
OldMilestoneID int64
MilestoneID int64
OldMilestone *Milestone `xorm:"-"`
Milestone *Milestone `xorm:"-"`
OldAssigneeID int64
AssigneeID int64
Assignee *User `xorm:"-"`
OldAssignee *User `xorm:"-"`
OldTitle string
NewTitle string
DependentIssueID int64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i do?

Copy link
Member

@Morlinest Morlinest Oct 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is 2 places with DependentIssueID. One is definition of Comment struct and second is when you set it to new comment variable...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Thats why i need it.

Copy link
Member Author

@kolaente kolaente Oct 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that i was wrong with removing LoadDepIssueDetails(), which is why I reimplemented it in 752406c.

I use this to get the Dependent issue details displayed in the comments. But to know which issue i need to get informations about, I also need the ID of the Dependent Issue. And that's where DependentIssueID comes in.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've probably started the featue and then forget about it, which is why there was this function (and the corresponding DependentIssue in the Comment struct). But i think this is the "cleander" solution instead of saving the titel of the dependent issue with the comment. The new way ensures also the Issues' title will always be the right one, even if it was changed after the comment was saved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means you can only have 1 dependency right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One per comment. (You can ofc have more than dependency per issue)

The ID here is used to get issue details (title, index) later when displaying the comment to be able to link to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does Comments track dependencies? 😕

Copy link
Member Author

@kolaente kolaente Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't, the ID is only used to display informations in a comment (title, index, link) when someone adds or removes a dependency.

DependentIssue *Issue `xorm:"-"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To load issue Dependency Details in issue_comment.go:278

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But usage of it? I don't see reason to have this field. You never use it. You only set it and save to db, but never read. Or did I overlooked something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in LoadDepIssueDetails()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, loaded, but for what? Where you use it? You load it to comment.DependentIssue and where are you using that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, see my latest comment...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolaente yes, that added html is the reason I was looking for. I looked at it yesterday and have some suggestions for it too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what suggestions?


CommitID int64
Line int64
Expand Down Expand Up @@ -266,6 +272,18 @@ func (c *Comment) LoadAssignees() error {
return nil
}

// LoadDepIssueDetails loads Dependent Issue Details
func (c *Comment) LoadDepIssueDetails() error {
var err error
if c.DependentIssueID > 0 && c.DependentIssue == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is better:

func (c *Comment) LoadDepIssueDetails() (err error) {
	if c.DependentIssueID <= 0 || c.DependentIssue != nil {
		return nil
	}
	c.DependentIssue, err = getIssueByID(x, c.DependentIssueID)
	return err
}

c.DependentIssue, err = getIssueByID(x, c.DependentIssueID)
if err != nil {
return err
}
}
return nil
}

// MailParticipants sends new comment emails to repository watchers
// and mentioned people.
func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (err error) {
Expand Down Expand Up @@ -317,22 +335,30 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
if opts.Label != nil {
LabelID = opts.Label.ID
}

var depID int64
if opts.DependentIssue != nil {
depID = opts.DependentIssue.ID
}

comment := &Comment{
Type: opts.Type,
PosterID: opts.Doer.ID,
Poster: opts.Doer,
IssueID: opts.Issue.ID,
LabelID: LabelID,
OldMilestoneID: opts.OldMilestoneID,
MilestoneID: opts.MilestoneID,
OldAssigneeID: opts.OldAssigneeID,
AssigneeID: opts.AssigneeID,
CommitID: opts.CommitID,
CommitSHA: opts.CommitSHA,
Line: opts.LineNum,
Content: opts.Content,
OldTitle: opts.OldTitle,
NewTitle: opts.NewTitle,
Type: opts.Type,
PosterID: opts.Doer.ID,
Poster: opts.Doer,
IssueID: opts.Issue.ID,
LabelID: LabelID,
OldMilestoneID: opts.OldMilestoneID,
MilestoneID: opts.MilestoneID,
OldAssigneeID: opts.OldAssigneeID,
AssigneeID: opts.AssigneeID,
CommitID: opts.CommitID,
CommitSHA: opts.CommitSHA,
Line: opts.LineNum,
Content: opts.Content,
OldTitle: opts.OldTitle,
NewTitle: opts.NewTitle,
DependentIssue: opts.DependentIssue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to set DependentIssue here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you're right, Removed it.

DependentIssueID: depID,
}
if _, err = e.Insert(comment); err != nil {
return nil, err
Expand Down Expand Up @@ -506,13 +532,30 @@ func createDeleteBranchComment(e *xorm.Session, doer *User, repo *Repository, is
})
}

// Creates issue dependency comment
func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dependentIssue *Issue, add bool) (*Comment, error) {
cType := CommentTypeAddDependency
if !add {
cType = CommentTypeRemoveDependency
}

return createComment(e, &CreateCommentOptions{
Type: cType,
Doer: doer,
Repo: issue.Repo,
Issue: issue,
DependentIssue: dependentIssue,
})
}

// CreateCommentOptions defines options for creating comment
type CreateCommentOptions struct {
Type CommentType
Doer *User
Repo *Repository
Issue *Issue
Label *Label
Type CommentType
Doer *User
Repo *Repository
Issue *Issue
Label *Label
DependentIssue *Issue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not dependent issue ID enough?

Copy link
Member Author

@kolaente kolaente Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need that to display informations about the dependent issue when showing the comments.

I think it doesn't really make a difference, as it is a pointer...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO you should always use minimum and be exact of what you need. You know, that only DependentIssue.ID will be used here, but not everyone will read the code to learn what it rly needs (and should not).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've changed that. When I first started this pr, I used only the IDs everywhere, but I was told to use structs instead, which is why I used that here.


OldMilestoneID int64
MilestoneID int64
Expand Down
Loading