2180 Commits

Author SHA1 Message Date
Andrew Thornton
52ee212c95
Ensure that persistable channel queue is added to manager 2020-01-06 17:27:30 +00:00
zeripath
99a6f484fd
Update modules/indexer/issues/indexer_test.go 2020-01-06 07:25:20 +00:00
Lauris BH
ec83b83c74
Merge branch 'master' into graceful-queues 2020-01-05 01:20:52 +02:00
John Olheiser
fb3a6aba7d Only show sender if it makes sense (#9601)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2020-01-04 22:20:15 +00:00
Andrew Thornton
90eeb1415a
Clean up documentation for queues 2020-01-04 17:23:24 +00:00
Andrew Thornton
c7550a4bdd
No redis host specified not found 2020-01-04 15:47:37 +00:00
Andrew Thornton
1cb7a86e37
Add warning if number of workers < 0 2020-01-04 15:26:18 +00:00
Andrew Thornton
21b9778119
move unlocking out of setInternal 2020-01-04 15:12:43 +00:00
Andrew Thornton
e852cb620f
As per @guillep2k add mutex locks on shutdown/terminate 2020-01-04 14:59:39 +00:00
David Svantesson
ea707f5a77 Add branch protection option to block merge on requested changes. (#9592)
* Add branch protection option to block merge on requested changes.

* Add migration step

* Fix check to correct negation

* Apply suggestions from code review

Language improvement.

Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>

* Copyright year.

Co-authored-by: John Olheiser <42128690+jolheiser@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-01-03 19:47:09 +02:00
mrsdizzie
b39fab41c8 Some more e-mail notification fixes (#9596)
* Some more e-mail notification fixes

A few more small e-mail notification fixes/changes

* Style footer of notification email to be smaller
* Include text for when pull request is merged
* Don't include original body of issue or PR when merging/closing by
setting issue.Content to "" in these cases

* Set Re: prefix and meessage-ID headers based on actName instead of checking for a
comment. This fixes a bug where certain actions that didn't have a
comment were setting Message-ID instead of In-Reply-To which caused some
mail programs not to show those messages as they would have had the same
Message-ID as a previous message. Also fixes the case where a final
comment and closing message would have been displayed out of order if
you didn't have a copy of the original issue/pr cretion message.

* Update other template footers for consistency
2020-01-03 19:13:22 +02:00
zeripath
9941ae2966
Update modules/queue/queue_redis.go
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-31 18:18:55 +00:00
Andrew Thornton
030b6d91c8
Remove dependency on queue from setting 2019-12-31 18:18:03 +00:00
Andrew Thornton
8798a61ba4
Cancel pool workers when removed 2019-12-31 17:48:26 +00:00
Andrew Thornton
6306cd42bc
Rename queue.Description to queue.ManagedQueue as per @guillep2k 2019-12-31 17:17:07 +00:00
zeripath
a10129f74c
Update modules/queue/queue_disk_channel.go
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-31 12:33:33 +00:00
zeripath
402e4dfe96
Update modules/queue/queue_disk.go 2019-12-31 12:27:04 +00:00
zeripath
6c6d3eae76
Update modules/queue/queue_channel.go
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-31 12:17:18 +00:00
zeripath
632757bfa7
Update modules/indexer/issues/indexer.go
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-31 12:16:39 +00:00
zeripath
a763ccada1
Update modules/indexer/issues/indexer.go
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-31 11:39:58 +00:00
6543
9600c27085 [API] Fix 9544 | return 200 when reaction already exist (#9550)
* add ErrReactionAlreadyExist

* extend CreateReaction

* reaction already exist = 200

* extend FindReactionsOptions

* refactor swagger options/definitions

* fix swagger-validate

* Update models/error.go

Co-Authored-By: zeripath <art27@cantab.net>

* fix test PART1

* extend FindReactionsOptions with UserID option

* catch error on test

* fix test PART2

* format ...

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
2019-12-31 03:21:21 -05:00
6543
655aea13a5 update swagger info (#9558) 2019-12-31 12:11:15 +08:00
zeripath
27757714d0 Change markdown rendering from blackfriday to goldmark (#9533)
* Move to goldmark

Markdown rendering moved from blackfriday to the goldmark.

Multiple subtle changes required to the goldmark extensions to keep
current rendering and defaults.

Can go further with goldmark linkify and have this work within markdown
rendering making the link processor unnecessary.

Need to think about how to go about allowing extensions - at present it
seems that these would be hard to do without recompilation.

* linter fixes

Co-authored-by: Lauris BH <lauris@nix.lv>
2019-12-31 03:53:28 +02:00
zeripath
0c07f1de5b Provide Default messages for merges (#9393)
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-12-30 18:34:11 -05:00
Andrew Thornton
4d8b8ed02e
Merge branch 'master' into graceful-queues 2019-12-30 18:39:25 +00:00
Andrew Thornton
b1c9fa7f1a
Add MaxWorker settings to queues 2019-12-30 18:38:59 +00:00
Andrew Thornton
a492b3071c
Prevent deadlock during early shutdown of issue indexer 2019-12-30 18:38:58 +00:00
Andrew Thornton
1fb9104009
Queue: Allow Redis to connect to unix 2019-12-30 18:38:57 +00:00
Andrew Thornton
1013ced326
Fix test 2019-12-30 18:38:57 +00:00
Andrew Thornton
cc123c3448
Issues: Standardise the issues indexer queue settings 2019-12-30 18:38:56 +00:00
Andrew Thornton
4658b2f35e
Task: Move to generic queue and gracefulise 2019-12-30 18:38:56 +00:00
Andrew Thornton
d6b540475f
Issues: Gracefulise the issues indexer
Remove the old now unused specific queues
2019-12-30 18:38:55 +00:00
Andrew Thornton
9ad9070555
Queue: Improve logging 2019-12-30 18:38:54 +00:00
Andrew Thornton
2927bc6fe5
Queue: Add monitoring 2019-12-30 18:38:54 +00:00
Andrew Thornton
85d1a7f7d2
Queue: Add name variable to queues 2019-12-30 18:38:53 +00:00
Andrew Thornton
e6ebb47299
Queue: Make resizing worker pools 2019-12-30 18:38:52 +00:00
Andrew Thornton
0edb70a099
Queue: Add worker settings 2019-12-30 18:38:52 +00:00
Andrew Thornton
9fb051654a
Queue & Setting: Add worker pool implementation 2019-12-30 18:38:51 +00:00
Andrew Thornton
85042634fc
Queue: Add generic graceful queues with settings 2019-12-30 18:38:50 +00:00
Lunny Xiao
ed67bbe444 Fix repository issues pagination bug when there are more than one label filter (#9512) 2019-12-28 14:43:46 +00:00
Cornel
81e63d0714 Refactor webhooks to reduce code duplication (#9422)
* Start webhook refactoring to reduce code duplication

* More webhook refactoring

* Unify webhook release messages

* Fix webhook release link

* Remove sql import

* More webhook refactoring

* More webhook refactoring

* Webhook tests extended

* Fixed issue opened webhook

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
2019-12-28 08:55:09 +00:00
zeripath
55cd33e124 Stop various tests from adding to the source tree (#9515)
Instead of just adding test generated files to .gitignore prevent
them from being produced in the first place.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2019-12-28 10:08:05 +08:00
6543
4ee97465e9 [Fix] AllowedReaction code (#9518)
* optimize

* CI.restart()

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: zeripath <art27@cantab.net>
2019-12-27 18:43:56 -05:00
6543
f2d03cda96 [API] Extend times API (#9200)
Extensively extend the times API.

close #8833; close #8513; close #8559
2019-12-27 20:30:58 +00:00
Lunny Xiao
0bcf644da4 Fix deleted branch isn't removed when push the branch again (#9516) 2019-12-27 19:17:37 +00:00
zeripath
7bfb83e064 Batch hook pre- and post-receive calls (#8602)
* make notifyWatchers work on multiple actions

* more efficient multiple notifyWatchers

* Make CommitRepoAction take advantage of multiple actions

* Batch post and pre-receive results

* Set batch to 30

* Auto adjust timeout & add logging

* adjust processing message

* Add some messages to pre-receive

* Make any non-200 status code from pre-receive an error

* Add missing hookPrintResults

* Remove shortcut for single action

* mistaken merge fix

* oops

* Move master branch to the front

* If repo was empty and the master branch is pushed ensure that that is set as the default branch

* fixup

* fixup

* Missed HookOptions in setdefaultbranch

* Batch PushUpdateAddTag and PushUpdateDelTag

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2019-12-26 13:29:45 +02:00
Lunny Xiao
8b2f29c0d2
fix datarace on issue indexer queue (#9490) 2019-12-25 17:44:09 +08:00
zeripath
30181d459d Wrap the code indexer (#9476)
* Wrap the code indexer

In order to prevent a data race in the code indexer it must be wrapped
with a holder otherwise it is possible to Search/Index on an
incompletely initialised indexer, and search will fail with a nil
pointer until the repository indexer is initialised.

Further a completely initialised repository indexer should not be closed
until Termination otherwise actions in Hammer/Shutdown phases could
block or be lost.

Finally, there is a complex dance of shutdown etiquette should the index
initialisation fail. This PR restores that.

* Always return err if closed whilst waiting

Co-authored-by: techknowlogick <matti@mdranta.net>
2019-12-24 15:26:34 +08:00
6543
40e99ea010 [API] Extend contents with dates (#9464)
* extend CommitTree func

* make sure Date NOT nil

* spell corection

Co-Authored-By: zeripath <art27@cantab.net>

* add TEST

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2019-12-24 10:33:52 +08:00
zeripath
017f314b5a
Use Req.URL.RequestURI() to cope with FCGI urls (#9473)
* Use Req.URL.RequestURI() to cope with FCGI urls

* Add debug logging statement when forbidden in internal API.
2019-12-24 00:11:12 +00:00