aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
Commit message (Collapse)AuthorAgeFilesLines
* Return go-get info on subdirs (#15642)zeripath2021-05-091-0/+35
| | | | | | | | | | This PR is an alternative to #15628 and makes the go get handler a handler. Fix #15625 Close #15628 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [API] make change repo settings work on empty repos (#15778)65432021-05-081-4/+19
| | | | | * API: Fix #15602 * Add TEST
* Add selecting tags on the compare page (#15723)Jonathan Tran2021-05-071-0/+24
| | | | | | | | | | | * Add selecting tags on the compare page * Remove unused condition and change indentation * Fix tag tab in dropdown to be black * Add compare tag integration test Co-authored-by: Jonathan Tran <jon@allspice.io>
* fix some ui bug about draft release (#15137)a10121127962021-05-061-3/+82
| | | | | | | | | | | | | | | | | | | * fix some ui bug about draft release - should not show draft release in tag list because it will't create real tag - still show draft release without tag and commit message for draft release instead of 404 error - remove tag load for attachement links because it's useless Signed-off-by: a1012112796 <1012112796@qq.com> * add test code * fix test That's because has added a new release in relaese test database. * fix dropdown link for draft release
* Fix broken avatars since #15301 (#15731)zeripath2021-05-051-0/+87
| | | | | | | There was a missing * from the avatars routes in #15301. Fix #15727 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Unify integration test configs. (#15650)KN4CK3R2021-05-015-33/+49
|
* add `/assets` as root dir of public files (#15219)a10121127962021-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * add `/assets` as root dir of public files Signed-off-by: a1012112796 <1012112796@qq.com> * move serviceworker.js * make fmt * fix some link * fix test * Apply suggestions from code review Co-authored-by: silverwind <me@silverwind.io> * Apply suggestions from code review Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Add tests for clone from wiki (#15513)Lunny Xiao2021-04-161-0/+51
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix Benchmark tests, remove a broken one & add two new (#15250)65432021-04-165-99/+99
| | | | | | | | | | | | | | | * Benchmark Integration TESTS * CI: add benching-arm64 pipeline * BenchmarkRepo: name test case tests * Fix BenchmarkRepoBranchCommit beside Create new Branch * CI: benching use amd64 * rm total broken "BenchmarkRepo" * dont run benchmark in CI
* Fix delete nonexist oauth application 500 and prevent deadlock (#15384)Lunny Xiao2021-04-101-0/+4
| | | | | | | | | | | | | | | | | | * Fix delete nonexist oauth application 500 * Fix test * Close the session Signed-off-by: Andrew Thornton <art27@cantab.net> * Update integrations/api_oauth2_apps_test.go * Fix more missed sess.Close * Remove unnecessary blank line Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Always set the merge base used to merge the commit (#15352)zeripath2021-04-102-5/+35
| | | | | | | The issue is that the TestPatch will reset the PR MergeBase - and it is possible for TestPatch to update the MergeBase whilst a merge is ongoing. The ensuing merge will then complete but it doesn't re-set the MergeBase it used to merge the PR. Fixes the intermittent error in git test. Signed-off-by: Andrew Thornton art27@cantab.net
* rsponse 404 when delete not exist email (#15383)a10121127962021-04-101-0/+105
| | | | | fix #15357 Signed-off-by: a1012112796 <1012112796@qq.com>
* Add LFS Migration and Mirror (#14726)KN4CK3R2021-04-0820-22/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implemented LFS client. * Implemented scanning for pointer files. * Implemented downloading of lfs files. * Moved model-dependent code into services. * Removed models dependency. Added TryReadPointerFromBuffer. * Migrated code from service to module. * Centralised storage creation. * Removed dependency from models. * Moved ContentStore into modules. * Share structs between server and client. * Moved method to services. * Implemented lfs download on clone. * Implemented LFS sync on clone and mirror update. * Added form fields. * Updated templates. * Fixed condition. * Use alternate endpoint. * Added missing methods. * Fixed typo and make linter happy. * Detached pointer parser from gogit dependency. * Fixed TestGetLFSRange test. * Added context to support cancellation. * Use ReadFull to probably read more data. * Removed duplicated code from models. * Moved scan implementation into pointer_scanner_nogogit. * Changed method name. * Added comments. * Added more/specific log/error messages. * Embedded lfs.Pointer into models.LFSMetaObject. * Moved code from models to module. * Moved code from models to module. * Moved code from models to module. * Reduced pointer usage. * Embedded type. * Use promoted fields. * Fixed unexpected eof. * Added unit tests. * Implemented migration of local file paths. * Show an error on invalid LFS endpoints. * Hide settings if not used. * Added LFS info to mirror struct. * Fixed comment. * Check LFS endpoint. * Manage LFS settings from mirror page. * Fixed selector. * Adjusted selector. * Added more tests. * Added local filesystem migration test. * Fixed typo. * Reset settings. * Added special windows path handling. * Added unit test for HTTPClient. * Added unit test for BasicTransferAdapter. * Moved into util package. * Test if LFS endpoint is allowed. * Added support for git:// * Just use a static placeholder as the displayed url may be invalid. * Reverted to original code. * Added "Advanced Settings". * Updated wording. * Added discovery info link. * Implemented suggestion. * Fixed missing format parameter. * Added Pointer.IsValid(). * Always remove model on error. * Added suggestions. * Use channel instead of array. * Update routers/repo/migrate.go * fmt Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Move modules/forms to services/forms (#15305)zeripath2021-04-062-6/+6
| | | | | | | | | | | Forms are dependent on models and therefore should be in services. This PR also removes the old auth. aliasing Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Reduce memory usage in testgit (#15306)zeripath2021-04-062-25/+69
| | | | | | | * reduce memory use in rawtest * just use hashsum for diffs Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add size to Save function (#15264)zeripath2021-04-031-1/+1
| | | | | Fix #15253 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Expose resolver via API (#15167)sotho2021-03-281-1/+1
| | | * Expose resolver via API
* [refactor] Unify the export of user data via API (#15144)65432021-03-272-4/+12
| | | | | * [refactor] unify how user data is exported via API * test time via unix timestamp
* Fixed previous fix. (#15098)KN4CK3R2021-03-211-1/+3
|
* Do not convert file path to lowercase (#15023)KN4CK3R2021-03-181-0/+42
| | | | | | | | * Do not convert file path to lowercase. * lint * Check against lowercase hostname.
* Remove extraneous logging (#15020)zeripath2021-03-181-1/+10
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure validation occurs on clone addresses too (#14994)zeripath2021-03-151-5/+2
| | | | | | | | | | | | | | | | | | | | | * Ensure validation occurs on clone addresses too Fix #14984 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix api tests Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Do not show full lfs file on error in git_test.go:rawTest() (#14980)zeripath2021-03-141-2/+7
| | | | | | | | | | | | | If there is a problem uploading to LFS it is possible for the raw endpoint to return a very large file when a pointer file is expected This will then cause the drone logs to fill up unnecessarily with the contents of the very large file. If the file returned from raw is of the incorrect size we should therefore not test it see if it contains the pointer file and just declare that it is incorrect. Signed-off-by: Andrew Thornton <art27@cantab.net>
* API: fix set milestone on PR creation (#14981)Norwin2021-03-131-1/+72
| | | | | | | | | | | | | | * API: fix set milestone on PR creation pr creation via API failed with 404, because we searched for milestoneID 0, due to uninitialized var usage D: * add tests * fix expected status codes * fix tests Co-authored-by: 6543 <6543@obermui.de>
* Never add labels not from this repository or organisation and remove org ↵zeripath2021-03-121-4/+4
| | | | | | | | | | | | | | | | | | labels on transfer (#14928) * 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 * switch to use sql * subquery alias * once more around the merry go round * fix api problem
* Show private heatmap on profile to self & admins (#14881)Norwin2021-03-041-9/+6
| | | followup to #14080
* Make manual merge autodetection optional and add manual merge as merge ↵a10121127962021-03-033-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method (#12543) * Make auto check manual merge as a chooseable mod and add manual merge way on ui as title, Before this pr, we use same way with GH to check manually merge. It good, but in some special cases, misjudgments can occur. and it's hard to fix this bug. So I add option to allow repo manager block "auto check manual merge" function, Then it will have same style like gitlab(allow empty pr). and to compensate for not being able to detect THE PR merge automatically, I added a manual approach. Signed-off-by: a1012112796 <1012112796@qq.com> * make swager * api support * ping ci * fix TestPullCreate_EmptyChangesWithCommits * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> * Apply review suggestions and add test * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> * fix build * test error message * make fmt * Fix indentation issues identified by @silverwind Co-authored-by: silverwind <me@silverwind.io> * Fix tests and make manually merged disabled error on API the same Signed-off-by: Andrew Thornton <art27@cantab.net> * a small nit * fix wrong commit id error * fix bug * simple test * fix test Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-017-7/+26
| | | | | | | | | | * Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Repository transfer has to be confirmed, if user can not create repo for new ↵65432021-03-011-4/+14
| | | | | | | owner (#14792) * make repo as "pending transfer" if on transfer start doer has no right to create repo in new destination * if new pending transfer ocured, create UI & Mail notifications
* Export LFS & TimeTracking function status (#14753)65432021-02-201-3/+5
|
* [API] Add Restricted Field to User (#14630)65432021-02-181-0/+14
| | | | | | | | | | | | * Expose Restricted field for User * Add Option to Change Restricted on User via adminEditUser API * Add test who change restricted & test if it changed it ... * make generate-swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add dismiss review feature (#12674)a10121127962021-02-111-0/+16
| | | | | | | | | | | | | | | * Add dismiss review feature refs: https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/ https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request * change modal ui and error message * Add unDismissReview api Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* [API] Add delete release by tag & fix unreleased inconsistency (#14563)65432021-02-072-10/+34
| | | | | | | | | * DeleteReleaseByTag delete release not git tags * Add api to delete tag (without release) * fix & extend tests * fix swagger doc
* [API] Add affected files of commits to commit struct (#14579)65432021-02-071-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add files affected by a commit to gitea API -- similar to github * Add files affected by a commit to gitea API * Fix stupid error * Fix other stupid typo * Generate swagger tmpl * Comply with convert to git commit refacto * update swagger docs * extend test * format code * Update integrations/api_repo_git_commits_test.go * Update modules/convert/git_commit.go Co-authored-by: Laurent Cahour <laurent.cahour@dont-nod.com> Co-authored-by: zeripath <art27@cantab.net>
* [API] GetRelease by tag only return release (#14397)Cameron Braid2021-02-041-2/+1
| | | | | get release by tag should filter out tag releases to be consistent with list releases and get by id Co-authored-by: 6543 <6543@obermui.de>
* [API] Add pagination to ListBranches (#14524)65432021-02-031-2/+4
| | | | | | | | | | | | | | | | | | * make PaginateUserSlice generic -> PaginateSlice * Add pagination to ListBranches * add skip, limit to Repository.GetBranches() * Move routers/api/v1/utils/utils PaginateSlice -> modules/util/paginate.go * repo_module.GetBranches paginate * fix & rename & more logging * better description Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com>
* [API] List, Check, Add & delete endpoints for repository teams (#13630)65432021-02-011-0/+77
| | | | | | | * List, Check, Add & delete endpoints for repository teams * return units on single team responce too * Add Tests
* Update docs and comments to remove macaron (#14491)Lunny Xiao2021-01-296-11/+1
|
* Extend TestUserOrgs to cover permission cases (#14495)65432021-01-281-11/+38
| | | | | * TestMyOrgs: add unauthorized test * Extend TestUserOrgs, to cover permission cases
* Move macaron to chi (#14293)Lunny Xiao2021-01-267-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR. - [x] Define `context.ResponseWriter` interface with an implementation `context.Response`. - [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before. - [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic . - [x] Use https://github.com/unrolled/render instead of macaron's internal render - [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip - [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK** - [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha - [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache - [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding - [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors - [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation` - [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle. - [x] Removed macaron log service because it's not need any more. **BREAK** - [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition. - [x] Move Git HTTP protocol implementation to use routers directly. - [x] Fix the problem that chi routes don't support trailing slash but macaron did. - [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render. Notices: - Chi router don't support request with trailing slash - Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI. Co-authored-by: 6543 <6543@obermui.de>
* Display current stopwatch in navbar (#14122)Norwin2021-01-212-10/+6
| | | | | | | | | | | | | | | | | * add notification about running stopwatch to header * serialize seconds, duration in stopwatches api * ajax update stopwatch i should get my testenv working locally... * new variant: hover dialog * noscript compatibility * js: live-update stopwatch time * js live update robustness
* Issues overview should not show issues from archived repos (#13220)Elena Neuschild2021-01-122-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add lots of comments to user.Issues() * Answered some questions from comments * fix typo in comment * Refac user.Issues(): add func repoIDs * Refac user.Issues(): add func userRepoIDs * Refac user.Issues(): add func issueIDsFromSearch * Refac user.Issues(): improve error handling * Refac user.Issues(): add inline documentation and move variable declarations closer to their usages * Refac user.Issues(): add func repoIDMap * Refac user.Issues(): cleanup * Refac: Separate Issues from Pulls during routing * fix typo in comment * Adapt Unittests to Refactoring * Issue13171: Issue and PR Overviews now ignore archived Repositories * changed some verbatim SQL conditions to builder.Eq * models/issue.go: use OptionalBool properly Co-authored-by: 6543 <6543@obermui.de> * Use IsArchived rather than ExcludeArchivedRepos * fixed broken test after merge * added nil check * Added Unit Test securing Issue 13171 fix * Improved IsArchived filtering in issue.GetUserIssueStats * Removed unused func * Added grouping to avoid returning duplicate repo IDs Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Gitea <gitea@fake.local> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Display SVG files as images instead of text (#14101)Jonathan Tran2021-01-1236-0/+574
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change to display SVG files as images * Remove unsafe styles from SVG CSP * Add integration test to test SVG headers * Add config setting to disable SVG rendering * Add test for img tag when loading SVG image * Remove the Raw view button for svg files since we don't fully support this * Fix copyright year * Rename and move config setting * Add setting to cheat sheet in docs * Fix so that comment matches cheat sheet * Add allowing styles in CSP based on pull request feedback * Re-enable raw button since we show SVG styles now * Change so that SVG files are editable * Add UI to toggle between source and rendered image for SVGs * Change to show blame button for SVG images * Fix to update ctx data * Add test for DetectContentType when file is longer than sniffLen Co-authored-by: Jonathan Tran <jon@allspice.io> Co-authored-by: Kyle D <kdumontnu@gmail.com>
* Add option to change username to the admin panel (#14229)65432021-01-102-15/+82
| | | | | Co-authored-by: Bwko <bouwko@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net>
* Some code improvements (#14266)Lunny Xiao2021-01-061-0/+2
|
* migrate from com.* to alternatives (#14103)65432020-12-253-10/+9
| | | | | | | | | | | | | | | * remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
* Fix git.parseTagData (#14105)65432020-12-221-1/+1
| | | | | | | | | | | | | | | * Fix git.parseTagData() close #14092 * Add Test * add message to test * limit readers * git tag -m trims and terminates with a newline Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* rework heatmap permissions (#14080)Norwin2020-12-221-3/+3
| | | | | | | | | | | | | | | | * now uses the same permission model as for the activity feed: only include activities in repos, that the doer has access to. this might be somewhat slower. * also improves handling of user.KeepActivityPrivate (still shows the heatmap to self & admins) * extend tests * adjust integration test to new behaviour * add access to actions for admins * extend heatmap unit tests
* Added option to disable migrations (#13114)Paweł Bogusławski2020-12-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | * Added option to disable migrations This patch introduces DISABLE_MIGRATIONS parameter in [repository] section of app.ini (by default set to false). If set to true it blocks access to repository migration feature. This mod hides also local repo import option in user editor if local repo importing or migrations is disabled. * Alter Example config DISABLE_MIGRATIONS set to false in example config to match its default value. * HTTP error 403 instead of 500 on denied access to migration * Parameter DISABLE_MIGRATIONS exposed via API Fixes: 04b04cf854bcb3ed7659442bcf79822bdebe29e9 Author-Change-Id: IB#1105130
* Show dropdown with all statuses for commit (#13977)Cirno the Strongest2020-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show dropdown with all statuses for commit * Use popups * Remove unnecessary change * Style popup * Use divided list * As per @silverwind * Refactor GetLastCommitStatus * Missing dropdown on repo home and commit page * Fix tests * Make status icon be a part of a link on PR list * Fix missing translation call * Indent fix Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>