summaryrefslogtreecommitdiffstats
path: root/models/issue.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix wrong identify poster on a migrated pull request when submi… (#9827) ↵Lunny Xiao2020-01-171-1/+1
| | | | (#9831)
* [Backport] [API] Allow only specific Colums to be updated on Issue (#9539) ↵65432020-01-021-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | (#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
* 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-221-1/+1
| | | Signed-off-by: Wenxuan Zhao <viz@linux.com>
* Update migrated repositories' issues/comments/prs poster id if user has a ↵Lunny Xiao2019-10-141-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move change issue title from models to issue service package (#8456)Lunny Xiao2019-10-111-54/+3
| | | | | | | | * move change issue title from models to issue service package * make the change less * fix typo
* Ignore mentions for users with no access (#8395)guillep2k2019-10-101-33/+122
| | | | | | | | | | | | | | | | | | | | | | * 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
* Revert "Fix issues/pr list broken when there are many repositories (#8409)" ↵Lunny Xiao2019-10-081-32/+22
| | | | | (#8427) This reverts commit 78438d310be42f9c5e0e2937ee54e6050cc8f381.
* Fix issues/pr list broken when there are many repositories (#8409)Lunny Xiao2019-10-081-22/+32
| | | | | | | | | | | | | | * 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
* Fix milestone num_issues (#8221)Lunny Xiao2019-10-061-2/+2
| | | | | | | | | | | | | | | | * 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
* Fix column name ambiguity in GetUserIssueStats() (#8347)guillep2k2019-10-031-4/+4
| | | | | | | | * Add test for FilterModeMention * Fix column name ambiguity * Fix fmt
* Transaction-aware retry create issue to cope with duplicate keys (#8307)guillep2k2019-10-031-17/+23
| | | | | | | | | | | | | | * 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
* Extract actions on new issue from models to services (#8217)Lunny Xiao2019-09-301-25/+0
| | | | | | | | * extract actions on new issue from models to services * improve code * rename services/issues to services/issue
* Fix label count (#8267)Lunny Xiao2019-09-241-5/+0
| | | | | | | | | | | | | | * fix label count * fix vendor * fix import order * update xorm to fix bug * fix tests * fix mssql bug
* Move all mail related codes from models to services/mailer (#7200)Lunny Xiao2019-09-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move all mail related codes from models to modules/mailer * fix lint * use DBContext instead Engine * use WithContext not WithEngine * Use DBContext instead of Engine * don't use defer when sess.Close() * move DBContext to context.go and add some methods * move mailer from modules/ to services * fix lint * fix tests * fix fmt * add gitea copyright * fix tests * don't expose db functions * make code clear * add DefaultDBContext * fix build * fix bug
* Reference issues from pull requests and other issues (#8137)guillep2k2019-09-201-5/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update ref comment * Generate comment on simple ref * Make fmt + remove unneeded repo load * Add TODO comments * Add ref-check in issue creation; re-arrange template * Make unit tests pass; rearrange code * Make fmt * Filter out xref comment if user can't see the referencing issue * Add TODOs * Add cross reference * Rearrange code; add cross-repository references * Striketrhough obsolete references * Remove unnecesary TODO * Add "not supported" note * Support for edits and deletes, and issue title * Revert changes to go.mod * Fix fmt * Add support for xref from API * Add first integration test * Add integration tests * Correct formatting * Fix add comment test * Add migration * Remove outdated comments; fix typo * Some code refactoring and rearranging * Rename findCrossReferences to createCrossReferences * Delete xrefs when repository is deleted * Corrections as suggested by @lafriks * Prepare for merge * Fix log for errors
* Add 'Mentioning you' group to /issues page (#8201)jaqra2019-09-181-0/+23
|
* Add reviewrs as participants (#8121)guillep2k2019-09-071-1/+1
|
* Retry create issue to cope with duplicate keys (#7898)guillep2k2019-08-261-29/+23
| | | | | | * Retry create issue to cope with duplicate keys * Use .SetExpr().Where().Insert()
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+1
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-8/+9
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Fix repository's pull request count error (#7518)Lunny Xiao2019-07-181-0/+19
| | | | | | * fix pr count error * fix tests
* Include thread related headers in issue/coment mail (#7484)mrsdizzie2019-07-171-0/+12
| | | | | | | | | | | | | | * Include thread related headers in issue/coment mail Make it so mail programs will group comments from an issue into the same thread by setting Message-ID on initial issue and then using In-Reply-To and References headers to reference that later on. * Add tests * more tests * fix typo
* Display original author and URL information when showing migrated ↵mrsdizzie2019-07-081-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | issues/comments (#7352) * Store original author info for migrated issues and comments Keep original author name for displaying in Gitea interface and also store original author user ID for potential future use in linking accounts from old location. * Add original_url for repo Store the original URL for a migrated repo Clean up migrations/tests * fix migration * fix golangci-lint * make 'make revive' happy also * Modify templates to use OriginalAuthor if set Use the original author name in templates if it is set rather than the user who migrated/currently owns the issues * formatting fixes * make generate-swagger * Use default avatar for imported comments * Remove no longer used IgnoreIssueAuthor option * Add OriginalAuthorID to swagger also
* Fix error log when loading issues caused by a xorm bug (#7271)Lunny Xiao2019-06-231-1/+2
| | | | | | | | | | | | * fix error log when loading issues caused by a xorm bug * upgrade packages * fix fmt * fix Consistency * fix tests
* Add golangci (#6418)kolaente2019-06-121-8/+3
|
* Fix index produces problem when issues/pulls deleted (#6973)Lunny Xiao2019-05-181-1/+28
| | | | | | | | | | * fix index produces problem when issues/pulls deleted * fix tests * fix tests * fix tests
* Move sdk structs to modules/structs (#6905)Lunny Xiao2019-05-111-1/+1
| | | | | | | | | | | | * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* Comments list performance optimization (#5305)Lunny Xiao2019-04-181-0/+4
|
* Better logging (#6038) (#6095)zeripath2019-04-021-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* Make "Ghost" not link to 404 page (#6410)oscar.lofwenhamn2019-03-271-0/+11
| | | | | | | | | | | | | * Make Ghost not link to 404 page * Make correct localization label show * Create and use GetLastEventLabelFake for when a Ghost user has made the action, thus not linking to a user profile * Add corresponding _fake entries to locale_en-US * Make Ghost avatar not link to 404 page * Make Ghost on milestone_issues not link to 404 page
* Add ability to sort issues by due date (#6206) (#6244)stevegt2019-03-051-0/+4
| | | Signed-off-by: Steve Traugott <stevegt@t7a.org>
* Prevent double-close of issues (#6233)zeripath2019-03-041-1/+7
|
* Add more tests and docs for issue indexer, add db indexer type for searching ↵Lunny Xiao2019-02-211-0/+34
| | | | | | | | | | | | | | from database (#6144) * add more tests and docs for issue indexer, add db indexer type for searching from database * fix typo * fix typo * fix lint * improve docs
* refactor issue indexer, add some testing and fix a bug (#6131)Lunny Xiao2019-02-211-0/+5
| | | | | | | | * refactor issue indexer, add some testing and fix a bug * fix error copyright year on comment header * issues indexer package import keep consistent
* Refactor issue indexer (#5363)Lunny Xiao2019-02-191-2/+16
|
* Implement "conversation lock" for issue comments (#5073)Lanre Adelowo2019-02-181-0/+4
|
* Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041)Zsombor2019-02-131-0/+19
|
* Add the ability to use multiple labels as filters(#5786)Lauris BH2019-01-221-13/+10
|
* Refactor notification for indexer (#5111)Lunny Xiao2019-01-171-3/+0
| | | | | | * notification for indexer * use NullNotifier as parent struct
* Ensure that sessions are passed into queries that could use the database to ↵zeripath2019-01-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Refactor mail notification (#5110)Lunny Xiao2019-01-131-3/+0
| | | | | | | | * mail notification implement interface * fix file comment year * use NullNotifier as parent struct of notifiers
* Fix sqlite deadlock when assigning to a PR (#5640)zeripath2019-01-041-1/+1
| | | | | | | | | | | | * 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>
* Improve performance of dashboard (#4977)Lunny Xiao2018-12-131-16/+67
|
* 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>
* Milestone issues and pull requests (#5293)Lunny Xiao2018-11-291-3/+9
| | | | | | | | | | | | * 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-281-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* fix sqlite lock (#5184)Lunny Xiao2018-10-271-2/+3
| | | | | | | | | | | | * fix sqlite lock * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com> * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com>
* Add notification interface and refactor UI notifications (#5085)Lunny Xiao2018-10-181-0/+4
| | | | | | | | * add notification interface and refactor UI notifications * add missing methods on notification interface and notifiy only issue status really changed * implement NotifyPullRequestReview for ui notification
* Fix failure on creating pull request with assignees (#4419) (#4583)SagePtr2018-08-161-1/+1
|