summaryrefslogtreecommitdiffstats
path: root/modules/convert
Commit message (Collapse)AuthorAgeFilesLines
* Honor DEFAULT_PAGING_NUM for API (#11805)Cirno the Strongest2020-06-081-1/+1
| | | | | | | | | | * Honor DEFAULT_PAGING_NUM for API * set pagination to 10 for tests * lint Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Issue/Pull expose IsLocked Property on API (#11708)65432020-06-012-0/+2
| | | | Expose IsLocked Property
* API PullReviewComment HTMLPullURL should return the HTMLURL (#11501)zeripath2020-05-201-1/+1
| | | | | | | Fix #11499 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Refactor Milestone related (#11225)65432020-05-122-1/+44
|
* API: Add pull review endpoints (#11224)65432020-05-021-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * API: Added pull review read only endpoints * Update Structs, move Conversion, Refactor * refactor * lint & co * fix lint + refactor * add new Review state, rm unessesary, refacotr loadAttributes, convert patch to diff * add DeletePullReview * add paggination * draft1: Create & submit review * fix lint * fix lint * impruve test * DONT use GhostUser for loadReviewer * expose comments_count of a PullReview * infent GetCodeCommentsCount() * fixes * fix+impruve * some nits * Handle Ghosts :ghost: * add TEST for GET apis * complete TESTS * add HTMLURL to PullReview responce * code format as per @lafriks * update swagger definition * Update routers/api/v1/repo/pull_review.go Co-authored-by: David Svantesson <davidsvantesson@gmail.com> * add comments Co-authored-by: Thomas Berger <loki@lokis-chaos.de> Co-authored-by: David Svantesson <davidsvantesson@gmail.com>
* Prevent merge of outdated PRs on protected branches (#11012)65432020-04-161-0/+1
| | | | | | | | | | | | | | | | * Block PR on Outdated Branch * finalize * cleanup * fix typo and sentences thanks @guillep2k Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* [API] Get a single commit via Ref (#10915)65432020-04-071-1/+0
| | | | | | | | | * GET /repos/:owner/:repo/commits/:ref * add Validation Checks * Fix & Extend TEST * add two new tast cases
* Allow to set protected file patterns that can not be changed under no ↵Lauris BH2020-03-271-0/+1
| | | | | conditions (#10806) Co-Authored-By: zeripath <art27@cantab.net>
* Fix branch api canPush and canMerge (#10776)Lunny Xiao2020-03-201-23/+31
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix bug on branch API (#10767)Lunny Xiao2020-03-191-3/+7
|
* Fix panic in API pulls when headbranch does not exist (#10676)zeripath2020-03-091-1/+1
| | | | | | * Fix panic in API pulls when headbranch does not exist * refix other reference to plumbing.ErrReferenceNotFound Signed-off-by: Andrew Thornton <art27@cantab.net>
* Display pull request head branch even the branch deleted or repository ↵Lunny Xiao2020-03-022-63/+68
| | | | | | | | | | | | | | | | deleted (#10413) * Display pull request head branch even the branch deleted or repository deleted * Merge getHeadRepo/loadHeadRepo and getBaseRepo/loadBaseRepo on pull and fill repo when pr.Issue.Repo is available * retrieve sha from pull head when pull request branch deleted and fix tests * Fix test * Ensure MustHeadRepoName returns empty string if no head repo Co-authored-by: zeripath <art27@cantab.net>
* adds API endpoints to manage OAuth2 Application (list/create/delete) (#10437)Gustavo Marin2020-02-291-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | * add API endpoint to create OAuth2 Application. * move endpoint to /user. Add swagger documentations and proper response type. * change json tags to snake_case. add CreateOAuth2ApplicationOptions to swagger docs. * change response status to Created (201) * add methods to list OAuth2 apps and delete an existing OAuth2 app by ID. * add APIFormat convert method and file header * fixed header * hide secret on oauth2 application list * add Created time to API response * add API integration tests for create/list/delete OAuth2 applications. Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* [Refactor] move APIFormat() of Issue and Label to convert package (#10423)65432020-02-283-2/+131
| | | | | | | | | | | | | | | | | | | * Label: delete .APIFormat() and use convert.ToLabel() * move issue APIFormat too * add missing one * move TEST too * handle error -> return empty APIIssue * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Add API branch protection endpoint (#9311)David Svantesson2020-02-121-17/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add API branch protection endpoint * lint * Change to use team names instead of ids. * Status codes. * fix * Fix * Add new branch protection options (BlockOnRejectedReviews, DismissStaleApprovals, RequireSignedCommits) * Do xorm query directly * fix xorm GetUserNamesByIDs * Add some tests * Improved GetTeamNamesByID * http status created for CreateBranchProtection * Correct status code in integration test Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* [BugFix] [API] Pull.API.Convert: Only try to get HeadBranch if HeadRepo ↵65432020-01-312-29/+50
| | | | | | | | | | | | | | exist (#10029) * only try to get HeadBranch if HeadRepo exist * impruve * no nil error * add TEST * correct error msg
* Move newbranch to standalone package (#9627)Lunny Xiao2020-01-141-2/+3
| | | | | | | | | | | | * Move newbranch to standalone package * move branch functions to modules to avoid dependencies cycles * fix tests * fix lint * fix lint
* Allow repo admin to merge PR regardless of review status (#9611)David Svantesson2020-01-111-1/+1
| | | | * Allow repo admin to merge even if review is not ok.
* Move tracked time api convert to convert package (#9665)Lunny Xiao2020-01-101-0/+38
|
* Move pull request api convert to convert package (#9664)Lunny Xiao2020-01-103-0/+180
| | | | | | * Move pull request api convert to convert package * Rename ToPullRequest to ToAPIPullRequest
* [Bug] [API] Add language to user api (#9215)65432019-11-301-0/+1
| | | | | | | | * add language to user api * OK Co-Authored-By: Lauris BH <lauris@nix.lv>
* Fix what information is shown about user in API. (#9115)David Svantesson2019-11-241-7/+7
| | | | | | * Fix what information is shown about user in API. * Use Email directly, as KeepEmailPrivate is already handled.
* Team permission to create repository in organization (#8312)David Svantesson2019-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Update branch API endpoint to show effective branch protection. (#9031)David Svantesson2019-11-161-3/+21
| | | | | | * Add API endpoint for displaying effective branch protection. * Add status checks.
* Move code.gitea.io/gitea/routers/api/v1/convert to ↵Lunny Xiao2019-11-102-0/+331
code.gitea.io/gitea/modules/convert (#8892) * Move code.gitea.io/gitea/routers/api/v1/convert to code.gitea.io/gitea/modules/convert * fix fmt