aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/api_repo_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix "access" fixtures and tests (#10247)guillep2k2020-02-151-1/+1
| | | | | | | | | | | | * Add fixture gen tool and fix "access" test * Close file before exiting * Add missing repo_unit for repo id: 5 * Fix count on TestAPIOrgRepos Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* API endpoint for repo transfer (#9947)65432020-01-311-0/+51
| | | | | | | | | | * squash * optimize * fail before make any changes * fix-header
* Redirect issue if repo has configured external tracker. (#9247)David Svantesson2019-12-061-3/+3
| | | | | | | | | | * Redirect issue if repo has configured external tracker. * Handle error * Add tests for redirect * Fix test consistency
* Fix "data race" in testlogger (#9159)zeripath2019-11-261-7/+7
| | | | | | * Fix data race in testlogger * Update git_helper_for_declarative_test.go
* Team permission to create repository in organization (#8312)David Svantesson2019-11-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add team permission setting to allow creating repo in organization. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test case for creating repo when have team creation access. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * build error: should omit comparison to bool constant Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add comment on exported functions * Fix fixture consistency, fix existing unit tests * Fix boolean comparison in xorm query. * addCollaborator and changeCollaborationAccessMode separate steps More clear to use different if-cases. * Create and commit xorm session * fix * Add information of create repo permission in team sidebar * Add migration step * Clarify that repository creator will be administrator. * Fix some things after merge * Fix language text that use html * migrations file * Create repository permission -> Create repositories * fix merge * fix review comments
* Template Repositories (#8768)John Olheiser2019-11-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix bug when migrate from API (#8631)Lunny Xiao2019-11-081-1/+1
| | | | | | | | | | | | * fix bug when migrate from API * fix test * fix test * improve * fix error message
* Restrict repository indexing by glob match (#7767)guillep2k2019-09-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restrict repository indexing by file extension * Use REPO_EXTENSIONS_LIST_INCLUDE instead of REPO_EXTENSIONS_LIST_EXCLUDE and have a more flexible extension pattern * Corrected to pass lint gosimple * Add wildcard support to REPO_INDEXER_EXTENSIONS * This reverts commit 72a650c8e42f4abf59d5df7cd5dc27b451494cc6. * Add wildcard support to REPO_INDEXER_EXTENSIONS (no make vendor) * Simplify isIndexable() for better clarity * Add gobwas/glob to vendors * manually set appengine new release * Implement better REPO_INDEXER_INCLUDE and REPO_INDEXER_EXCLUDE * Add unit and integration tests * Update app.ini.sample and reword config-cheat-sheet * Add doc page and correct app.ini.sample * Some polish on the doc * Simplify code as suggested by @lafriks
* SearchRepositoryByName improvements and unification (#6897)zeripath2019-05-151-21/+27
|
* 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
* Add API for manipulating Git hooks (#6436)Segev Finer2019-04-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * Add API for manipulating Git hooks Signed-off-by: Segev Finer <segev@codeocean.com> * Replace code.gitea.io/sdk with PR branch temporarily for CI * Switch back to code.gitea.io/sdk@master * Return 403 instead of 404 on no permission to edit hooks in API * Add tests for Git hooks API * Update models/repo_list_test.go Co-Authored-By: segevfiner <segev208@gmail.com> * Update models/repo_list_test.go Co-Authored-By: segevfiner <segev208@gmail.com> * empty line
* Support search operators for commits search (#6479)Mura Li2019-04-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support searching commits with prefix syntax For now, support auther: committer: When more than one prefix is supplied is presented, the result is the union. When different prefixes are supplied, the result is the intersection. For example, "author:alice author:bob" => the result is all commits authored by Alice OR Bob "hello committer:alice" => the result is all commits committed by Alice AND has the keyword 'hello' in the message. Note that there should NOT have any space after the colon(:) of the prefix. For example, "author:bill" => correct "author: bill" => wrong * Remove unneeded logging * Add missing files of test repository * Add missing repo_unit entries to test fixtures * Update test cases * Add tooltip for commits search button * Update tooltip text I have no idea about how to format it with line breaks. * Make the usage example more real * Add a test case * Add new options struct for SearchCommits * Prefer len(s) > 0 over s != "" * Add NewSearchCommitsOptions
* Return 409 when creating repo if it already exists. (#6330)Bogdan Petrea2019-03-151-0/+71
|
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* API: '/orgs/:org/repos': return private repos with read access (#5310) ↵Daniel Balko2018-11-231-12/+37
| | | | | (#3829) (#5383) Signed-off-by: Daniel Balko <inxonic+github@gmail.com>
* feat(repo): support search repository by topic name (#4505)Bo-Yi Wu2018-09-131-3/+3
| | | | * feat(repo): support search repository by topic name
* Enforce token on api routes [fixed critical security issue #4357] (#4840)B-OnTheGo2018-09-101-11/+14
|
* Fix redirect with non-ascii branch names (#4764) (#4810)SagePtr2018-09-061-3/+3
| | | | | | | | * Fix redirect with non-ascii branch names (#4764) * Add integration tests for non-ascii branch redirect * Fix mysql test and coverage test
* Allow administrator to create repository for any organization (#4368)Lauris BH2018-07-051-0/+23
|
* Check that repositories can only be migrated to own user or organizations ↵Lauris BH2018-07-051-0/+27
| | | | | | | | | | (#4366) * Repositories can only migrated to own user or organizations * Add check for organization that user does not belong to * Allow admin to migrate repositories for other users
* hide issues from org private repos w/o team assignment (#4034)David Schneiderbauer2018-06-211-3/+3
|
* Add search mode option to /api/repo/search (#2756)Morlinest2017-10-271-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | * Add repo type option to /api/repo/search * Add tests and fix result of collaborative filter in specific condition * Fix/optimize search & tests * Improve integration tests * Fix lint errors * Fix unit tests * Change and improve internal implementation of repo search * Use NonexistentID * Make search api more general * Change mirror and fork search behaviour * Fix tests & typo in comment
* Fix repository search function (#2689)Morlinest2017-10-171-5/+10
| | | | | | | | | | | | | | | | * Fix and remove FIXME * Respect membership visibility * Fix/rewrite searchRepositoryByName function * Add unit tests * Add integration tests * Remove Searcher completely * Remove trailing space
* Add repository search unit and integration tests (#2575)Morlinest2017-10-101-1/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add more repo search tests * Fix repo search tests * Always test returned repos length * Add test with lower pagesize limit (test more pages) * Add and fix /api/repo/search integration tests * Simplify unit tests code * Simplify and unify integration tests code * Improve test coverage * Temporary fix tests due to bugs in current repo search implementation * Revert removing not nil Searcher * Add more checks to tests * Simplify privacy checks in /api/repo tests * Temporary remove privacy check from repo search tests
* Fix /api/repo/search integration tests (#2550)Morlinest2017-09-201-9/+5
|
* Check for access in /repositories/:id (#2227)Ethan Koenig2017-07-301-0/+8
| | | | | | * Check for access in /repositories/:id * Integration test
* API: support '/orgs/:org/repos' (#2047)Aaron Walker2017-07-131-0/+21
| | | * API: support '/orgs/:org/repos'
* Fix repo API bug (#2133)Ethan Koenig2017-07-121-0/+12
| | | Don't require token when not necessary
* Fix GET /users/:username/repos endpoint (#2125)Ethan Koenig2017-07-101-4/+33
|
* Less verbose integration tests (#2123)Ethan Koenig2017-07-071-6/+2
| | | * Helper functions for intergration test boilerplate
* Fix improper setup for integration tests (#2050)Ethan Koenig2017-06-251-4/+2
|
* Display URLs in integration test logs (#1924)Ethan Koenig2017-06-091-4/+2
|
* fix #1643 and improve integration test (#1645)Lunny Xiao2017-04-301-0/+9
|
* bug fixed for API to get user's repos (#1622)Lunny Xiao2017-04-291-0/+23
* bug fixed for API to get user's repos * add tests and fix another place * test user2 since user1 has no repos