Lunny Xiao and GitHub
5723240490
Some repository refactors ( #17950 )
...
* some repository refactors
* remove unnecessary code
* Fix test
* Remove unnecessary banner
2021-12-12 23:48:20 +08:00
Lunny Xiao and GitHub
719bddcd76
Move repository model into models/repo ( #17933 )
...
* Some refactors related repository model
* Move more methods out of repository
* Move repository into models/repo
* Fix test
* Fix test
* some improvements
* Remove unnecessary function
2021-12-10 09:27:50 +08:00
Lunny Xiao and GitHub
33fca2b537
Move webhook into models/webhook/ ( #17579 )
2021-11-10 13:13:16 +08:00
Lunny Xiao and GitHub
5842a55b31
Move login related structs and functions to models/login ( #17093 )
...
* Move login related structs and functions to models/login
* Fix test
* Fix lint
* Fix lint
* Fix lint of windows
* Fix lint
* Fix test
* Fix test
* Only load necessary fixtures when preparing unit tests envs
* Fix lint
* Fix test
* Fix test
* Fix error log
* Fix error log
* Fix error log
* remove unnecessary change
* fix error log
* merge main branch
2021-09-24 19:32:56 +08:00
zeripath and GitHub
9302eba971
DBContext is just a Context ( #17100 )
...
* DBContext is just a Context
This PR removes some of the specialness from the DBContext and makes it context
This allows us to simplify the GetEngine code to wrap around any context in future
and means that we can change our loadRepo(e Engine) functions to simply take contexts.
Signed-off-by: Andrew Thornton <[email protected] >
* fix unit tests
Signed-off-by: Andrew Thornton <[email protected] >
* another place that needs to set the initial context
Signed-off-by: Andrew Thornton <[email protected] >
* avoid race
Signed-off-by: Andrew Thornton <[email protected] >
* change attachment error
Signed-off-by: Andrew Thornton <[email protected] >
2021-09-23 23:45:36 +08:00
a4bfef265d
Move db related basic functions to models/db ( #17075 )
...
* Move db related basic functions to models/db
* Fix lint
* Fix lint
* Fix test
* Fix lint
* Fix lint
* revert unnecessary change
* Fix test
* Fix wrong replace string
* Use *Context
* Correct committer spelling and fix wrong replaced words
Co-authored-by: zeripath <[email protected] >
2021-09-19 19:49:59 +08:00
6543 and GitHub
2289580bb7
[API] generalize list header ( #16551 )
...
* Add info about list endpoints to CONTRIBUTING.md
* Let all list endpoints return X-Total-Count header
* Add TODOs for GetCombinedCommitStatusByRef
* Fix models/issue_stopwatch.go
* Rrefactor models.ListDeployKeys
* Introduce helper func and use them for SetLinkHeader related func
2021-08-12 14:43:08 +02:00
9d99f6ab19
Refactor renders ( #15175 )
...
* Refactor renders
* Some performance optimization
* Fix comment
* Transform reader
* Fix csv test
* Fix test
* Fix tests
* Improve optimaziation
* Fix test
* Fix test
* Detect file encoding with reader
* Improve optimaziation
* reduce memory usage
* improve code
* fix build
* Fix test
* Fix for go1.15
* Fix render
* Fix comment
* Fix lint
* Fix test
* Don't use NormalEOF when unnecessary
* revert change on util.go
* Apply suggestions from code review
Co-authored-by: zeripath <[email protected] >
* rename function
* Take NormalEOF back
Co-authored-by: zeripath <[email protected] >
2021-04-19 18:25:08 -04:00
6edfa6bc88
Fix broken migration on webhook ( #13911 )
...
* Fix broken migration on webhook
* Fix lint
Co-authored-by: John Olheiser <[email protected] >
2020-12-09 17:20:13 +00:00
Lunny Xiao and GitHub
80a6b0f5bc
Avatars and Repo avatars support storing in minio ( #12516 )
...
* Avatar support minio
* Support repo avatar minio storage
* Add missing migration
* Fix bug
* Fix test
* Add test for minio store type on avatars and repo avatars; Add documents
* Fix bug
* Fix bug
* Add back missed avatar link method
* refactor codes
* Simplify the codes
* Code improvements
* Fix lint
* Fix test mysql
* Fix test mysql
* Fix test mysql
* Fix settings
* Fix test
* fix test
* Fix bug
2020-10-14 21:07:51 +08:00
1f01f53c53
API add/generalize pagination ( #9452 )
...
* paginate results
* fixed deadlock
* prevented breaking change
* updated swagger
* go fmt
* fixed find topic
* go mod tidy
* go mod vendor with go1.13.5
* fixed repo find topics
* fixed unit test
* added Limit method to Engine struct; use engine variable when provided; fixed gitignore
* use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors
* set Page value on Home route
* improved memory allocations
* fixed response headers
* removed logfiles
* fixed import order
* import order
* improved swagger
* added function to get models.ListOptions from context
* removed pagesize diff on unit test
* fixed imports
* removed unnecessary struct field
* fixed go fmt
* scoped PR
* code improvements
* code improvements
* go mod tidy
* fixed import order
* fixed commit statuses session
* fixed files headers
* fixed headers; added pagination for notifications
* go mod tidy
* go fmt
* removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list
* Apply suggestions from code review
Co-Authored-By: 6543 <[email protected] >
Co-Authored-By: zeripath <[email protected] >
* fixed build error
* CI.restart()
* fixed merge conflicts resolve
* fixed conflicts resolve
* improved FindTrackedTimesOptions.ToOptions() method
* added backwards compatibility on ListReleases request; fixed issue tracked time ToSession
* fixed build error; fixed swagger template
* fixed swagger template
* fixed ListReleases backwards compatibility
* added page to user search route
Co-authored-by: techknowlogick <[email protected] >
Co-authored-by: 6543 <[email protected] >
Co-authored-by: zeripath <[email protected] >
2020-01-24 14:00:29 -05:00
Lunny Xiao and GitHub
b465d0d787
Move create/fork repository from models to modules/repository ( #9489 )
...
* Move create/fork repository from models to modules/repository
* fix wrong reference
* fix test
* fix test
* fix lint
* Fix DBContext
* remove duplicated TestMain
* fix lint
* fix conflicts
2020-01-12 20:11:17 +08:00
5765212c6d
Add owner_name column for table repository for maintaince reason ( #9717 )
...
* Add owner_name column for table repository for maintaince reason
* refactor
* Fix tests
* fix test
* fix bug when fork repository
Co-authored-by: zeripath <[email protected] >
2020-01-12 17:36:21 +08:00
John Olheiser and Lauris BH
ee9ce0cfa9
Fix nil reference in repo generation ( #9660 )
...
* Fix nil reference
Signed-off-by: jolheiser <[email protected] >
* Tighten
Signed-off-by: jolheiser <[email protected] >
2020-01-09 08:22:37 +02:00
zeripath and GitHub
4acca9d2e8
Properly enforce gitea environment for pushes ( #9501 )
...
#8982 attempted to enforce the gitea environment for pushes - unfortunately it tested the settings before they were actually read in - and therefore does not do that!
2019-12-27 21:15:04 +00:00
Lunny Xiao and GitHub
59d6401486
Use ioutil.TmpDir for new created temp directory ( #9368 )
...
* Use os.TmpDir for new created temp directory
* fix error message
2019-12-16 13:17:55 +08:00
zeripath and Lauris BH
60c5339042
Graceful: Cancel Process on monitor pages & HammerTime ( #9213 )
...
* Graceful: Create callbacks to with contexts
* Graceful: Say when Gitea is completely finished
* Graceful: Git and Process within HammerTime
Force all git commands to terminate at HammerTime
Force all process commands to terminate at HammerTime
Move almost all git processes to run as git Commands
* Graceful: Always Hammer after Shutdown
* ProcessManager: Add cancel functionality
* Fix tests
* Make sure that process.Manager.Kill() cancels
* Make threadsafe access to Processes and remove own unused Kill
* Remove cmd from the process manager as it is no longer used
* the default context is the correct context
* get rid of double till
2019-11-30 16:40:22 +02:00
15a5c10d33
Variable expansion in repository templates ( #9163 )
...
* Start expansion
Signed-off-by: jolheiser <[email protected] >
* _template rather than .template
Signed-off-by: jolheiser <[email protected] >
* Use ioutil
Signed-off-by: jolheiser <[email protected] >
* Add descriptions to mapping
* Start globbing
Signed-off-by: jolheiser <[email protected] >
* Tune globbing
Signed-off-by: jolheiser <[email protected] >
* Re-arrange imports
Signed-off-by: jolheiser <[email protected] >
* Don't expand git hooks
Signed-off-by: jolheiser <[email protected] >
* Add glob tests for .giteatemplate
Signed-off-by: jolheiser <[email protected] >
* Parse globs separately so they can be tested more easily
Signed-off-by: jolheiser <[email protected] >
* Change template location and add docs
Signed-off-by: jolheiser <[email protected] >
* nit
Signed-off-by: jolheiser <[email protected] >
* Update docs/content/doc/features/gitea-directory.md
Co-Authored-By: guillep2k <[email protected] >
* Update docs/content/doc/features/gitea-directory.md
Co-Authored-By: guillep2k <[email protected] >
* Add upper-lower case match
Signed-off-by: jolheiser <[email protected] >
* Nits
Signed-off-by: jolheiser <[email protected] >
* Update models/repo_generate.go
Co-Authored-By: guillep2k <[email protected] >
2019-11-30 01:54:47 -05:00
John Olheiser and Lunny Xiao
62bcb2b7f1
Add avatar and issue labels to template repositories ( #9149 )
...
* Add avatar and issue labels
Signed-off-by: jolheiser <[email protected] >
* Fix redundant if-err
Signed-off-by: jolheiser <[email protected] >
2019-11-25 13:17:51 +08:00
John Olheiser and techknowlogick
e84326aaec
Add git hooks and webhooks to template repositories; move to services ( #8926 )
...
* Add git hooks and webhooks to template options
Signed-off-by: jolheiser <[email protected] >
* Update models/repo.go
Co-Authored-By: guillep2k <[email protected] >
* Add tooltip if the user can't edit git hooks
Signed-off-by: jolheiser <[email protected] >
* Close repositories after copying git hooks
Signed-off-by: jolheiser <[email protected] >
* Wording
Co-Authored-By: guillep2k <[email protected] >
* Restructure for services
Signed-off-by: jolheiser <[email protected] >
* Return errors
Signed-off-by: jolheiser <[email protected] >
* Move GenerateRepository to using a DBContext
Signed-off-by: jolheiser <[email protected] >
* Wrap with models.WithTx
Signed-off-by: jolheiser <[email protected] >
* Remove debug print
Signed-off-by: jolheiser <[email protected] >
* Move if-error-delete-repo outside WithTx
Signed-off-by: jolheiser <[email protected] >
* Return nil if no repo generated
Signed-off-by: jolheiser <[email protected] >
2019-11-24 12:57:52 -05:00