Commit Graph
9 Commits
Author SHA1 Message Date
John OlheiserandGitHub 2f65c6b2f0 Add err to log (#15813)
Signed-off-by: jolheiser <[email protected]>
2021-05-10 20:48:23 +01:00
ee3fb92419 Delete references if repository gets deleted (#15681)
* Remove DeletedBranch and LFSLocks.

* Sort beans.

Co-authored-by: zeripath <[email protected]>
2021-04-30 21:10:39 +02:00
KN4CK3RandGitHub 2e85165349 Delete protected branch if repository gets removed (#15658)
* Added missing error parameters.

* Delete protected branch if repository gets removed.

* Added doctor fix.
2021-04-30 00:48:52 +02:00
6543andGitHub a3a65137ba Delete Labels & IssueLabels on Repo Delete too (#15039)
* Doctor: find IssueLabels without existing label

* on Repo Delete: delete labels & issue_labels too

* performance nits

* Add Migration: Delete orphaned IssueLabels

* Migration v174: use Sync2

* USE sess !!!

* better func name

* code format & comment

* RAW SQL

* Update models/migrations/v176.go

* next try?
2021-03-19 21:01:24 +02:00
dace0ce1b1 Prevent addition of labels from outside the repository or organisation in issues (#14912)
* Never add labels not from this repository or organisation and remove org labels on transfer

Prevent the addition of labels from outside of the repository or
organisation and remove organisation labels on transfer.

Related #14908

Signed-off-by: Andrew Thornton <[email protected]>

* switch to use sql

Signed-off-by: Andrew Thornton <[email protected]>

* remove AS

Signed-off-by: Andrew Thornton <[email protected]>

* subquery alias

Signed-off-by: Andrew Thornton <[email protected]>

* Give me some AS?

Signed-off-by: Andrew Thornton <[email protected]>

* double AS

Signed-off-by: Andrew Thornton <[email protected]>

* try try again

Signed-off-by: Andrew Thornton <[email protected]>

* once more around the merry go round

Signed-off-by: Andrew Thornton <[email protected]>

* fix api problem

Signed-off-by: Andrew Thornton <[email protected]>

* Add outside label consistency check into doctor

This PR adds another consistency check into doctor in order to detect
labels that have been added from outside of repositories and organisations

Fix #14908

Signed-off-by: Andrew Thornton <[email protected]>

* fix migration

Signed-off-by: Andrew Thornton <[email protected]>

* prep for merge

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2021-03-19 21:25:14 +08:00
070c57867d Fix postgres ID sequences broken by recreate-table (#15015)
* Fix postgres ID sequences broken by recreate-table

Unfortunately there is a subtle problem with recreatetable on postgres which
leads to the sequences not being renamed and not being left at 0.

Fix #14725

Signed-off-by: Andrew Thornton <[email protected]>

* let us try information_schema instead

Signed-off-by: Andrew Thornton <[email protected]>

* try again

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: 6543 <[email protected]>
2021-03-18 02:06:40 -04:00
f82b1dd7c3 Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)
* Prevent adding nil label to .AddedLabels or .RemovedLabels

There are possibly a few old databases out there with malmigrated data that can
cause panics with empty labels being migrated.

This PR adds a few tests to prevent nil labels being added.

Fix #14466

Signed-off-by: Andrew Thornton <[email protected]>

* Add doctor command to remove the broken label comments

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: 6543 <[email protected]>
2021-02-10 10:50:44 +08:00
6543andGitHub 0e0424c8ec Add Doctor FixWrongUserType (#14522)
* Add Doctor FixWrongUserType

* use NoAutoTime
2021-01-29 19:30:43 +01:00
4569339a4b Refactor doctor (#12264)
* Refactor Logger

Refactor Logger to make a logger interface and make it possible to
wrap loggers for specific purposes.

* Refactor Doctor

    Move the gitea doctor functions into its own module.
    Use a logger for its messages instead of returning a results string[]

Signed-off-by: Andrew Thornton <[email protected]>

* Update modules/doctor/misc.go

Co-authored-by: 6543 <[email protected]>

* Update modules/doctor/misc.go

Co-authored-by: 6543 <[email protected]>

Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
2020-12-02 06:56:04 +02:00