You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1892 lines
57 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Change target branch for pull request (#6488) * Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Make sure to check all commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change order of branch select fields Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes duplicate check Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Recompile JS Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use correct translation namespace Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove redundant if condition Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Completes comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Revert changes to go.mod Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Directly use createComment method Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove variable declaration Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds blank line Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update PR in one transaction Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
4 years ago
Change target branch for pull request (#6488) * Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Make sure to check all commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change order of branch select fields Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes duplicate check Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Recompile JS Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use correct translation namespace Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove redundant if condition Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Completes comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Revert changes to go.mod Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Directly use createComment method Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove variable declaration Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds blank line Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update PR in one transaction Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
4 years ago
9 years ago
9 years ago
Change target branch for pull request (#6488) * Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Make sure to check all commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change order of branch select fields Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes duplicate check Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Recompile JS Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use correct translation namespace Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove redundant if condition Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Completes comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Revert changes to go.mod Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Directly use createComment method Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove variable declaration Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds blank line Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update PR in one transaction Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
4 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Oauth2 consumer (#679) * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
7 years ago
Pull request review/approval and comment on code (#3748) * Initial ui components for pull request review * Add Review Add IssueComment types Signed-off-by: Jonas Franz <info@jonasfranz.software> (cherry picked from commit 2b4daab) Signed-off-by: Jonas Franz <info@jonasfranz.software> * Replace ReviewComment with Content Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add load functions Add ReviewID to findComments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add create review comment implementation Add migration for review Other small changes Signed-off-by: Jonas Franz <info@jonasfranz.software> * Simplified create and find functions for review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved "Pending" to first position Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add GetCurrentReview to simplify fetching current review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Preview for listing comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Move new comment form to its own file Signed-off-by: Jonas Franz <info@jonasfranz.software> * Implement Review form Show Review comments on comment stream Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for single comments Showing buttons in context Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add pending tag to pending review comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add unit tests for Review Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fetch all review ids at once Add unit tests Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Improved comment rendering in "Files" view by adding Comments to DiffLine Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for invalidating comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Switched back to code.gitea.io/git Signed-off-by: Jonas Franz <info@jonasfranz.software> * Moved review migration from v64 to v65 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Rebuild css Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Improve translations Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix unit tests by updating fixtures and updating outdated test Signed-off-by: Jonas Franz <info@jonasfranz.software> * Comments will be shown at the right place now Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for deleting CodeComments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix problems caused by files in subdirectories Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for showing code comments of reviews in conversation Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for "Show/Hide outdated" Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update code.gitea.io/git Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add support for new webhooks Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update comparison Signed-off-by: Jonas Franz <info@jonasfranz.software> * Resolve conflicts Signed-off-by: Jonas Franz <info@jonasfranz.software> * Minor UI improvements * update code.gitea.io/git * Fix ui bug reported by @lunny causing wrong position of add button Add functionality to "Cancel" button Add scale effects to add button Hide "Cancel" button for existing comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Prepare solving conflicts Signed-off-by: Jonas Franz <info@jonasfranz.software> * Show add button only if no comments already exist for the line Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add missing vendor files Signed-off-by: Jonas Franz <info@jonasfranz.software> * Check if reviewer is nil Signed-off-by: Jonas Franz <info@jonasfranz.software> * Show forms only to users who are logged in Signed-off-by: Jonas Franz <info@jonasfranz.software> * Revert "Show forms only to users who are logged in" This reverts commit c083682 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Save patch in comment Render patch for code comments Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add link to comment in code Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add reply form to comment list Show forms only to signed in users Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add 'Reply' as translatable Add CODE_COMMENT_LINES setting Signed-off-by: Jonas Franz <info@jonasfranz.software> * gofmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix problems introduced by checking for singed in user Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add v70 Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update generated stylesheet Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix preview Beginn with new review comment patch system Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add new algo to generate diff for line range Remove old algo used for cutting big diffs (it was very buggy) * Add documentation and example for CutDiffAroundLine * Fix example of CutDiffAroundLine * Fix some comment UI rendering bugs * Add code comment edit mode * Send notifications / actions to users until review gets published Fix diff generation bug Fix wrong hashtag * Fix vet errors * Send notifications also for single comments * Fix some notification bugs, fix link * Fix: add comment icon is only shown on code lines * Add lint comment * Add unit tests for git diff * Add more error messages * Regenerated css Signed-off-by: Jonas Franz <info@jonasfranz.software> * fmt Signed-off-by: Jonas Franz <info@jonasfranz.software> * Regenerated CSS with latest less version Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix test by updating comment type to new ID Signed-off-by: Jonas Franz <info@jonasfranz.software> * Introducing CodeComments as type for map[string]map[int64][]*Comment Other minor code improvements Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix data-tab issues Signed-off-by: Jonas Franz <info@jonasfranz.software> * Remove unnecessary change Signed-off-by: Jonas Franz <info@jonasfranz.software> * refactored checkForInvalidation Signed-off-by: Jonas Franz <info@jonasfranz.software> * Append comments instead of setting Signed-off-by: Jonas Franz <info@jonasfranz.software> * Use HeadRepo instead of BaseRepo Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update migration Signed-off-by: Jonas Franz <info@jonasfranz.de> * Regenerated CSS Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add copyright Signed-off-by: Jonas Franz <info@jonasfranz.software> * Update index.css Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package models
  6. import (
  7. "fmt"
  8. "code.gitea.io/gitea/modules/git"
  9. )
  10. // ErrNotExist represents a non-exist error.
  11. type ErrNotExist struct {
  12. ID int64
  13. }
  14. // IsErrNotExist checks if an error is an ErrNotExist
  15. func IsErrNotExist(err error) bool {
  16. _, ok := err.(ErrNotExist)
  17. return ok
  18. }
  19. func (err ErrNotExist) Error() string {
  20. return fmt.Sprintf("record does not exist [id: %d]", err.ID)
  21. }
  22. // ErrNameReserved represents a "reserved name" error.
  23. type ErrNameReserved struct {
  24. Name string
  25. }
  26. // IsErrNameReserved checks if an error is a ErrNameReserved.
  27. func IsErrNameReserved(err error) bool {
  28. _, ok := err.(ErrNameReserved)
  29. return ok
  30. }
  31. func (err ErrNameReserved) Error() string {
  32. return fmt.Sprintf("name is reserved [name: %s]", err.Name)
  33. }
  34. // ErrNamePatternNotAllowed represents a "pattern not allowed" error.
  35. type ErrNamePatternNotAllowed struct {
  36. Pattern string
  37. }
  38. // IsErrNamePatternNotAllowed checks if an error is an ErrNamePatternNotAllowed.
  39. func IsErrNamePatternNotAllowed(err error) bool {
  40. _, ok := err.(ErrNamePatternNotAllowed)
  41. return ok
  42. }
  43. func (err ErrNamePatternNotAllowed) Error() string {
  44. return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
  45. }
  46. // ErrSSHDisabled represents an "SSH disabled" error.
  47. type ErrSSHDisabled struct {
  48. }
  49. // IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
  50. func IsErrSSHDisabled(err error) bool {
  51. _, ok := err.(ErrSSHDisabled)
  52. return ok
  53. }
  54. func (err ErrSSHDisabled) Error() string {
  55. return "SSH is disabled"
  56. }
  57. // ____ ___
  58. // | | \______ ___________
  59. // | | / ___// __ \_ __ \
  60. // | | /\___ \\ ___/| | \/
  61. // |______//____ >\___ >__|
  62. // \/ \/
  63. // ErrUserAlreadyExist represents a "user already exists" error.
  64. type ErrUserAlreadyExist struct {
  65. Name string
  66. }
  67. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  68. func IsErrUserAlreadyExist(err error) bool {
  69. _, ok := err.(ErrUserAlreadyExist)
  70. return ok
  71. }
  72. func (err ErrUserAlreadyExist) Error() string {
  73. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  74. }
  75. // ErrUserNotExist represents a "UserNotExist" kind of error.
  76. type ErrUserNotExist struct {
  77. UID int64
  78. Name string
  79. KeyID int64
  80. }
  81. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  82. func IsErrUserNotExist(err error) bool {
  83. _, ok := err.(ErrUserNotExist)
  84. return ok
  85. }
  86. func (err ErrUserNotExist) Error() string {
  87. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  88. }
  89. // ErrUserProhibitLogin represents a "ErrUserProhibitLogin" kind of error.
  90. type ErrUserProhibitLogin struct {
  91. UID int64
  92. Name string
  93. }
  94. // IsErrUserProhibitLogin checks if an error is a ErrUserProhibitLogin
  95. func IsErrUserProhibitLogin(err error) bool {
  96. _, ok := err.(ErrUserProhibitLogin)
  97. return ok
  98. }
  99. func (err ErrUserProhibitLogin) Error() string {
  100. return fmt.Sprintf("user is not allowed login [uid: %d, name: %s]", err.UID, err.Name)
  101. }
  102. // ErrUserInactive represents a "ErrUserInactive" kind of error.
  103. type ErrUserInactive struct {
  104. UID int64
  105. Name string
  106. }
  107. // IsErrUserInactive checks if an error is a ErrUserInactive
  108. func IsErrUserInactive(err error) bool {
  109. _, ok := err.(ErrUserInactive)
  110. return ok
  111. }
  112. func (err ErrUserInactive) Error() string {
  113. return fmt.Sprintf("user is inactive [uid: %d, name: %s]", err.UID, err.Name)
  114. }
  115. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  116. type ErrEmailAlreadyUsed struct {
  117. Email string
  118. }
  119. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  120. func IsErrEmailAlreadyUsed(err error) bool {
  121. _, ok := err.(ErrEmailAlreadyUsed)
  122. return ok
  123. }
  124. func (err ErrEmailAlreadyUsed) Error() string {
  125. return fmt.Sprintf("e-mail already in use [email: %s]", err.Email)
  126. }
  127. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  128. type ErrOpenIDAlreadyUsed struct {
  129. OpenID string
  130. }
  131. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  132. func IsErrOpenIDAlreadyUsed(err error) bool {
  133. _, ok := err.(ErrOpenIDAlreadyUsed)
  134. return ok
  135. }
  136. func (err ErrOpenIDAlreadyUsed) Error() string {
  137. return fmt.Sprintf("OpenID already in use [oid: %s]", err.OpenID)
  138. }
  139. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  140. type ErrUserOwnRepos struct {
  141. UID int64
  142. }
  143. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  144. func IsErrUserOwnRepos(err error) bool {
  145. _, ok := err.(ErrUserOwnRepos)
  146. return ok
  147. }
  148. func (err ErrUserOwnRepos) Error() string {
  149. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  150. }
  151. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  152. type ErrUserHasOrgs struct {
  153. UID int64
  154. }
  155. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  156. func IsErrUserHasOrgs(err error) bool {
  157. _, ok := err.(ErrUserHasOrgs)
  158. return ok
  159. }
  160. func (err ErrUserHasOrgs) Error() string {
  161. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  162. }
  163. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  164. type ErrUserNotAllowedCreateOrg struct {
  165. }
  166. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  167. func IsErrUserNotAllowedCreateOrg(err error) bool {
  168. _, ok := err.(ErrUserNotAllowedCreateOrg)
  169. return ok
  170. }
  171. func (err ErrUserNotAllowedCreateOrg) Error() string {
  172. return fmt.Sprintf("user is not allowed to create organizations")
  173. }
  174. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  175. type ErrReachLimitOfRepo struct {
  176. Limit int
  177. }
  178. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  179. func IsErrReachLimitOfRepo(err error) bool {
  180. _, ok := err.(ErrReachLimitOfRepo)
  181. return ok
  182. }
  183. func (err ErrReachLimitOfRepo) Error() string {
  184. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  185. }
  186. // __ __.__ __ .__
  187. // / \ / \__| | _|__|
  188. // \ \/\/ / | |/ / |
  189. // \ /| | <| |
  190. // \__/\ / |__|__|_ \__|
  191. // \/ \/
  192. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  193. type ErrWikiAlreadyExist struct {
  194. Title string
  195. }
  196. // IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
  197. func IsErrWikiAlreadyExist(err error) bool {
  198. _, ok := err.(ErrWikiAlreadyExist)
  199. return ok
  200. }
  201. func (err ErrWikiAlreadyExist) Error() string {
  202. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  203. }
  204. // ErrWikiReservedName represents a reserved name error.
  205. type ErrWikiReservedName struct {
  206. Title string
  207. }
  208. // IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
  209. func IsErrWikiReservedName(err error) bool {
  210. _, ok := err.(ErrWikiReservedName)
  211. return ok
  212. }
  213. func (err ErrWikiReservedName) Error() string {
  214. return fmt.Sprintf("wiki title is reserved: %s", err.Title)
  215. }
  216. // ErrWikiInvalidFileName represents an invalid wiki file name.
  217. type ErrWikiInvalidFileName struct {
  218. FileName string
  219. }
  220. // IsErrWikiInvalidFileName checks if an error is an ErrWikiInvalidFileName.
  221. func IsErrWikiInvalidFileName(err error) bool {
  222. _, ok := err.(ErrWikiInvalidFileName)
  223. return ok
  224. }
  225. func (err ErrWikiInvalidFileName) Error() string {
  226. return fmt.Sprintf("Invalid wiki filename: %s", err.FileName)
  227. }
  228. // __________ ___. .__ .__ ____ __.
  229. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  230. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  231. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  232. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  233. // \/ \/ \/ \/\/
  234. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  235. type ErrKeyUnableVerify struct {
  236. Result string
  237. }
  238. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  239. func IsErrKeyUnableVerify(err error) bool {
  240. _, ok := err.(ErrKeyUnableVerify)
  241. return ok
  242. }
  243. func (err ErrKeyUnableVerify) Error() string {
  244. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  245. }
  246. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  247. type ErrKeyNotExist struct {
  248. ID int64
  249. }
  250. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  251. func IsErrKeyNotExist(err error) bool {
  252. _, ok := err.(ErrKeyNotExist)
  253. return ok
  254. }
  255. func (err ErrKeyNotExist) Error() string {
  256. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  257. }
  258. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  259. type ErrKeyAlreadyExist struct {
  260. OwnerID int64
  261. Fingerprint string
  262. Content string
  263. }
  264. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  265. func IsErrKeyAlreadyExist(err error) bool {
  266. _, ok := err.(ErrKeyAlreadyExist)
  267. return ok
  268. }
  269. func (err ErrKeyAlreadyExist) Error() string {
  270. return fmt.Sprintf("public key already exists [owner_id: %d, finger_print: %s, content: %s]",
  271. err.OwnerID, err.Fingerprint, err.Content)
  272. }
  273. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  274. type ErrKeyNameAlreadyUsed struct {
  275. OwnerID int64
  276. Name string
  277. }
  278. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  279. func IsErrKeyNameAlreadyUsed(err error) bool {
  280. _, ok := err.(ErrKeyNameAlreadyUsed)
  281. return ok
  282. }
  283. func (err ErrKeyNameAlreadyUsed) Error() string {
  284. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  285. }
  286. // ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
  287. type ErrGPGNoEmailFound struct {
  288. FailedEmails []string
  289. }
  290. // IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
  291. func IsErrGPGNoEmailFound(err error) bool {
  292. _, ok := err.(ErrGPGNoEmailFound)
  293. return ok
  294. }
  295. func (err ErrGPGNoEmailFound) Error() string {
  296. return fmt.Sprintf("none of the emails attached to the GPG key could be found: %v", err.FailedEmails)
  297. }
  298. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  299. type ErrGPGKeyParsing struct {
  300. ParseError error
  301. }
  302. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  303. func IsErrGPGKeyParsing(err error) bool {
  304. _, ok := err.(ErrGPGKeyParsing)
  305. return ok
  306. }
  307. func (err ErrGPGKeyParsing) Error() string {
  308. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  309. }
  310. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  311. type ErrGPGKeyNotExist struct {
  312. ID int64
  313. }
  314. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  315. func IsErrGPGKeyNotExist(err error) bool {
  316. _, ok := err.(ErrGPGKeyNotExist)
  317. return ok
  318. }
  319. func (err ErrGPGKeyNotExist) Error() string {
  320. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  321. }
  322. // ErrGPGKeyImportNotExist represents a "GPGKeyImportNotExist" kind of error.
  323. type ErrGPGKeyImportNotExist struct {
  324. ID string
  325. }
  326. // IsErrGPGKeyImportNotExist checks if an error is a ErrGPGKeyImportNotExist.
  327. func IsErrGPGKeyImportNotExist(err error) bool {
  328. _, ok := err.(ErrGPGKeyImportNotExist)
  329. return ok
  330. }
  331. func (err ErrGPGKeyImportNotExist) Error() string {
  332. return fmt.Sprintf("public gpg key import does not exist [id: %s]", err.ID)
  333. }
  334. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  335. type ErrGPGKeyIDAlreadyUsed struct {
  336. KeyID string
  337. }
  338. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  339. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  340. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  341. return ok
  342. }
  343. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  344. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  345. }
  346. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  347. type ErrGPGKeyAccessDenied struct {
  348. UserID int64
  349. KeyID int64
  350. }
  351. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  352. func IsErrGPGKeyAccessDenied(err error) bool {
  353. _, ok := err.(ErrGPGKeyAccessDenied)
  354. return ok
  355. }
  356. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  357. func (err ErrGPGKeyAccessDenied) Error() string {
  358. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  359. err.UserID, err.KeyID)
  360. }
  361. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  362. type ErrKeyAccessDenied struct {
  363. UserID int64
  364. KeyID int64
  365. Note string
  366. }
  367. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  368. func IsErrKeyAccessDenied(err error) bool {
  369. _, ok := err.(ErrKeyAccessDenied)
  370. return ok
  371. }
  372. func (err ErrKeyAccessDenied) Error() string {
  373. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  374. err.UserID, err.KeyID, err.Note)
  375. }
  376. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  377. type ErrDeployKeyNotExist struct {
  378. ID int64
  379. KeyID int64
  380. RepoID int64
  381. }
  382. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  383. func IsErrDeployKeyNotExist(err error) bool {
  384. _, ok := err.(ErrDeployKeyNotExist)
  385. return ok
  386. }
  387. func (err ErrDeployKeyNotExist) Error() string {
  388. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  389. }
  390. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  391. type ErrDeployKeyAlreadyExist struct {
  392. KeyID int64
  393. RepoID int64
  394. }
  395. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  396. func IsErrDeployKeyAlreadyExist(err error) bool {
  397. _, ok := err.(ErrDeployKeyAlreadyExist)
  398. return ok
  399. }
  400. func (err ErrDeployKeyAlreadyExist) Error() string {
  401. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  402. }
  403. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  404. type ErrDeployKeyNameAlreadyUsed struct {
  405. RepoID int64
  406. Name string
  407. }
  408. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  409. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  410. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  411. return ok
  412. }
  413. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  414. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  415. }
  416. // _____ ___________ __
  417. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  418. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  419. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  420. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  421. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  422. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  423. type ErrAccessTokenNotExist struct {
  424. Token string
  425. }
  426. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  427. func IsErrAccessTokenNotExist(err error) bool {
  428. _, ok := err.(ErrAccessTokenNotExist)
  429. return ok
  430. }
  431. func (err ErrAccessTokenNotExist) Error() string {
  432. return fmt.Sprintf("access token does not exist [sha: %s]", err.Token)
  433. }
  434. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  435. type ErrAccessTokenEmpty struct {
  436. }
  437. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  438. func IsErrAccessTokenEmpty(err error) bool {
  439. _, ok := err.(ErrAccessTokenEmpty)
  440. return ok
  441. }
  442. func (err ErrAccessTokenEmpty) Error() string {
  443. return fmt.Sprintf("access token is empty")
  444. }
  445. // ________ .__ __ .__
  446. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  447. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  448. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  449. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  450. // \/ /_____/ \/ \/ \/ \/ \/
  451. // ErrOrgNotExist represents a "OrgNotExist" kind of error.
  452. type ErrOrgNotExist struct {
  453. ID int64
  454. Name string
  455. }
  456. // IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
  457. func IsErrOrgNotExist(err error) bool {
  458. _, ok := err.(ErrOrgNotExist)
  459. return ok
  460. }
  461. func (err ErrOrgNotExist) Error() string {
  462. return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
  463. }
  464. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  465. type ErrLastOrgOwner struct {
  466. UID int64
  467. }
  468. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  469. func IsErrLastOrgOwner(err error) bool {
  470. _, ok := err.(ErrLastOrgOwner)
  471. return ok
  472. }
  473. func (err ErrLastOrgOwner) Error() string {
  474. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  475. }
  476. //.____ ____________________
  477. //| | \_ _____/ _____/
  478. //| | | __) \_____ \
  479. //| |___| \ / \
  480. //|_______ \___ / /_______ /
  481. // \/ \/ \/
  482. // ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.
  483. type ErrLFSLockNotExist struct {
  484. ID int64
  485. RepoID int64
  486. Path string
  487. }
  488. // IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.
  489. func IsErrLFSLockNotExist(err error) bool {
  490. _, ok := err.(ErrLFSLockNotExist)
  491. return ok
  492. }
  493. func (err ErrLFSLockNotExist) Error() string {
  494. return fmt.Sprintf("lfs lock does not exist [id: %d, rid: %d, path: %s]", err.ID, err.RepoID, err.Path)
  495. }
  496. // ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.
  497. type ErrLFSUnauthorizedAction struct {
  498. RepoID int64
  499. UserName string
  500. Mode AccessMode
  501. }
  502. // IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
  503. func IsErrLFSUnauthorizedAction(err error) bool {
  504. _, ok := err.(ErrLFSUnauthorizedAction)
  505. return ok
  506. }
  507. func (err ErrLFSUnauthorizedAction) Error() string {
  508. if err.Mode == AccessModeWrite {
  509. return fmt.Sprintf("User %s doesn't have write access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  510. }
  511. return fmt.Sprintf("User %s doesn't have read access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  512. }
  513. // ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.
  514. type ErrLFSLockAlreadyExist struct {
  515. RepoID int64
  516. Path string
  517. }
  518. // IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.
  519. func IsErrLFSLockAlreadyExist(err error) bool {
  520. _, ok := err.(ErrLFSLockAlreadyExist)
  521. return ok
  522. }
  523. func (err ErrLFSLockAlreadyExist) Error() string {
  524. return fmt.Sprintf("lfs lock already exists [rid: %d, path: %s]", err.RepoID, err.Path)
  525. }
  526. // ErrLFSFileLocked represents a "LFSFileLocked" kind of error.
  527. type ErrLFSFileLocked struct {
  528. RepoID int64
  529. Path string
  530. UserName string
  531. }
  532. // IsErrLFSFileLocked checks if an error is a ErrLFSFileLocked.
  533. func IsErrLFSFileLocked(err error) bool {
  534. _, ok := err.(ErrLFSFileLocked)
  535. return ok
  536. }
  537. func (err ErrLFSFileLocked) Error() string {
  538. return fmt.Sprintf("File is lfs locked [repo: %d, locked by: %s, path: %s]", err.RepoID, err.UserName, err.Path)
  539. }
  540. // __________ .__ __
  541. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  542. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  543. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  544. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  545. // \/ \/|__| \/ \/
  546. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  547. type ErrRepoNotExist struct {
  548. ID int64
  549. UID int64
  550. OwnerName string
  551. Name string
  552. }
  553. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  554. func IsErrRepoNotExist(err error) bool {
  555. _, ok := err.(ErrRepoNotExist)
  556. return ok
  557. }
  558. func (err ErrRepoNotExist) Error() string {
  559. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, owner_name: %s, name: %s]",
  560. err.ID, err.UID, err.OwnerName, err.Name)
  561. }
  562. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  563. type ErrRepoAlreadyExist struct {
  564. Uname string
  565. Name string
  566. }
  567. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  568. func IsErrRepoAlreadyExist(err error) bool {
  569. _, ok := err.(ErrRepoAlreadyExist)
  570. return ok
  571. }
  572. func (err ErrRepoAlreadyExist) Error() string {
  573. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  574. }
  575. // ErrForkAlreadyExist represents a "ForkAlreadyExist" kind of error.
  576. type ErrForkAlreadyExist struct {
  577. Uname string
  578. RepoName string
  579. ForkName string
  580. }
  581. // IsErrForkAlreadyExist checks if an error is an ErrForkAlreadyExist.
  582. func IsErrForkAlreadyExist(err error) bool {
  583. _, ok := err.(ErrForkAlreadyExist)
  584. return ok
  585. }
  586. func (err ErrForkAlreadyExist) Error() string {
  587. return fmt.Sprintf("repository is already forked by user [uname: %s, repo path: %s, fork path: %s]", err.Uname, err.RepoName, err.ForkName)
  588. }
  589. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  590. type ErrRepoRedirectNotExist struct {
  591. OwnerID int64
  592. RepoName string
  593. }
  594. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist.
  595. func IsErrRepoRedirectNotExist(err error) bool {
  596. _, ok := err.(ErrRepoRedirectNotExist)
  597. return ok
  598. }
  599. func (err ErrRepoRedirectNotExist) Error() string {
  600. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  601. }
  602. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  603. type ErrInvalidCloneAddr struct {
  604. IsURLError bool
  605. IsInvalidPath bool
  606. IsPermissionDenied bool
  607. }
  608. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  609. func IsErrInvalidCloneAddr(err error) bool {
  610. _, ok := err.(ErrInvalidCloneAddr)
  611. return ok
  612. }
  613. func (err ErrInvalidCloneAddr) Error() string {
  614. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  615. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  616. }
  617. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  618. type ErrUpdateTaskNotExist struct {
  619. UUID string
  620. }
  621. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  622. func IsErrUpdateTaskNotExist(err error) bool {
  623. _, ok := err.(ErrUpdateTaskNotExist)
  624. return ok
  625. }
  626. func (err ErrUpdateTaskNotExist) Error() string {
  627. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  628. }
  629. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  630. type ErrReleaseAlreadyExist struct {
  631. TagName string
  632. }
  633. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  634. func IsErrReleaseAlreadyExist(err error) bool {
  635. _, ok := err.(ErrReleaseAlreadyExist)
  636. return ok
  637. }
  638. func (err ErrReleaseAlreadyExist) Error() string {
  639. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  640. }
  641. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  642. type ErrReleaseNotExist struct {
  643. ID int64
  644. TagName string
  645. }
  646. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  647. func IsErrReleaseNotExist(err error) bool {
  648. _, ok := err.(ErrReleaseNotExist)
  649. return ok
  650. }
  651. func (err ErrReleaseNotExist) Error() string {
  652. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  653. }
  654. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  655. type ErrInvalidTagName struct {
  656. TagName string
  657. }
  658. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  659. func IsErrInvalidTagName(err error) bool {
  660. _, ok := err.(ErrInvalidTagName)
  661. return ok
  662. }
  663. func (err ErrInvalidTagName) Error() string {
  664. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  665. }
  666. // ErrRepoFileAlreadyExists represents a "RepoFileAlreadyExist" kind of error.
  667. type ErrRepoFileAlreadyExists struct {
  668. Path string
  669. }
  670. // IsErrRepoFileAlreadyExists checks if an error is a ErrRepoFileAlreadyExists.
  671. func IsErrRepoFileAlreadyExists(err error) bool {
  672. _, ok := err.(ErrRepoFileAlreadyExists)
  673. return ok
  674. }
  675. func (err ErrRepoFileAlreadyExists) Error() string {
  676. return fmt.Sprintf("repository file already exists [path: %s]", err.Path)
  677. }
  678. // ErrRepoFileDoesNotExist represents a "RepoFileDoesNotExist" kind of error.
  679. type ErrRepoFileDoesNotExist struct {
  680. Path string
  681. Name string
  682. }
  683. // IsErrRepoFileDoesNotExist checks if an error is a ErrRepoDoesNotExist.
  684. func IsErrRepoFileDoesNotExist(err error) bool {
  685. _, ok := err.(ErrRepoFileDoesNotExist)
  686. return ok
  687. }
  688. func (err ErrRepoFileDoesNotExist) Error() string {
  689. return fmt.Sprintf("repository file does not exist [path: %s]", err.Path)
  690. }
  691. // ErrFilenameInvalid represents a "FilenameInvalid" kind of error.
  692. type ErrFilenameInvalid struct {
  693. Path string
  694. }
  695. // IsErrFilenameInvalid checks if an error is an ErrFilenameInvalid.
  696. func IsErrFilenameInvalid(err error) bool {
  697. _, ok := err.(ErrFilenameInvalid)
  698. return ok
  699. }
  700. func (err ErrFilenameInvalid) Error() string {
  701. return fmt.Sprintf("path contains a malformed path component [path: %s]", err.Path)
  702. }
  703. // ErrUserCannotCommit represents "UserCannotCommit" kind of error.
  704. type ErrUserCannotCommit struct {
  705. UserName string
  706. }
  707. // IsErrUserCannotCommit checks if an error is an ErrUserCannotCommit.
  708. func IsErrUserCannotCommit(err error) bool {
  709. _, ok := err.(ErrUserCannotCommit)
  710. return ok
  711. }
  712. func (err ErrUserCannotCommit) Error() string {
  713. return fmt.Sprintf("user cannot commit to repo [user: %s]", err.UserName)
  714. }
  715. // ErrFilePathInvalid represents a "FilePathInvalid" kind of error.
  716. type ErrFilePathInvalid struct {
  717. Message string
  718. Path string
  719. Name string
  720. Type git.EntryMode
  721. }
  722. // IsErrFilePathInvalid checks if an error is an ErrFilePathInvalid.
  723. func IsErrFilePathInvalid(err error) bool {
  724. _, ok := err.(ErrFilePathInvalid)
  725. return ok
  726. }
  727. func (err ErrFilePathInvalid) Error() string {
  728. if err.Message != "" {
  729. return err.Message
  730. }
  731. return fmt.Sprintf("path is invalid [path: %s]", err.Path)
  732. }
  733. // ErrUserDoesNotHaveAccessToRepo represets an error where the user doesn't has access to a given repo.
  734. type ErrUserDoesNotHaveAccessToRepo struct {
  735. UserID int64
  736. RepoName string
  737. }
  738. // IsErrUserDoesNotHaveAccessToRepo checks if an error is a ErrRepoFileAlreadyExists.
  739. func IsErrUserDoesNotHaveAccessToRepo(err error) bool {
  740. _, ok := err.(ErrUserDoesNotHaveAccessToRepo)
  741. return ok
  742. }
  743. func (err ErrUserDoesNotHaveAccessToRepo) Error() string {
  744. return fmt.Sprintf("user doesn't have acces to repo [user_id: %d, repo_name: %s]", err.UserID, err.RepoName)
  745. }
  746. // ErrWontSign explains the first reason why a commit would not be signed
  747. // There may be other reasons - this is just the first reason found
  748. type ErrWontSign struct {
  749. Reason signingMode
  750. }
  751. func (e *ErrWontSign) Error() string {
  752. return fmt.Sprintf("wont sign: %s", e.Reason)
  753. }
  754. // IsErrWontSign checks if an error is a ErrWontSign
  755. func IsErrWontSign(err error) bool {
  756. _, ok := err.(*ErrWontSign)
  757. return ok
  758. }
  759. // __________ .__
  760. // \______ \____________ ____ ____ | |__
  761. // | | _/\_ __ \__ \ / \_/ ___\| | \
  762. // | | \ | | \// __ \| | \ \___| Y \
  763. // |______ / |__| (____ /___| /\___ >___| /
  764. // \/ \/ \/ \/ \/
  765. // ErrBranchAlreadyExists represents an error that branch with such name already exists.
  766. type ErrBranchAlreadyExists struct {
  767. BranchName string
  768. }
  769. // IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
  770. func IsErrBranchAlreadyExists(err error) bool {
  771. _, ok := err.(ErrBranchAlreadyExists)
  772. return ok
  773. }
  774. func (err ErrBranchAlreadyExists) Error() string {
  775. return fmt.Sprintf("branch already exists [name: %s]", err.BranchName)
  776. }
  777. // ErrBranchNameConflict represents an error that branch name conflicts with other branch.
  778. type ErrBranchNameConflict struct {
  779. BranchName string
  780. }
  781. // IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
  782. func IsErrBranchNameConflict(err error) bool {
  783. _, ok := err.(ErrBranchNameConflict)
  784. return ok
  785. }
  786. func (err ErrBranchNameConflict) Error() string {
  787. return fmt.Sprintf("branch conflicts with existing branch [name: %s]", err.BranchName)
  788. }
  789. // ErrBranchesEqual represents an error that branch name conflicts with other branch.
  790. type ErrBranchesEqual struct {
  791. BaseBranchName string
  792. HeadBranchName string
  793. }
  794. // IsErrBranchesEqual checks if an error is an ErrBranchesEqual.
  795. func IsErrBranchesEqual(err error) bool {
  796. _, ok := err.(ErrBranchesEqual)
  797. return ok
  798. }
  799. func (err ErrBranchesEqual) Error() string {
  800. return fmt.Sprintf("branches are equal [head: %sm base: %s]", err.HeadBranchName, err.BaseBranchName)
  801. }
  802. // ErrNotAllowedToMerge represents an error that a branch is protected and the current user is not allowed to modify it.
  803. type ErrNotAllowedToMerge struct {
  804. Reason string
  805. }
  806. // IsErrNotAllowedToMerge checks if an error is an ErrNotAllowedToMerge.
  807. func IsErrNotAllowedToMerge(err error) bool {
  808. _, ok := err.(ErrNotAllowedToMerge)
  809. return ok
  810. }
  811. func (err ErrNotAllowedToMerge) Error() string {
  812. return fmt.Sprintf("not allowed to merge [reason: %s]", err.Reason)
  813. }
  814. // ErrTagAlreadyExists represents an error that tag with such name already exists.
  815. type ErrTagAlreadyExists struct {
  816. TagName string
  817. }
  818. // IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
  819. func IsErrTagAlreadyExists(err error) bool {
  820. _, ok := err.(ErrTagAlreadyExists)
  821. return ok
  822. }
  823. func (err ErrTagAlreadyExists) Error() string {
  824. return fmt.Sprintf("tag already exists [name: %s]", err.TagName)
  825. }
  826. // ErrSHADoesNotMatch represents a "SHADoesNotMatch" kind of error.
  827. type ErrSHADoesNotMatch struct {
  828. Path string
  829. GivenSHA string
  830. CurrentSHA string
  831. }
  832. // IsErrSHADoesNotMatch checks if an error is a ErrSHADoesNotMatch.
  833. func IsErrSHADoesNotMatch(err error) bool {
  834. _, ok := err.(ErrSHADoesNotMatch)
  835. return ok
  836. }
  837. func (err ErrSHADoesNotMatch) Error() string {
  838. return fmt.Sprintf("sha does not match [given: %s, expected: %s]", err.GivenSHA, err.CurrentSHA)
  839. }
  840. // ErrSHANotFound represents a "SHADoesNotMatch" kind of error.
  841. type ErrSHANotFound struct {
  842. SHA string
  843. }
  844. // IsErrSHANotFound checks if an error is a ErrSHANotFound.
  845. func IsErrSHANotFound(err error) bool {
  846. _, ok := err.(ErrSHANotFound)
  847. return ok
  848. }
  849. func (err ErrSHANotFound) Error() string {
  850. return fmt.Sprintf("sha not found [%s]", err.SHA)
  851. }
  852. // ErrCommitIDDoesNotMatch represents a "CommitIDDoesNotMatch" kind of error.
  853. type ErrCommitIDDoesNotMatch struct {
  854. GivenCommitID string
  855. CurrentCommitID string
  856. }
  857. // IsErrCommitIDDoesNotMatch checks if an error is a ErrCommitIDDoesNotMatch.
  858. func IsErrCommitIDDoesNotMatch(err error) bool {
  859. _, ok := err.(ErrCommitIDDoesNotMatch)
  860. return ok
  861. }
  862. func (err ErrCommitIDDoesNotMatch) Error() string {
  863. return fmt.Sprintf("file CommitID does not match [given: %s, expected: %s]", err.GivenCommitID, err.CurrentCommitID)
  864. }
  865. // ErrSHAOrCommitIDNotProvided represents a "SHAOrCommitIDNotProvided" kind of error.
  866. type ErrSHAOrCommitIDNotProvided struct{}
  867. // IsErrSHAOrCommitIDNotProvided checks if an error is a ErrSHAOrCommitIDNotProvided.
  868. func IsErrSHAOrCommitIDNotProvided(err error) bool {
  869. _, ok := err.(ErrSHAOrCommitIDNotProvided)
  870. return ok
  871. }
  872. func (err ErrSHAOrCommitIDNotProvided) Error() string {
  873. return fmt.Sprintf("a SHA or commmit ID must be proved when updating a file")
  874. }
  875. // __ __ ___. .__ __
  876. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  877. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  878. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  879. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  880. // \/ \/ \/ \/ \/
  881. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  882. type ErrWebhookNotExist struct {
  883. ID int64
  884. }
  885. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  886. func IsErrWebhookNotExist(err error) bool {
  887. _, ok := err.(ErrWebhookNotExist)
  888. return ok
  889. }
  890. func (err ErrWebhookNotExist) Error() string {
  891. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  892. }
  893. // .___
  894. // | | ______ ________ __ ____
  895. // | |/ ___// ___/ | \_/ __ \
  896. // | |\___ \ \___ \| | /\ ___/
  897. // |___/____ >____ >____/ \___ >
  898. // \/ \/ \/
  899. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  900. type ErrIssueNotExist struct {
  901. ID int64
  902. RepoID int64
  903. Index int64
  904. }
  905. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  906. func IsErrIssueNotExist(err error) bool {
  907. _, ok := err.(ErrIssueNotExist)
  908. return ok
  909. }
  910. func (err ErrIssueNotExist) Error() string {
  911. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  912. }
  913. // ErrIssueIsClosed represents a "IssueIsClosed" kind of error.
  914. type ErrIssueIsClosed struct {
  915. ID int64
  916. RepoID int64
  917. Index int64
  918. }
  919. // IsErrIssueIsClosed checks if an error is a ErrIssueNotExist.
  920. func IsErrIssueIsClosed(err error) bool {
  921. _, ok := err.(ErrIssueIsClosed)
  922. return ok
  923. }
  924. func (err ErrIssueIsClosed) Error() string {
  925. return fmt.Sprintf("issue is closed [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  926. }
  927. // ErrIssueLabelTemplateLoad represents a "ErrIssueLabelTemplateLoad" kind of error.
  928. type ErrIssueLabelTemplateLoad struct {
  929. TemplateFile string
  930. OriginalError error
  931. }
  932. // IsErrIssueLabelTemplateLoad checks if an error is a ErrIssueLabelTemplateLoad.
  933. func IsErrIssueLabelTemplateLoad(err error) bool {
  934. _, ok := err.(ErrIssueLabelTemplateLoad)
  935. return ok
  936. }
  937. func (err ErrIssueLabelTemplateLoad) Error() string {
  938. return fmt.Sprintf("Failed to load label template file '%s': %v", err.TemplateFile, err.OriginalError)
  939. }
  940. // ErrNewIssueInsert is used when the INSERT statement in newIssue fails
  941. type ErrNewIssueInsert struct {
  942. OriginalError error
  943. }
  944. // IsErrNewIssueInsert checks if an error is a ErrNewIssueInsert.
  945. func IsErrNewIssueInsert(err error) bool {
  946. _, ok := err.(ErrNewIssueInsert)
  947. return ok
  948. }
  949. func (err ErrNewIssueInsert) Error() string {
  950. return err.OriginalError.Error()
  951. }
  952. // ErrIssueWasClosed is used when close a closed issue
  953. type ErrIssueWasClosed struct {
  954. ID int64
  955. Index int64
  956. }
  957. // IsErrIssueWasClosed checks if an error is a ErrIssueWasClosed.
  958. func IsErrIssueWasClosed(err error) bool {
  959. _, ok := err.(ErrIssueWasClosed)
  960. return ok
  961. }
  962. func (err ErrIssueWasClosed) Error() string {
  963. return fmt.Sprintf("Issue [%d] %d was already closed", err.ID, err.Index)
  964. }
  965. // ErrPullWasClosed is used close a closed pull request
  966. type ErrPullWasClosed struct {
  967. ID int64
  968. Index int64
  969. }
  970. // IsErrPullWasClosed checks if an error is a ErrErrPullWasClosed.
  971. func IsErrPullWasClosed(err error) bool {
  972. _, ok := err.(ErrPullWasClosed)
  973. return ok
  974. }
  975. func (err ErrPullWasClosed) Error() string {
  976. return fmt.Sprintf("Pull request [%d] %d was already closed", err.ID, err.Index)
  977. }
  978. // ErrForbiddenIssueReaction is used when a forbidden reaction was try to created
  979. type ErrForbiddenIssueReaction struct {
  980. Reaction string
  981. }
  982. // IsErrForbiddenIssueReaction checks if an error is a ErrForbiddenIssueReaction.
  983. func IsErrForbiddenIssueReaction(err error) bool {
  984. _, ok := err.(ErrForbiddenIssueReaction)
  985. return ok
  986. }
  987. func (err ErrForbiddenIssueReaction) Error() string {
  988. return fmt.Sprintf("'%s' is not an allowed reaction", err.Reaction)
  989. }
  990. // ErrReactionAlreadyExist is used when a existing reaction was try to created
  991. type ErrReactionAlreadyExist struct {
  992. Reaction string
  993. }
  994. // IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
  995. func IsErrReactionAlreadyExist(err error) bool {
  996. _, ok := err.(ErrReactionAlreadyExist)
  997. return ok
  998. }
  999. func (err ErrReactionAlreadyExist) Error() string {
  1000. return fmt.Sprintf("reaction '%s' already exists", err.Reaction)
  1001. }
  1002. // __________ .__ .__ __________ __
  1003. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  1004. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  1005. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  1006. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  1007. // \/ \/ |__| \/ \/
  1008. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  1009. type ErrPullRequestNotExist struct {
  1010. ID int64
  1011. IssueID int64
  1012. HeadRepoID int64
  1013. BaseRepoID int64
  1014. HeadBranch string
  1015. BaseBranch string
  1016. }
  1017. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  1018. func IsErrPullRequestNotExist(err error) bool {
  1019. _, ok := err.(ErrPullRequestNotExist)
  1020. return ok
  1021. }
  1022. func (err ErrPullRequestNotExist) Error() string {
  1023. return fmt.Sprintf("pull request does not exist [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  1024. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  1025. }
  1026. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  1027. type ErrPullRequestAlreadyExists struct {
  1028. ID int64
  1029. IssueID int64
  1030. HeadRepoID int64
  1031. BaseRepoID int64
  1032. HeadBranch string
  1033. BaseBranch string
  1034. }
  1035. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  1036. func IsErrPullRequestAlreadyExists(err error) bool {
  1037. _, ok := err.(ErrPullRequestAlreadyExists)
  1038. return ok
  1039. }
  1040. // Error does pretty-printing :D
  1041. func (err ErrPullRequestAlreadyExists) Error() string {
  1042. return fmt.Sprintf("pull request already exists for these targets [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  1043. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  1044. }
  1045. // ErrPullRequestHeadRepoMissing represents a "ErrPullRequestHeadRepoMissing" error
  1046. type ErrPullRequestHeadRepoMissing struct {
  1047. ID int64
  1048. HeadRepoID int64
  1049. }
  1050. // IsErrErrPullRequestHeadRepoMissing checks if an error is a ErrPullRequestHeadRepoMissing.
  1051. func IsErrErrPullRequestHeadRepoMissing(err error) bool {
  1052. _, ok := err.(ErrPullRequestHeadRepoMissing)
  1053. return ok
  1054. }
  1055. // Error does pretty-printing :D
  1056. func (err ErrPullRequestHeadRepoMissing) Error() string {
  1057. return fmt.Sprintf("pull request head repo missing [id: %d, head_repo_id: %d]",
  1058. err.ID, err.HeadRepoID)
  1059. }
  1060. // ErrInvalidMergeStyle represents an error if merging with disabled merge strategy
  1061. type ErrInvalidMergeStyle struct {
  1062. ID int64
  1063. Style MergeStyle
  1064. }
  1065. // IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.
  1066. func IsErrInvalidMergeStyle(err error) bool {
  1067. _, ok := err.(ErrInvalidMergeStyle)
  1068. return ok
  1069. }
  1070. func (err ErrInvalidMergeStyle) Error() string {
  1071. return fmt.Sprintf("merge strategy is not allowed or is invalid [repo_id: %d, strategy: %s]",
  1072. err.ID, err.Style)
  1073. }
  1074. // ErrMergeConflicts represents an error if merging fails with a conflict
  1075. type ErrMergeConflicts struct {
  1076. Style MergeStyle
  1077. StdOut string
  1078. StdErr string
  1079. Err error
  1080. }
  1081. // IsErrMergeConflicts checks if an error is a ErrMergeConflicts.
  1082. func IsErrMergeConflicts(err error) bool {
  1083. _, ok := err.(ErrMergeConflicts)
  1084. return ok
  1085. }
  1086. func (err ErrMergeConflicts) Error() string {
  1087. return fmt.Sprintf("Merge Conflict Error: %v: %s\n%s", err.Err, err.StdErr, err.StdOut)
  1088. }
  1089. // ErrMergeUnrelatedHistories represents an error if merging fails due to unrelated histories
  1090. type ErrMergeUnrelatedHistories struct {
  1091. Style MergeStyle
  1092. StdOut string
  1093. StdErr string
  1094. Err error
  1095. }
  1096. // IsErrMergeUnrelatedHistories checks if an error is a ErrMergeUnrelatedHistories.
  1097. func IsErrMergeUnrelatedHistories(err error) bool {
  1098. _, ok := err.(ErrMergeUnrelatedHistories)
  1099. return ok
  1100. }
  1101. func (err ErrMergeUnrelatedHistories) Error() string {
  1102. return fmt.Sprintf("Merge UnrelatedHistories Error: %v: %s\n%s", err.Err, err.StdErr, err.StdOut)
  1103. }
  1104. // ErrMergePushOutOfDate represents an error if merging fails due to unrelated histories
  1105. type ErrMergePushOutOfDate struct {
  1106. Style MergeStyle
  1107. StdOut string
  1108. StdErr string
  1109. Err error
  1110. }
  1111. // IsErrMergePushOutOfDate checks if an error is a ErrMergePushOutOfDate.
  1112. func IsErrMergePushOutOfDate(err error) bool {
  1113. _, ok := err.(ErrMergePushOutOfDate)
  1114. return ok
  1115. }
  1116. func (err ErrMergePushOutOfDate) Error() string {
  1117. return fmt.Sprintf("Merge PushOutOfDate Error: %v: %s\n%s", err.Err, err.StdErr, err.StdOut)
  1118. }
  1119. // ErrRebaseConflicts represents an error if rebase fails with a conflict
  1120. type ErrRebaseConflicts struct {
  1121. Style MergeStyle
  1122. CommitSHA string
  1123. StdOut string
  1124. StdErr string
  1125. Err error
  1126. }
  1127. // IsErrRebaseConflicts checks if an error is a ErrRebaseConflicts.
  1128. func IsErrRebaseConflicts(err error) bool {
  1129. _, ok := err.(ErrRebaseConflicts)
  1130. return ok
  1131. }
  1132. func (err ErrRebaseConflicts) Error() string {
  1133. return fmt.Sprintf("Rebase Error: %v: Whilst Rebasing: %s\n%s\n%s", err.Err, err.CommitSHA, err.StdErr, err.StdOut)
  1134. }
  1135. // ErrPullRequestHasMerged represents a "PullRequestHasMerged"-error
  1136. type ErrPullRequestHasMerged struct {
  1137. ID int64
  1138. IssueID int64
  1139. HeadRepoID int64
  1140. BaseRepoID int64
  1141. HeadBranch string
  1142. BaseBranch string
  1143. }
  1144. // IsErrPullRequestHasMerged checks if an error is a ErrPullRequestHasMerged.
  1145. func IsErrPullRequestHasMerged(err error) bool {
  1146. _, ok := err.(ErrPullRequestHasMerged)
  1147. return ok
  1148. }
  1149. // Error does pretty-printing :D
  1150. func (err ErrPullRequestHasMerged) Error() string {
  1151. return fmt.Sprintf("pull request has merged [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  1152. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  1153. }
  1154. // _________ __
  1155. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  1156. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  1157. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  1158. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  1159. // \/ \/ \/ \/ \/
  1160. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  1161. type ErrCommentNotExist struct {
  1162. ID int64
  1163. IssueID int64
  1164. }
  1165. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  1166. func IsErrCommentNotExist(err error) bool {
  1167. _, ok := err.(ErrCommentNotExist)
  1168. return ok
  1169. }
  1170. func (err ErrCommentNotExist) Error() string {
  1171. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  1172. }
  1173. // _________ __ __ .__
  1174. // / _____// |_ ____ ________ _ _______ _/ |_ ____ | |__
  1175. // \_____ \\ __\/ _ \\____ \ \/ \/ /\__ \\ __\/ ___\| | \
  1176. // / \| | ( <_> ) |_> > / / __ \| | \ \___| Y \
  1177. // /_______ /|__| \____/| __/ \/\_/ (____ /__| \___ >___| /
  1178. // \/ |__| \/ \/ \/
  1179. // ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
  1180. type ErrStopwatchNotExist struct {
  1181. ID int64
  1182. }
  1183. // IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
  1184. func IsErrStopwatchNotExist(err error) bool {
  1185. _, ok := err.(ErrStopwatchNotExist)
  1186. return ok
  1187. }
  1188. func (err ErrStopwatchNotExist) Error() string {
  1189. return fmt.Sprintf("stopwatch does not exist [id: %d]", err.ID)
  1190. }
  1191. // ___________ __ .______________.__
  1192. // \__ ___/___________ ____ | | __ ____ __| _/\__ ___/|__| _____ ____
  1193. // | | \_ __ \__ \ _/ ___\| |/ // __ \ / __ | | | | |/ \_/ __ \
  1194. // | | | | \// __ \\ \___| <\ ___// /_/ | | | | | Y Y \ ___/
  1195. // |____| |__| (____ /\___ >__|_ \\___ >____ | |____| |__|__|_| /\___ >
  1196. // \/ \/ \/ \/ \/ \/ \/
  1197. // ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.
  1198. type ErrTrackedTimeNotExist struct {
  1199. ID int64
  1200. }
  1201. // IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
  1202. func IsErrTrackedTimeNotExist(err error) bool {
  1203. _, ok := err.(ErrTrackedTimeNotExist)
  1204. return ok
  1205. }
  1206. func (err ErrTrackedTimeNotExist) Error() string {
  1207. return fmt.Sprintf("tracked time does not exist [id: %d]", err.ID)
  1208. }
  1209. // .____ ___. .__
  1210. // | | _____ \_ |__ ____ | |
  1211. // | | \__ \ | __ \_/ __ \| |
  1212. // | |___ / __ \| \_\ \ ___/| |__
  1213. // |_______ (____ /___ /\___ >____/
  1214. // \/ \/ \/ \/
  1215. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  1216. type ErrLabelNotExist struct {
  1217. LabelID int64
  1218. RepoID int64
  1219. }
  1220. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  1221. func IsErrLabelNotExist(err error) bool {
  1222. _, ok := err.(ErrLabelNotExist)
  1223. return ok
  1224. }
  1225. func (err ErrLabelNotExist) Error() string {
  1226. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  1227. }
  1228. // _____ .__.__ __
  1229. // / \ |__| | ____ _______/ |_ ____ ____ ____
  1230. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  1231. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  1232. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  1233. // \/ \/ \/ \/ \/
  1234. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  1235. type ErrMilestoneNotExist struct {
  1236. ID int64
  1237. RepoID int64
  1238. }
  1239. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  1240. func IsErrMilestoneNotExist(err error) bool {
  1241. _, ok := err.(ErrMilestoneNotExist)
  1242. return ok
  1243. }
  1244. func (err ErrMilestoneNotExist) Error() string {
  1245. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  1246. }
  1247. // _____ __ __ .__ __
  1248. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  1249. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  1250. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  1251. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  1252. // \/ \/ \/ \/ \/ \/ \/
  1253. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  1254. type ErrAttachmentNotExist struct {
  1255. ID int64
  1256. UUID string
  1257. }
  1258. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  1259. func IsErrAttachmentNotExist(err error) bool {
  1260. _, ok := err.(ErrAttachmentNotExist)
  1261. return ok
  1262. }
  1263. func (err ErrAttachmentNotExist) Error() string {
  1264. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  1265. }
  1266. // .____ .__ _________
  1267. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  1268. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  1269. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  1270. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  1271. // \/ /_____/ \/ \/ \/ \/
  1272. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  1273. type ErrLoginSourceNotExist struct {
  1274. ID int64
  1275. }
  1276. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  1277. func IsErrLoginSourceNotExist(err error) bool {
  1278. _, ok := err.(ErrLoginSourceNotExist)
  1279. return ok
  1280. }
  1281. func (err ErrLoginSourceNotExist) Error() string {
  1282. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  1283. }
  1284. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  1285. type ErrLoginSourceAlreadyExist struct {
  1286. Name string
  1287. }
  1288. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  1289. func IsErrLoginSourceAlreadyExist(err error) bool {
  1290. _, ok := err.(ErrLoginSourceAlreadyExist)
  1291. return ok
  1292. }
  1293. func (err ErrLoginSourceAlreadyExist) Error() string {
  1294. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  1295. }
  1296. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  1297. type ErrLoginSourceInUse struct {
  1298. ID int64
  1299. }
  1300. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  1301. func IsErrLoginSourceInUse(err error) bool {
  1302. _, ok := err.(ErrLoginSourceInUse)
  1303. return ok
  1304. }
  1305. func (err ErrLoginSourceInUse) Error() string {
  1306. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  1307. }
  1308. // ___________
  1309. // \__ ___/___ _____ _____
  1310. // | |_/ __ \\__ \ / \
  1311. // | |\ ___/ / __ \| Y Y \
  1312. // |____| \___ >____ /__|_| /
  1313. // \/ \/ \/
  1314. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  1315. type ErrTeamAlreadyExist struct {
  1316. OrgID int64
  1317. Name string
  1318. }
  1319. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  1320. func IsErrTeamAlreadyExist(err error) bool {
  1321. _, ok := err.(ErrTeamAlreadyExist)
  1322. return ok
  1323. }
  1324. func (err ErrTeamAlreadyExist) Error() string {
  1325. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  1326. }
  1327. // ErrTeamNotExist represents a "TeamNotExist" error
  1328. type ErrTeamNotExist struct {
  1329. OrgID int64
  1330. TeamID int64
  1331. Name string
  1332. }
  1333. // IsErrTeamNotExist checks if an error is a ErrTeamNotExist.
  1334. func IsErrTeamNotExist(err error) bool {
  1335. _, ok := err.(ErrTeamNotExist)
  1336. return ok
  1337. }
  1338. func (err ErrTeamNotExist) Error() string {
  1339. return fmt.Sprintf("team does not exist [org_id %d, team_id %d, name: %s]", err.OrgID, err.TeamID, err.Name)
  1340. }
  1341. //
  1342. // Two-factor authentication
  1343. //
  1344. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  1345. type ErrTwoFactorNotEnrolled struct {
  1346. UID int64
  1347. }
  1348. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  1349. func IsErrTwoFactorNotEnrolled(err error) bool {
  1350. _, ok := err.(ErrTwoFactorNotEnrolled)
  1351. return ok
  1352. }
  1353. func (err ErrTwoFactorNotEnrolled) Error() string {
  1354. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  1355. }
  1356. // ____ ___ .__ .___
  1357. // | | \______ | | _________ __| _/
  1358. // | | /\____ \| | / _ \__ \ / __ |
  1359. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  1360. // |______/ | __/|____/\____(____ /\____ |
  1361. // |__| \/ \/
  1362. //
  1363. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  1364. type ErrUploadNotExist struct {
  1365. ID int64
  1366. UUID string
  1367. }
  1368. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  1369. func IsErrUploadNotExist(err error) bool {
  1370. _, ok := err.(ErrAttachmentNotExist)
  1371. return ok
  1372. }
  1373. func (err ErrUploadNotExist) Error() string {
  1374. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  1375. }
  1376. // ___________ __ .__ .____ .__ ____ ___
  1377. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  1378. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  1379. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  1380. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  1381. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  1382. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  1383. type ErrExternalLoginUserAlreadyExist struct {
  1384. ExternalID string
  1385. UserID int64
  1386. LoginSourceID int64
  1387. }
  1388. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  1389. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  1390. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  1391. return ok
  1392. }
  1393. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  1394. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  1395. }
  1396. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  1397. type ErrExternalLoginUserNotExist struct {
  1398. UserID int64
  1399. LoginSourceID int64
  1400. }
  1401. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  1402. func IsErrExternalLoginUserNotExist(err error) bool {
  1403. _, ok := err.(ErrExternalLoginUserNotExist)
  1404. return ok
  1405. }
  1406. func (err ErrExternalLoginUserNotExist) Error() string {
  1407. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  1408. }
  1409. // ____ ________________________________ .__ __ __ .__
  1410. // | | \_____ \_ _____/\______ \ ____ ____ |__| _______/ |_____________ _/ |_|__| ____ ____
  1411. // | | // ____/| __) | _// __ \ / ___\| |/ ___/\ __\_ __ \__ \\ __\ |/ _ \ / \
  1412. // | | // \| \ | | \ ___// /_/ > |\___ \ | | | | \// __ \| | | ( <_> ) | \
  1413. // |______/ \_______ \___ / |____|_ /\___ >___ /|__/____ > |__| |__| (____ /__| |__|\____/|___| /
  1414. // \/ \/ \/ \/_____/ \/ \/ \/
  1415. // ErrU2FRegistrationNotExist represents a "ErrU2FRegistrationNotExist" kind of error.
  1416. type ErrU2FRegistrationNotExist struct {
  1417. ID int64
  1418. }
  1419. func (err ErrU2FRegistrationNotExist) Error() string {
  1420. return fmt.Sprintf("U2F registration does not exist [id: %d]", err.ID)
  1421. }
  1422. // IsErrU2FRegistrationNotExist checks if an error is a ErrU2FRegistrationNotExist.
  1423. func IsErrU2FRegistrationNotExist(err error) bool {
  1424. _, ok := err.(ErrU2FRegistrationNotExist)
  1425. return ok
  1426. }
  1427. // .___ ________ .___ .__
  1428. // | | ______ ________ __ ____ \______ \ ____ ______ ____ ____ __| _/____ ____ ____ |__| ____ ______
  1429. // | |/ ___// ___/ | \_/ __ \ | | \_/ __ \\____ \_/ __ \ / \ / __ |/ __ \ / \_/ ___\| |/ __ \ / ___/
  1430. // | |\___ \ \___ \| | /\ ___/ | ` \ ___/| |_> > ___/| | \/ /_/ \ ___/| | \ \___| \ ___/ \___ \
  1431. // |___/____ >____ >____/ \___ >_______ /\___ > __/ \___ >___| /\____ |\___ >___| /\___ >__|\___ >____ >
  1432. // \/ \/ \/ \/ \/|__| \/ \/ \/ \/ \/ \/ \/ \/
  1433. // ErrDependencyExists represents a "DependencyAlreadyExists" kind of error.
  1434. type ErrDependencyExists struct {
  1435. IssueID int64
  1436. DependencyID int64
  1437. }
  1438. // IsErrDependencyExists checks if an error is a ErrDependencyExists.
  1439. func IsErrDependencyExists(err error) bool {
  1440. _, ok := err.(ErrDependencyExists)
  1441. return ok
  1442. }
  1443. func (err ErrDependencyExists) Error() string {
  1444. return fmt.Sprintf("issue dependency does already exist [issue id: %d, dependency id: %d]", err.IssueID, err.DependencyID)
  1445. }
  1446. // ErrDependencyNotExists represents a "DependencyAlreadyExists" kind of error.
  1447. type ErrDependencyNotExists struct {
  1448. IssueID int64
  1449. DependencyID int64
  1450. }
  1451. // IsErrDependencyNotExists checks if an error is a ErrDependencyExists.
  1452. func IsErrDependencyNotExists(err error) bool {
  1453. _, ok := err.(ErrDependencyNotExists)
  1454. return ok
  1455. }
  1456. func (err ErrDependencyNotExists) Error() string {
  1457. return fmt.Sprintf("issue dependency does not exist [issue id: %d, dependency id: %d]", err.IssueID, err.DependencyID)
  1458. }
  1459. // ErrCircularDependency represents a "DependencyCircular" kind of error.
  1460. type ErrCircularDependency struct {
  1461. IssueID int64
  1462. DependencyID int64
  1463. }
  1464. // IsErrCircularDependency checks if an error is a ErrCircularDependency.
  1465. func IsErrCircularDependency(err error) bool {
  1466. _, ok := err.(ErrCircularDependency)
  1467. return ok
  1468. }
  1469. func (err ErrCircularDependency) Error() string {
  1470. return fmt.Sprintf("circular dependencies exists (two issues blocking each other) [issue id: %d, dependency id: %d]", err.IssueID, err.DependencyID)
  1471. }
  1472. // ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left.
  1473. type ErrDependenciesLeft struct {
  1474. IssueID int64
  1475. }
  1476. // IsErrDependenciesLeft checks if an error is a ErrDependenciesLeft.
  1477. func IsErrDependenciesLeft(err error) bool {
  1478. _, ok := err.(ErrDependenciesLeft)
  1479. return ok
  1480. }
  1481. func (err ErrDependenciesLeft) Error() string {
  1482. return fmt.Sprintf("issue has open dependencies [issue id: %d]", err.IssueID)
  1483. }
  1484. // ErrUnknownDependencyType represents an error where an unknown dependency type was passed
  1485. type ErrUnknownDependencyType struct {
  1486. Type DependencyType
  1487. }
  1488. // IsErrUnknownDependencyType checks if an error is ErrUnknownDependencyType
  1489. func IsErrUnknownDependencyType(err error) bool {
  1490. _, ok := err.(ErrUnknownDependencyType)
  1491. return ok
  1492. }
  1493. func (err ErrUnknownDependencyType) Error() string {
  1494. return fmt.Sprintf("unknown dependency type [type: %d]", err.Type)
  1495. }
  1496. // __________ .__
  1497. // \______ \ _______ _|__| ______ _ __
  1498. // | _// __ \ \/ / |/ __ \ \/ \/ /
  1499. // | | \ ___/\ /| \ ___/\ /
  1500. // |____|_ /\___ >\_/ |__|\___ >\/\_/
  1501. // \/ \/ \/
  1502. // ErrReviewNotExist represents a "ReviewNotExist" kind of error.
  1503. type ErrReviewNotExist struct {
  1504. ID int64
  1505. }
  1506. // IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
  1507. func IsErrReviewNotExist(err error) bool {
  1508. _, ok := err.(ErrReviewNotExist)
  1509. return ok
  1510. }
  1511. func (err ErrReviewNotExist) Error() string {
  1512. return fmt.Sprintf("review does not exist [id: %d]", err.ID)
  1513. }
  1514. // ________ _____ __ .__
  1515. // \_____ \ / _ \ __ ___/ |_| |__
  1516. // / | \ / /_\ \| | \ __\ | \
  1517. // / | \/ | \ | /| | | Y \
  1518. // \_______ /\____|__ /____/ |__| |___| /
  1519. // \/ \/ \/
  1520. // ErrOAuthClientIDInvalid will be thrown if client id cannot be found
  1521. type ErrOAuthClientIDInvalid struct {
  1522. ClientID string
  1523. }
  1524. // IsErrOauthClientIDInvalid checks if an error is a ErrReviewNotExist.
  1525. func IsErrOauthClientIDInvalid(err error) bool {
  1526. _, ok := err.(ErrOAuthClientIDInvalid)
  1527. return ok
  1528. }
  1529. // Error returns the error message
  1530. func (err ErrOAuthClientIDInvalid) Error() string {
  1531. return fmt.Sprintf("Client ID invalid [Client ID: %s]", err.ClientID)
  1532. }
  1533. // ErrOAuthApplicationNotFound will be thrown if id cannot be found
  1534. type ErrOAuthApplicationNotFound struct {
  1535. ID int64
  1536. }
  1537. // IsErrOAuthApplicationNotFound checks if an error is a ErrReviewNotExist.
  1538. func IsErrOAuthApplicationNotFound(err error) bool {
  1539. _, ok := err.(ErrOAuthApplicationNotFound)
  1540. return ok
  1541. }
  1542. // Error returns the error message
  1543. func (err ErrOAuthApplicationNotFound) Error() string {
  1544. return fmt.Sprintf("OAuth application not found [ID: %d]", err.ID)
  1545. }