summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
* Fix diff path unquoting (#12554) (#12575)zeripath2020-08-232-30/+34
| | | | | | | | | | | | | | | | | | | Backport #12554 * Fix diff path unquoting services/gitdiff/gitdiff.go whereby there it assumed that the path would always be quoted on both sides This PR simplifies the code here and uses fmt.Fscanf to parse the strings as necessary. Fix #12546 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add testcase as per @mrsdizzie Signed-off-by: Andrew Thornton <art27@cantab.net>
* Default empty merger list to those with write permissions (#12535) (#12560)zeripath2020-08-221-1/+1
| | | | | | | | | Backport #12535 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prevent NPE on commenting on lines with invalidated comments (#12549) (#12550)zeripath2020-08-211-1/+1
| | | | | | | | | | | | | | | | * Prevent NPE on commenting on lines with invalidated comments Only check for a review if we are replying to a previous review. Prevent the NPE in #12239 by assuming that a comment without a Review is non-pending. Fix #12239 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add hack around to show the broken comments Signed-off-by: Andrew Thornton <art27@cantab.net>
* Backport to v1.12 for #12341 - Release date fix (#12351)Richard Mahn2020-07-282-1/+152
| | | | | | | | | * Backport for Issue #12341 PR #12343 - Release date fix * Adds sleep for comparing times * Fixes imports * Fixes tests
* Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) ↵65432020-06-161-1/+10
| | | | | | | (#11915) * Update CommitsAhead CommitsBehind on Pull BaseBranch Change too (#11912) * CI.restart()
* Handle more pathological branch and tag names (#11843) (#11863)zeripath2020-06-121-2/+2
| | | | | | | | | | | | | | | | Backport #11843 It's possible to push quite pathological appearing branch names to gitea using git push gitea reasonable-branch:refs/heads/-- at which point large parts of the UI will break. Similarly you can git push origin reasonable-tag:refs/tags/-- which wil return an error. This PR fixes the problems these cause. It also changes the code from creating branches to pushing to ensure that branch restoration has to pass hooks. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Ensure rejected push to refs/pull/index/head fails nicely (#11724) (#11809)zeripath2020-06-081-0/+10
| | | | | | | | | | | Backport #11724 A pre-receive hook that rejects pushes to refs/pull/index/head will cause a broken PR which causes an internal server error whenever it is viewed. This PR handles prevents the internal server error by handling non-existent pr heads and sends a flash error informing the creator there was a problem. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Check Push permissions on IsUserAllowedToUpdate (#11448)65432020-05-161-0/+11
|
* Refactor Cron and merge dashboard tasks (#10745)zeripath2020-05-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor Cron and merge dashboard tasks * Merge Cron and Dashboard tasks * Make every cron task report a system notice on completion * Refactor the creation of these tasks * Ensure that execution counts of tasks is correct * Allow cron tasks to be started from the cron page * golangci-lint fixes * Enforce that only one task with the same name can be registered Signed-off-by: Andrew Thornton <art27@cantab.net> * fix name check Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @guillep2k * as per @lafriks Signed-off-by: Andrew Thornton <art27@cantab.net> * Add git.CommandContext variants Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Handle panics that percolate up to the graceful module (#11291)zeripath2020-05-141-0/+8
| | | | | | | | | | | | | | | | | | * Handle panics in graceful goroutines Adds a some deferred functions to handle panics in graceful goroutines Signed-off-by: Andrew Thornton <art27@cantab.net> * Handle panic in webhook.Deliver Signed-off-by: Andrew Thornton <art27@cantab.net> * Handle panic in mirror.syncMirror Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix ref links in issue overviews for tags (#8742)Sijmen Schoon2020-05-142-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Properly generate ref URLs Tags used to not generate correct URLs (src/branch/tags/1.0.0 instead of src/tags/1.0.0). Also cleans up some code around it with the created helper functions. * Fix formatting and create migration * Add copyright head to utils_test * Use a raw query for the ref migration * Remove semicolon * Quote column and table names in migration SQL * Change || to CONCAT, since MSSQL does not support || * Make migration engine aware * Add missing import * Move ref EndName and URL to the issue service * Fix tests * Add test for commit refs * Update issue.go * Use the right command for building JavaScript bundles * Prepare for merge * Check for refs/* before prepending in migration * Update services/issue/issue_test.go * Update modules/git/utils_test.go Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <matti@mdranta.net>
* Sendmail should create a process on the gitea system and have a default ↵zeripath2020-05-031-1/+13
| | | | | | | | | | | | timeout (#11256) * Make sure that sendmail processes register with the process manager * Provide a timeout for these (initially of 5 minutes) * Add configurable value and tie in to documentation * Tie in to the admin config page. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix spelling mistake with Rewiew (#11262)zeripath2020-04-301-3/+3
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* When using API CreateRelease set created_unix to the tag commit time (#11218)Jason Duan2020-04-301-1/+1
|
* Support unicode emojis and remove emojify.js (#11032)mrsdizzie2020-04-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support unicode emojis and remove emojify.js This PR replaces all use of emojify.js and adds unicode emoji support to various areas of gitea. This works in a few ways: First it adds emoji parsing support into gitea itself. This allows us to * Render emojis from valid alias (:smile:) * Detect unicode emojis and let us put them in their own class with proper aria-labels and styling * Easily allow for custom "emoji" * Support all emoji rendering and features without javascript * Uses plain unicode and lets the system render in appropriate emoji font * Doesn't leave us relying on external sources for updates/fixes/features That same list of emoji is also used to create a json file which replaces the part of emojify.js that populates the emoji search tribute. This file is about 35KB with GZIP turned on and I've set it to load after the page renders to not hinder page load time (and this removes loading emojify.js also) For custom "emoji" it uses a pretty simple scheme of just looking for /emojis/img/name.png where name is something a user has put in the "allowed reactions" setting we already have. The gitea reaction that was previously hard coded into a forked copy of emojify.js is included and works as a custom reaction under this method. The emoji data sourced here is from https://github.com/github/gemoji which is the gem library Github uses for their emoji rendering (and a data source for other sites). So we should be able to easily render any emoji and :alias: that Github can, removing any errors from migrated content. They also update it as well, so we can sync when there are new unicode emoji lists released. I've included a slimmed down and slightly modified forked copy of https://github.com/knq/emoji to make up our own emoji module. The code is pretty straight forward and again allows us to have a lot of flexibility in what happens. I had seen a few comments about performance in some of the other threads if we render this ourselves, but there doesn't seem to be any issue here. In a test it can parse, convert, and render 1,000 emojis inside of a large markdown table in about 100ms on my laptop (which is many more emojis than will ever be in any normal issue). This also prevents any flickering and other weirdness from using javascript to render some things while using go for others. Not included here are image fall back URLS. I don't really think they are necessary for anything new being written in 2020. However, managing the emoji ourselves would allow us to add these as a feature later on if it seems necessary. Fixes: https://github.com/go-gitea/gitea/issues/9182 Fixes: https://github.com/go-gitea/gitea/issues/8974 Fixes: https://github.com/go-gitea/gitea/issues/8953 Fixes: https://github.com/go-gitea/gitea/issues/6628 Fixes: https://github.com/go-gitea/gitea/issues/5130 * add new shared function emojiHTML * don't increase emoji size in issue title * Update templates/repo/issue/view_content/add_reaction.tmpl Co-Authored-By: 6543 <6543@obermui.de> * Support for emoji rendering in various templates * Render code and review comments as they should be * Better way to handle mail subjects * insert unicode from tribute selection * Add template helper for plain text when needed * Use existing replace function I forgot about * Don't include emoji greater than Unicode Version 12 Only include emoji and aliases in JSON * Update build/generate-emoji.go * Tweak regex slightly to really match everything including random invisible characters. Run tests for every emoji we have * final updates * code review * code review * hard code gitea custom emoji to match previous behavior * Update .eslintrc Co-Authored-By: silverwind <me@silverwind.io> * disable preempt Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Prevent merge of outdated PRs on protected branches (#11012)65432020-04-161-2/+8
| | | | | | | | | | | | | | | | * 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>
* fix (#11066)65432020-04-141-0/+3
|
* Cache PullRequest Divergence (#10914)65432020-04-141-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cache PullRequest Divergence * only re-calc divergence if AddTestPullRequestTask() is exec * migrate already open pulls * finalize * take care of closed&not-merged+deleted-branch pull requests * fix nil pointer exeption Signed-off-by: 6543 <6543@obermui.de> * try this * no error its a warn * init gitea-repositories-meta * dont use gitDivergence type * CI.restart() * CI.restart() * CI.restart() * CI.restart() * check IsUserAllowedToUpdate independend from CommitsBehind
* remove package code.gitea.io/gitea/modules/git import out of models (#11025)65432020-04-101-1/+201
|
* Load pr Issue Poster on API too (#11033)65432020-04-101-0/+4
|
* [suggest] change merge strategy: do not check write access if user in ↵j.yao.SUSE2020-04-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge white list (#10951) * [suggest] change merge strategy: do not check write access if user in merge white list #10935 (cherry picked from commit ba74fc6389dfcad03c273441a49b54e4d38c86ee) * fix NPE * Fix cross compile (#10952) * Fix cross compile * Add test for cross compile * Fix drone * Fix drone * Also prevent CC environment not to generate Co-authored-by: zeripath <art27@cantab.net> * fix merge box icon color bug (#10974) that because need some space beturn ``text`` and color defines Signed-off-by: a1012112796 <1012112796@qq.com> * [skip ci] Updated translations via Crowdin * Allow X in addition to x in tasks (#10979) Signed-off-by: Andrew Thornton <art27@cantab.net> * remove api: merge reqRepoWriter Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 赵智超 <1012112796@qq.com> Co-authored-by: GiteaBot <teabot@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* add request review from specific reviewers feature in pull request (#10756)赵智超2020-04-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add request review feature in pull request add a way to notify specific reviewers to review like github , by add or delet a special type review . The acton is is similar to Assign , so many code reuse the function and items of Assignee, but the meaning and result is different. The Permission style is is similar to github, that only writer can add a review request from Reviewers, but the poster can recall and remove a review request after a reviwer has revied even if he don't have Write Premission. only manager , the poster and reviewer of a request review can remove it. The reviewers can be requested to review contain all readers for private repo , for public, contain all writers and watchers. The offical Review Request will block merge if Reject can block it. an other change: add ui otify for Assignees. Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Signed-off-by: a1012112796 <1012112796@qq.com> * new change * add placeholder string * do some changes follow #10238 to add review requests num on lists also change icon for review requests to eye Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix rebase conflict detection in git 2.26 (#10929)zeripath2020-04-031-6/+23
| | | | | | | | | | | | | * Fix rebase conflict detection in git 2.26 Git changed the technique used in rebase from simple apply-patches to use merge. This breaks our conflict detection code. Signed-off-by: Andrew Thornton <art27@cantab.net> * As per @techknowlogick reduce copying Signed-off-by: Andrew Thornton <art27@cantab.net>
* Generate Diff and Patch direct from Pull head (#10936)zeripath2020-04-031-17/+4
| | | | | | | | | | | | | | | | | | * Generate Diff and Patch direct from Pull head Fix #10932 Also fix "Empty Diff/Patch File when pull is merged" Closes #10934 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add tests to ensure that diff does not change Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure diffs and pulls pages work if head branch is deleted too Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent deadlock in pull_service.GetDiverging(pr) (#10905)65432020-04-012-47/+10
| | | | | * Switch to use a temporary repository instead of adding remotes to the base gitea repository to prevent deadlocking the base gitea repository. * Add documentation on how to use func **createTemporaryRepo**
* Only update merge_base in checker if not already merged (#10908)zeripath2020-04-012-2/+2
| | | | | | | | Fix #10766 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Add Organization Wide Labels (#10814)mrsdizzie2020-04-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add organization wide labels Implement organization wide labels similar to organization wide webhooks. This lets you create individual labels for organizations that can be used for all repos under that organization (so being able to reuse the same label across multiple repos). This makes it possible for small organizations with many repos to use labels effectively. Fixes #7406 * Add migration * remove comments * fix tests * Update options/locale/locale_en-US.ini Removed unused translation string * show org labels in issue search label filter * Use more clear var name * rename migration after merge from master * comment typo * update migration again after rebase with master * check for orgID <=0 per guillep2k review * fmt * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * remove unused code * Make sure RepoID is 0 when searching orgID per code review * more changes/code review requests * More descriptive translation var per code review * func description/delete comment when issue label deleted instead of hiding it * remove comment * only use issues in that repo when calculating number of open issues for org label on repo label page * Add integration test for IssuesSearch API with labels * remove unused function * Update models/issue_label.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Use subquery in GetLabelIDsInReposByNames * Fix tests to use correct orgID * fix more tests * IssuesSearch api now uses new BuildLabelNamesIssueIDsCondition. Add a few more tests as well * update comment for clarity * Revert previous code change now that we can use the new BuildLabelNamesIssueIDsCondition * Don't sort repos by date in IssuesSearch API After much debugging I've found a strange issue where in some cases MySQL will return a different result than other enigines if a query is sorted by a null collumn. For example with our integration test data where we don't set updated_unix in repository fixtures: SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 45 Returns different results for MySQL than other engines. However, the similar query: SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 30 Returns the same results. This causes integration tests to fail on MySQL in certain cases but would never show up in a real installation. Since this API call always returns issues based on the optionally provided repo_priority_id or the issueID itself, there is no change to results by changing the repo sorting method used to get ids earlier in the function. * linter is back! * code review * remove now unused option * Fix newline at end of files * more unused code * update to master * check for matching ids before query * Update models/issue_label.go Co-Authored-By: 6543 <6543@obermui.de> * Update models/issue_label.go * update comments * Update routers/org/setting.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
* Handle push rejection in branch and upload (#10854)zeripath2020-03-282-4/+8
| | | | | | | | | | | | | * Handle push rejections and push out-of-date in branch creation and file upload. * Remove the duplicated sanitize from services/pull/merge * Move the errors Err(Merge)PushOutOfDate and ErrPushRejected to modules/git * Handle errors better in the upload file dialogs Fix #10460 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix bug on pull view when required status check no ci result (#10648)Lunny Xiao2020-03-071-0/+5
|
* Update mergebase in pr checker (#10586)zeripath2020-03-031-1/+1
|
* Display pull request head branch even the branch deleted or repository ↵Lunny Xiao2020-03-024-30/+25
| | | | | | | | | | | | | | | | 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>
* Remove Unused Functions (#10516)65432020-03-021-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * remove ReplaceLeft * remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName * remove CheckUnitUser chainload to models.CheckUnitUser * remove MakeAssigneeList * remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch * remove GetRandomBytesAsBase64 * remove PushUpdateDeleteTags * remove GetUserByKeyID (you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID") * remove BasicAuthEncode from struct package -> same function in modules/base/tools ! * remove UserID from api.utils * remove unused func from structs package
* [BugFix] Avoid mailing explicit unwatched (#10475)65432020-02-271-1/+9
| | | | | | | | | | * Avoid mailing explicit unwatched * CI.restart() * back to normal Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Trigger webhooks on issue label-change via API too (#10421)65432020-02-231-0/+15
| | | | | | | | | | | | | | * trigger webhooks with api too * fix comment * notify report old too * CI restart * restart CI again * remove duplicated code
* Handle push rejection message in Merge & Web Editor (#10373)zeripath2020-02-221-0/+9
| | | | | | | | | | | | | | | | | | * Handle push rejection message in Merge * placate golangci-lint * Fix sanitize, adjust message handling * oops * Oops * Handle push-rejection in webeditor CRUD too * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv>
* Prevent panic on merge to PR (#10403)zeripath2020-02-211-0/+8
| | | | | | | | If you attempt to merge to a branch which on a PR there will be a nil pointer error in the pull request checker. This panic is uncaught and will bring down the gitea server. This PR adds protection to prevent this.
* Prevent nil pointer in GetPullRequestCommitStatusState (#10342)zeripath2020-02-181-0/+5
| | | | | Ensure that pr.HeadRepo is loaded before using it in GetPullRequestCommitStatusState. Fixes error on merging with successful commit merge statuses.
* Set the initial commit status to Success otherwise it will always be Pending ↵zeripath2020-02-171-1/+1
| | | | | (#10317) The commit status code has a bug whereby setting the initial status to Pending means you can never have the status of Success - it should be set to Success.
* Only check for conflicts/merging if the PR has not been merged in the ↵zeripath2020-02-104-46/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interim (#10132) * Only check for merging if the PR has not been merged in the interim * fixup! Only check for merging if the PR has not been merged in the interim * Try to fix test failure * Use PR2 not PR1 in tests as PR1 merges automatically * return already merged error * enforce locking * enforce locking - fix-test * enforce locking - fix-testx2 * enforce locking - fix-testx3 * move pullrequest checking to after merge This might improve the chance that the race does not affect us but does not prevent it. * Remove minor race with getting merge commit id * fixup * move check pr after merge * Remove unnecessary prepareTestEnv - onGiteaRun does this for us * Add information about when merging occuring * fix fmt * More logging * Attempt to fix mysql * Try MySQL fix again * try again * Try again?! * Try again?! * Sigh * remove the count - perhaps that will help * next remove the update id * next remove the update id - make it updated_unix instead * On failure to merge ensure that the pr is rechecked for conflict errors * On failure to merge ensure that the pr is rechecked for conflict errors * Update models/pull.go * Update models/pull.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move PushUpdateAddDeleteTags to repository module from models (#10106)Lunny Xiao2020-02-031-2/+2
| | | | | | * Move PushUpdateAddDeleteTags to repository module from models * Fix deadlock on sqlite
* Add Unique Queue infrastructure and move TestPullRequests to this (#9856)zeripath2020-02-022-60/+133
| | | | | | | | | | | | | | | | | | | | | * Upgrade levelqueue to version 0.2.0 This adds functionality for Unique Queues * Add UniqueQueue interface and functions to create them * Add UniqueQueue implementations * Move TestPullRequests over to use UniqueQueue * Reduce code duplication * Add bytefifos * Ensure invalid types are logged * Fix close race in PersistableChannelQueue Shutdown
* Fix IsErrPullClosed (#10093)Lunny Xiao2020-02-011-2/+2
|
* API endpoint for repo transfer (#9947)65432020-01-312-3/+21
| | | | | | | | | | * squash * optimize * fail before make any changes * fix-header
* PRs: Move to use a temporary repo for pushing new prs (#10009)zeripath2020-01-281-14/+30
| | | | * Move to use a temporary repo for pushing new prs
* Some refactor on git diff and ignore getting commit information failed on ↵Lunny Xiao2020-01-283-312/+3
| | | | | | | | | | | | | | migrating pull request review comments (#9996) * Some refactor on git diff and ignore getting commit information failed on migrating pull request review comments * fix test * fix lint * Change error log to warn
* Fix pull view when head repository or head branch missed and close related ↵Lunny Xiao2020-01-252-0/+81
| | | | | | | | | | | | | | | | | | pull requests when delete head repository or head branch (#9927) * fix pull view when head repository or head branch missed and close related pull requests when delete branch * fix pull view broken when head repository deleted * close pull requests when head repositories deleted * Add tests for broken pull request head repository or branch * fix typo * ignore special error when close pull request Co-authored-by: Lauris BH <lauris@nix.lv>
* Switch to use -f instead of -F for sendmail (#9961)zeripath2020-01-241-1/+1
| | | Fix #9385
* Migrate reviews when migrating repository from github (#9463)Lunny Xiao2020-01-232-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix typo * Migrate reviews when migrating repository from github * fix lint * Added test and migration when external user login * fix test * fix commented state * Some improvements * fix bug when get pull request and ref original author on code comments * Fix migrated line; Added comment for review * Don't load all pull requests attributes * Fix typo * wrong change copy head * fix tests * fix reactions * Fix test * fix fmt * fix review comment reactions
* Check if diff actually contains sections when rendering (#9926)Lauris BH2020-01-221-1/+1
|
* Fix wrong hint when status checking is running on pull request view (#9886)Lunny Xiao2020-01-221-8/+49
| | | | | | | | | | | | | | | | * Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name