summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Never allow an empty password to validate (#9682) (#9684)zeripath2020-01-111-1/+1
| | | | | | * Restore IsPasswordSet previous value * Update models/user.go
* Branches not at ref commit ID should not be listed as Merged (#9614) (#9639)zeripath2020-01-081-1/+1
| | | | | | | | | | | Once a branch has been merged if the commit ID no longer equals that of the pulls ref commit id don't offer to delete the branch on the pull screen and don't list it as merged on branches. Fix #9201 When looking at the pull page we should also get the commits from the refs/pulls/x/head Fix #9158
* [BugFix] Hide public repos owned by private orgs (#9616)65432020-01-062-4/+9
|
* [Backport] [API] Allow only specific Colums to be updated on Issue (#9539) ↵65432020-01-024-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | (#9580) * Fix #9189 - API Allow only specific Colums to be updated on Issue (#9539) * dont insert "-1" in any case to issue.poster_id * Make sure API cant override importand fields * code format * add Test for IssueEdit * load milestone and return it on IssueEdit via API * extend Test for TestAPIEditIssue * fix TEST * make sure Poster is loaded * keep code format on backport as it is
* [Backport] Fix bug when migrate from API (#8631) (#9563)65432020-01-021-0/+6
| | | | | | | | | | | | | | | | | | | | * Fix bug when migrate from API (#8631) * fix bug when migrate from API * fix test * fix test * improve * fix error message * Update routers/api/v1/repo/repo.go * remove unrelated Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* backport part of #9550 (#9564)65432019-12-313-12/+51
| | | | | * add ErrReactionAlreadyExist * extend FindReactionsOptions * createReaction check if exit before create
* Fix deleted branch isn't removed when push the branch again (#9516) (#9524)Lunny Xiao2019-12-281-0/+6
|
* Fix missing repository status when migrating repository via API (#9511)Lunny Xiao2019-12-271-0/+6
| | | | | | * Fix API migration wrong repository status * Force push for ci
* Fix Slack webhook payload title generation to work with Mattermost (#9378) ↵Cornel2019-12-181-76/+93
| | | | (#9404)
* DefaultBranch needs to be prefixed by BranchPrefix (#9356) (#9359)zeripath2019-12-151-1/+1
|
* Fix bug that release attachment files not deleted when deleting repository ↵Lunny Xiao2019-12-121-7/+28
| | | | | | | | | | | (#9322) (#9329) * Fix bug that release attachment files not deleted when deleting repository * improve code * add quote * improve code
* fix race on indexer (#9136) (#9139)Lunny Xiao2019-11-231-7/+12
|
* Backport: Hide given credentials for migrated repos. (#9098)Jordan2019-11-201-1/+1
| | | | CloneAddr was being used as OriginalURL. Now passing OriginalURL through from the form and saving it.
* fix: add search to reserved usernames (#9063) (#9065)Antoine GIRARD2019-11-181-0/+1
| | | | | | | * fix: add search to reserved usernames * Update integrations/user_test.go Co-Authored-By: 6543 <24977596+6543@users.noreply.github.com>
* Fix permission checks for close/reopen from commit (#8875) (#9033)guillep2k2019-11-162-18/+31
| | | | | * Fix checks for close/reopen from commit * Fix permission order
* Hotfix for review actions and notifications (#8965)guillep2k2019-11-142-5/+17
|
* Add Close() method to gogitRepository (#8901) (#8956)zeripath2019-11-1310-24/+22
| | | | | | | | | | | Backport #8901 In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Fix SSH2 conditonal in key parsing code (#8806) (#8810)65432019-11-032-1/+14
| | | | | | | | | Avoid out of bounds error by using strings.HasPrefix to check for starting SSH2 text rather than assuming user input has at least 31 characters. Add tests for bad input as well. Fixes #8800
* [Fix] milestone close timestamp (#8728) (#8730)65432019-10-291-1/+5
| | | | | * BugFix: Update closed_date_unix colum on milestone table on close * go fmt
* make call createMilestoneComment on newIssue func (#8678) (#8681)jaqra2019-10-251-0/+4
| | | | | * make call createMilestoneComment on newIssue func * make OldMilestoneID 0 instead of -1
* Allow externalID to be UUID (#8551) (#8624)guillep2k2019-10-224-4/+4
| | | Signed-off-by: Wenxuan Zhao <viz@linux.com>
* Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params ↵zeripath2019-10-221-5/+3
| | | | | | | | (#8528) (#8618) * Expose db.SetMaxOpenConns and allow other dbs to set their connection params * Add note about port exhaustion Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Update heatmap fixtures to restore tests (#8615) (#8616)zeripath2019-10-212-3/+3
| | | | * Update heatmap fixtures to restore tests * Add hint to check the fixture age on fail
* webhook: set Content-Type for application/x-www-form-urlencoded (#8600)Viktor Szakats2019-10-201-0/+2
| | | | | This header is missing since switching http client from GiteaServer (`code.gitea.io/gitea/modules/httplib`) to Go-http-client/1.1 (`net.http`). The header [was added by default](https://github.com/go-gitea/gitea/blob/release/v1.8/modules/httplib/httplib.go#L301) by the former, but this is no longer true with `net.http`, so it needs to be done explicitly. Closes: #7700
* Fix bug on pull requests when transfer head repository (#8564) (#8569)Lunny Xiao2019-10-196-35/+49
| | | | | | | * fix bug on pull requests when transfer head repository * add migration and fix lint * fix tests and add a cache check on LoadBaseRepo
* Allow more than 255 characters for tokens in external_login_user tabl… (#8585)65432019-10-193-3/+24
| | | | | | | | * Allow more than 255 characters for tokens in external_login_user table (#8554) Signed-off-by: Wenxuan Zhao <viz@linux.com> * use old xorm repo
* Fix migrate mirror 500 bug (#8526) (#8530)65432019-10-161-0/+1
| | | | | | * fix migrate mirror 500 bug * update backport
* fix bug on FindExternalUsersByProvider (#8504)Lunny Xiao2019-10-141-1/+1
|
* Update migrated repositories' issues/comments/prs poster id if user has a ↵Lunny Xiao2019-10-147-29/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | github external user saved (#7751) * update migrated issues/comments when login as github * add get userid when migrating or login with github oauth2 * fix lint * add migrations for repository service type * fix build * remove unnecessary dependencies on migrations * add cron task to update migrations poster ids and fix posterid when migrating * fix lint * fix lint * improve code * fix lint * improve code * replace releases publish id to actual author id * fix import * fix bug * fix lint * fix rawdata definition * fix some bugs * fix error message
* Rewrite reference processing code in preparation for opening/closing from ↵guillep2k2019-10-134-269/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comment references (#8261) * Add a markdown stripper for mentions and xrefs * Improve comments * Small code simplification * Move reference code to modules/references * Fix typo * Make MarkdownStripper return [][]byte * Implement preliminary keywords parsing * Add FIXME comment * Fix comment * make fmt * Fix permissions check * Fix text assumptions * Fix imports * Fix lint, fmt * Fix unused import * Add missing export comment * Bypass revive on implemented interface * Move mdstripper into its own package * Support alphanumeric patterns * Refactor FindAllMentions * Move mentions test to references * Parse mentions from reference package * Refactor code to implement renderizable references * Fix typo * Move patterns and tests to the references package * Fix nil reference * Preliminary rendering attempt of closing keywords * Normalize names, comments, general tidy-up * Add CSS style for action keywords * Fix permission for admin and owner * Fix golangci-lint * Fix golangci-lint
* Fixes #8369: Create .ssh dir as necessary (#8486)zeripath2019-10-131-0/+24
| | | | | | | | | | * Ensure .ssh dir exists before rewriting public keys * Ensure .ssh dir exists before appending to authorized_keys * Log the error because it would be useful to know where it is trying to MkdirAll * Only try to create RootPath if it's not empty
* Move migrating repository from frontend to backend (#6200)Lunny Xiao2019-10-136-33/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move migrating to backend * add loading image when migrating and fix tests * fix format * fix lint * add redis task queue support and improve docs * add redis vendor * fix vet * add database migrations and fix app.ini sample * add comments for task section on app.ini.sample * Update models/migrations/v84.go Co-Authored-By: lunny <xiaolunwen@gmail.com> * Update models/repo.go Co-Authored-By: lunny <xiaolunwen@gmail.com> * move migrating to backend * add loading image when migrating and fix tests * fix fmt * add redis task queue support and improve docs * fix fixtures * fix fixtures * fix duplicate function on index.js * fix tests * rename repository statuses * check if repository is being create when SSH request * fix lint * fix template * some improvements * fix template * unified migrate options * fix lint * fix loading page * refactor * When gitea restart, don't restart the running tasks because we may have servel gitea instances, that may break the migration * fix js * Update models/repo.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * fix tests * rename ErrTaskIsNotExist to ErrTaskDoesNotExist * delete release after add one on tests to make it run happy * fix tests * fix tests * improve codes * fix lint * fix lint * fix migrations
* Add check for empty set when dropping indexes during migration (#8471)guillep2k2019-10-121-3/+5
| | | * Add check for empty set when dropping indexes during migration
* Restore functionality for early gits (#7775)zeripath2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * Change tests to make it possible to run TestGit with 1.7.2 * Make merge run on 1.7.2 * Fix tracking and staging branch name problem * Ensure that git 1.7.2 works on tests * ensure that there is no chance for conflicts * Fix-up missing merge issues * Final rm * Ensure LFS filters run on the tests * Do not sign commits from temp repo * Restore tracking fetch change * Apply suggestions from code review * Update modules/repofiles/temp_repo.go
* Move change issue title from models to issue service package (#8456)Lunny Xiao2019-10-113-59/+17
| | | | | | | | * move change issue title from models to issue service package * make the change less * fix typo
* Ensure that LFS files are relative to the LFS content path (#8455)zeripath2019-10-101-2/+1
|
* Ignore mentions for users with no access (#8395)guillep2k2019-10-103-34/+155
| | | | | | | | | | | | | | | | | | | | | | * Draft for ResolveMentionsByVisibility() * Correct typo * Resolve teams instead of orgs for mentions * Create test for ResolveMentionsByVisibility * Fix check for individual users and doer * Test and fix team mentions * Run all mentions through visibility filter * Fix error check * Simplify code, fix doer included in teams * Simplify team id list build
* Fix migration v96 to keep issue attachments (#8435)guillep2k2019-10-091-1/+1
| | | | | | * Fix migration v96 to keep issue attachments * Fix == operator
* Allow users with explicit read access to give approvals (#8382)guillep2k2019-10-082-1/+35
|
* Revert "Fix issues/pr list broken when there are many repositories (#8409)" ↵Lunny Xiao2019-10-084-62/+86
| | | | | (#8427) This reverts commit 78438d310be42f9c5e0e2937ee54e6050cc8f381.
* Fix issues/pr list broken when there are many repositories (#8409)Lunny Xiao2019-10-084-86/+62
| | | | | | | | | | | | | | * fix issues/pr list broken when there are many repositories * remove unused codes * fix counting error on issues/prs * keep the old logic * fix panic * fix tests
* Update milestone issues numbers when save milestone and other code ↵Lunny Xiao2019-10-081-29/+38
| | | | | | | | | | improvements (#8411) * update milestone issues numbers when save milestone and other code improvements * fix tests * extract duplicate codes as a new function
* Fix milestone num_issues (#8221)Lunny Xiao2019-10-063-41/+44
| | | | | | | | | | | | | | | | * fix milestone num_issues * update missing completeness * only update milestone closed number when closed issue is assigned a new milestone or clear milestone * fix tests * fix update milestone num * fix completeness calculate * make completeness calucation more clear
* Add extra user information when migrating release (#8331)Lunny Xiao2019-10-053-0/+21
| | | | | | | | * add extra user information when migrating release * add migrations * fix tests
* Fix column name ambiguity in GetUserIssueStats() (#8347)guillep2k2019-10-032-4/+17
| | | | | | | | * Add test for FilterModeMention * Fix column name ambiguity * Fix fmt
* Transaction-aware retry create issue to cope with duplicate keys (#8307)guillep2k2019-10-033-18/+57
| | | | | | | | | | | | | | * Revert #7898 * Transaction-aware retry create issue to cope with duplicate keys * Restore INSERT ... WHERE usage * Rearrange code for clarity * Fix error return in newIssue() * Fix error message
* Api: advanced settings for repository (external wiki, issue tracker etc.) ↵David Svantesson2019-10-021-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#7756) * Add API for Repo Advanced Settings of wiki and issue tracker Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add some integration tests for tracker and wiki settings through API * Should return StatusUnprocessableEntity in case of invalid API values. * Add tests for invalid URLs for external tracker and wiki. * Do not set inital values if they are default of type * Make issue tracker and wiki units separate structures in Repository API structure. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix comment of structures Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Rewrite API to use struct for setting tracker and wiki settings. * LetOnlyContributorsTrackTime -> AllowOnlyContributorsToTrackTime
* Move mirror to a standalone package from models (#7486)Lunny Xiao2019-10-012-390/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move mirror to a standalone package * fix mirror address in template * fix tests * fix lint * fix comment * fix tests * fix tests * fix vendor * fix fmt * fix lint * remove wrong file submitted * fix conflict * remove unrelated changes * fix go mod * fix tests * clean go mod * make vendor work * make vendor work * fix tests * remove duplicated test
* API endpoint for searching teams. (#8108)David Svantesson2019-10-011-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Api endpoint for searching teams. Signed-off-by: dasv <david.svantesson@qrtech.se> * Move API to /orgs/:org/teams/search Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Regenerate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix search is Get Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test for search team API. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update routers/api/v1/org/team.go grammar Co-Authored-By: Richard Mahn <richmahn@users.noreply.github.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix some issues in repo collaboration team search, after changes in this PR. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove teamUser which is not used and replace with actual user id. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove unused search variable UserIsAdmin. * Add paging to team search. * Re-genereate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fix * Regenerate swagger
* Extract actions on deletereleasebyid from models to release service (#8219)Lunny Xiao2019-10-012-67/+10
| | | | | | * extract actions on deletereleasebyid from models to release service * fix tests