summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix the v78 migration script (#5776)zeripath2019-01-191-0/+12
| | | | | | | | Unfortunately the last fix didn't completely fix the migration to v79 of the db due to bug with schema locking during Sync2. This should fix this issue. Fix #5759 Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix migration bug (#5762)Lunny Xiao2019-01-181-8/+28
|
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-175-14/+58
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Refactor notification for indexer (#5111)Lunny Xiao2019-01-174-15/+1
| | | | | | * notification for indexer * use NullNotifier as parent struct
* api: Add missing GET teams endpoints (#5382)Harshit Bansal2019-01-163-6/+32
| | | | | | | | | | | | | | | | | | | | * api: Add an endpoint to list a particular member of team. * models: Rename `GetUserTeams()` to `GetUserOrgTeams()` in `org_team` model. `GetUserTeams()` sounds a bit misnomer since it actually returns the teams that user belongs to in a given organization rather than all the teams across all the organization that the user has joined. * models: Add `GetUserTeams()`. Returns all the teams that a user belongs to. * api: Add an endpoint for GET '/user/teams'. A GET request to this endpoint lists all the teams that a user belongs to.
* Ensure that sessions are passed into queries that could use the database to ↵zeripath2019-01-136-22/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prevent deadlocks (#5718) * Fixed deadlock in CreateComment * Fix possible deadlock in UpdateIssueDeadline from createDeadlineComment * Ensure that calls to IsTimeTracker enabled are called within session Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure that calls to reactionList are also called within session Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure all calls in NewPullRequest with the session are called within the session Signed-off-by: Andrew Thornton <art27@cantab.net> * Deal with potential deadlocks in repo Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure that isStaring is checked within our transaction Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix mistake in isOrganizationMember Sorry.
* Discord Oauth2 support (#4476)techknowlogick2019-01-131-0/+1
| | | | | | | | | | | | | | * add discord auth * add vendor for discord * fix syntax error * make fmt * update version of goth in use * update markbates/goth
* Refactor mail notification (#5110)Lunny Xiao2019-01-133-9/+5
| | | | | | | | * mail notification implement interface * fix file comment year * use NullNotifier as parent struct of notifiers
* Fix migration for user defined themes (#5682)Lanre Adelowo2019-01-121-1/+1
|
* fix public will not be reused as public key after deleting as deploy key (#5671)Lunny Xiao2019-01-091-0/+5
|
* Allow for user specific themes (#5668)Lanre Adelowo2019-01-093-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | * add migration and basic UI for changing a user's theme * update user themem * use right text on button * load theme based on users' selection * load theme based on users' selection in pwa too * update sample config * delete older theme loading * implement AfterLoad to set users' theme properly * set up default theme when creating a user. This uses the installation wide theme * use flash messages for error * set default theme when creating a user from the cli * fix @lunny review
* Added URL mapping for Release attachments like on github.com (#1707)gdeverlant2019-01-062-0/+27
|
* Only count users own actions for heatmap contributions (#5647)Julian2019-01-061-3/+13
| | | | Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
* Fix sqlite deadlock when assigning to a PR (#5640)zeripath2019-01-046-9/+17
| | | | | | | | | | | | * Fix sqlite deadlock when assigning to a PR Fix 5639 Signed-off-by: Andrew Thornton <art27@cantab.net> * More possible deadlocks found and fixed Signed-off-by: Andrew Thornton <art27@cantab.net>
* Don't close issues via commits on non-default branch. (#5622)Harshit Bansal2019-01-042-40/+63
| | | | | | | | Adds a small check to close the issues only if the referencing commits are on the default branch. Fixes: #2314.
* mirror: Delete tags in mirror which are removed for original repo. (#5609)Harshit Bansal2018-12-312-2/+57
| | | | | | This bug was being caused by an error in the logic in `release.go`. Credit to @yasuokav for tracing the root of the issue. Fixes: #5192.
* update v71.go to resolve #5595 (#5613)Daniel Wolf2018-12-311-1/+1
|
* Webhook for Pull Request approval/rejection (#5027)Lanre Adelowo2018-12-275-19/+167
|
* Synchronize SSH keys on login with LDAP + Fix SQLite deadlock on ldap ssh ↵zeripath2018-12-273-11/+30
| | | | | | | | key deletion (#5557) * Synchronize SSH keys on login with LDAP * BUG: Fix hang on sqlite during LDAP key deletion
* fix nil pointer when adding a due date (#5587)Lanre Adelowo2018-12-271-0/+4
| | | | | | * fix nil pointer * remove nil check and just call loadRepo regardless
* Add rebase with merge commit merge style (#3844) (#4052)Julian2018-12-276-3/+107
| | | Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
* fix table name typo on SQL (#5562)Lunny Xiao2018-12-191-2/+2
| | | | | | * fix table name typo on SQL * fix reserved word user when on mssql
* fix forgot removed records when deleting user (#5429)Lunny Xiao2018-12-184-16/+53
| | | | | | | | | | * fix forgot removed records when deleting user * fix migration * fix rewritekey lock on sqlite * remove unused codes
* Add base repo nil check (#5555)Jonas Franz2018-12-171-0/+9
| | | Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Improve performance of dashboard (#4977)Lunny Xiao2018-12-1313-65/+288
|
* Added test environment for mssql (#4282)kolaente2018-12-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added test environment for m$sql * Added template for test environment for m$sql * Fix password * Fix password (again) * Fix password (again again) * Fix db * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Ci trigger (Looking at you drone....) * Create master database for mssql integration tests Signed-off-by: Jonas Franz <info@jonasfranz.software> * Create database only if master do not exist Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix mssql integration tests by using custom database "gitea" Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved defer * bump xorm * updated xorm * Fixed build
* fix approvals limitation (#5521)Lunny Xiao2018-12-111-1/+2
|
* Approvals at Branch Protection (#5350)Jonas Franz2018-12-117-30/+156
| | | | | | | | | | | | | | | | | | | | | | * Add branch protection for approvals Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add required approvals Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add missing comments and fmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add type = approval and group by reviewer_id to review * Prevent users from adding negative review limits * Add migration for approval whitelists Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Fixing MSSQL timestamp type (#5511)Christopher2018-12-111-1/+1
| | | | | | MSSQL is using the wrong type here which results in a strconv.ParseInt: parsing "2018-12-07T00:00:00Z": invalid syntax error. The added datediff(SECOND, '19700101', x) results in the unix timestamp to be returned. Signed-off-by: Christopher Dziomba <christopher.dziomba@gmail.com>
* fix code review on mssql (#5502)Lunny Xiao2018-12-111-7/+19
|
* fix forgot deletion of notification when delete repository (#5506)Lunny Xiao2018-12-101-0/+1
|
* fix topic name length on database (#5493)Lunny Xiao2018-12-082-2/+2
|
* ensure that the `closed_at` is set for closed (#5449)romankl2018-12-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | right now the `closed_at` field for json responses is not filled during the `APIIssue` creation for api responses. For a closed issue you get a result like: ```json "state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00", "updated_at":"2018-11-30T10:49:19+01:00","closed_at":null, "due_date":null,"pull_request":null} ``` which has no information about the closing date. (which exists in the db and ui) with this PR the result changes to this: ```json :null,"assignee":null,"assignees":null, "state":"closed", "comments":0,"created_at":"2018-11-29T16:43:05+01:00", "updated_at":"2018-12-02T19:17:05+01:00", "closed_at":"2018-12-02T19:17:05+01:00", "due_date":null,"pull_request":null} ``` fixes: https://github.com/go-gitea/gitea/issues/5446 Signed-off-by: Roman <romaaan.git@gmail.com>
* Fix repository deletion when there is large number of issues in it (#5426)Lunny Xiao2018-11-301-39/+40
|
* Milestone issues and pull requests (#5293)Lunny Xiao2018-11-292-3/+21
| | | | | | | | | | | | * add milestone issues and pulls page instead of redirecting issues page * add milestone when creating issue from milestone page * refactor to merge similiar codes as a new function issues * remove milestone info on milestone issues list * fix missing params
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-2827-205/+795
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* show only opened milestones on issues page milestone filter (#5051)Lanre Adelowo2018-11-261-3/+3
| | | | | | | | | | | | | | * show only opened milestones on issues page milestone filter * update Godoc * update Godoc everywhere * update swagger * use false instead of 0 * Add seccond ordering by ID for milestones where no deadline is set
* Show review summary in pull requests (#5132)kolaente2018-11-223-1/+104
|
* dont' send assign webhooks when creating issue (#5365)Lunny Xiao2018-11-201-4/+5
|
* Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)Florian Eitel2018-11-182-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * Remove field from migration to support upgrades from older version That will ensure the field does not get queried in the Select if it does not exist yet: ``` [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "name", "content", "milestone_id", "priority", "assignee_id", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: column "ref" does not exist ``` see #5318 * Skip remove stale watcher migration if not required Otherwise the migration will fail if executed from a older database version without multiple IssueWatch feature. ``` 2018/11/11 23:51:14 [I] [SQL] SELECT DISTINCT "issue_watch"."user_id", "issue"."repo_id" FROM "issue_watch" INNER JOIN issue ON issue_watch.issue_id = issue.id WHERE (issue_watch.is_watching = $1) LIMIT 50 []int [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: relation "issue_watch" does not exist ``` see #5318
* Fix create team, update team missing units (#5188)Lunny Xiao2018-11-102-0/+43
|
* fix bug when users have serval teams with different units on different ↵Lunny Xiao2018-11-092-1/+11
| | | | repositories (#5307)
* Add option to disable automatic mirror syncing. (#5242)Jonas Bröms2018-11-081-1/+6
| | | Setting the interval to 0 will disable to automatic syncing.
* Prometheus endpoint (#5256)Stanislav2018-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add prometheus collector and route * dep ensure -add github.com/prometheus/client_golang/prometheus * dep ensure -update github.com/golang/protobuf * add metrics to reserved usernames * add comment head in metrics package * fix style imports * add metrics settings * add bearer token check * mapping metrics configs * fix lint * update config cheat sheet * update conf sample, typo fix
* Fixed heatmap not working in mssql (#5248)kolaente2018-11-011-2/+4
|
* Create AuthorizedKeysCommand (#5236)zeripath2018-11-011-1/+1
|
* Keys API changes (#4960)zeripath2018-10-311-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add private information to the deploy keys api This commit adds more information to the deploy keys to allow for back reference in to the main keys list. It also adds information about the repository that the key is referring to. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add private information to the user keys API This adjusts the keys API to give out private information to user keys if the current user is the owner or an admin. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add ability to search keys by fingerprint This commit adds the functionality to search ssh-keys by fingerprint of the ssh-key. Deploy keys per repository can also be searched. There is no current clear API point to allow search of all deploy keys by fingerprint or keyID. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add integration test
* fix compatibility heatmap with mysql 8 (#5232)Stanislav2018-10-311-1/+1
|
* Fix issue where ecdsa and other key types are not synced from LDAP (#5092) ↵Jerry Jacobs2018-10-301-1/+3
| | | | | | | | | | (#5094) * Fix issue where ecdsa and other key types are not synced from LDAP authentication provider fixes #5092 * integrations/auth_ldap_test.go: Add Hermes Conrad new ecdsa-sha2-nistp256 publickey fingerprint * integrations/auth_ldap_test.go: Use ssh-keygen -lf <filename> -E sha256
* This commit will reduce join star, repo_topic, topic tables on repo search, ↵Lunny Xiao2018-10-302-37/+17
| | | | | | | | so that fix extra columns problem on mssql (#5136) * This commit will reduce join star, repo_topic, topic tables on repo search, so that fix extra columns problem on mssql * fix tests