* Add count to `GetUserRepositories` so that pagination can be supported for `/user/{username}/repos`
* Rework ListMyRepos to use models.SearchRepository
ListMyRepos was an odd one. It first fetched all user repositories and then tried to supplement them with accessible map. The end result was that:
* Limit for pagination did not work because accessible repos would always be appended
* The amount of pages was incorrect if one were to calculate it
* When paginating, all accessible repos would be shown on every page
Hopefully it should now work properly. Fixes#11800 and does not require any change on Drone-side as it can properly interpret and act on Link header which we now set.
Co-authored-by: Lauris BH <[email protected]>
(cherry picked from commit 0159851cc3)
Partial backport of #11853
Add doctor check to set IsArchived false if it is null.
(Migration change unfortunately not possible to be backported.)
Fix#11824
Signed-off-by: Andrew Thornton <[email protected]>
* Change language statistics to save size instead of percentage (#11681)
* Change language statistics to save size instead of percentage in database
Co-Authored-By: Cirno the Strongest <[email protected]>
* Do not exclude if only language
* Fix edge cases with special langauges
Co-authored-by: Cirno the Strongest <[email protected]>
* Fix language stat calculation (#11692)
* Fix language stat calculation
* Group languages and ignore 0 size files
* remove unneeded code
Co-authored-by: Cirno the Strongest <[email protected]>
GH has different HardBreaks behaviour for markdown comments and documents.
Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.
Here we split the setting in to two - one for documents and one for comments and other things.
Signed-off-by: Andrew Thornton [email protected]
Changes to index.js as per @silverwind
Co-authored-by: silverwind <[email protected]>
Changes to docs as per @guillep2k
Co-authored-by: guillep2k <[email protected]>
* Fix repo-list private and total count bugs
Signed-off-by: Andrew Thornton <[email protected]>
* Ensure limited and private org public repos are displayed on "private"
Signed-off-by: Andrew Thornton <[email protected]>
* switch from onlyPrivate to is_private
Signed-off-by: Andrew Thornton <[email protected]>
* Generate swagger
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: guillep2k <[email protected]>
* Allow all members of private orgs to see public repos
Fix#10144
Signed-off-by: Andrew Thornton <[email protected]>
* Update models/repo_list.go
Co-authored-by: Lauris BH <[email protected]>
* Refactor Cron and merge dashboard tasks
* Merge Cron and Dashboard tasks
* Make every cron task report a system notice on completion
* Refactor the creation of these tasks
* Ensure that execution counts of tasks is correct
* Allow cron tasks to be started from the cron page
* golangci-lint fixes
* Enforce that only one task with the same name can be registered
Signed-off-by: Andrew Thornton <[email protected]>
* fix name check
Signed-off-by: Andrew Thornton <[email protected]>
* as per @guillep2k
* as per @lafriks
Signed-off-by: Andrew Thornton <[email protected]>
* Add git.CommandContext variants
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
The migration introduced in #8742 breaks mysql installations. This pr fixes that by correctly using CONCAT.
Signed-off-by: kolaente <[email protected]>
* Properly generate ref URLs
Tags used to not generate correct URLs (src/branch/tags/1.0.0 instead of
src/tags/1.0.0).
Also cleans up some code around it with the created helper functions.
* Fix formatting and create migration
* Add copyright head to utils_test
* Use a raw query for the ref migration
* Remove semicolon
* Quote column and table names in migration SQL
* Change || to CONCAT, since MSSQL does not support ||
* Make migration engine aware
* Add missing import
* Move ref EndName and URL to the issue service
* Fix tests
* Add test for commit refs
* Update issue.go
* Use the right command for building JavaScript bundles
* Prepare for merge
* Check for refs/* before prepending in migration
* Update services/issue/issue_test.go
* Update modules/git/utils_test.go
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
* Correctly set the organization num repos
Correctly set the organization num repos to the number of
accessible repos for the user
Fix#11194
Signed-off-by: Andrew Thornton <[email protected]>
* as per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
* attempt to fix mssql
Signed-off-by: Andrew Thornton <[email protected]>
* Update models/user.go
* Explicit columns
Signed-off-by: Andrew Thornton <[email protected]>
* Add test and fix 0 counted orgs
Signed-off-by: Andrew Thornton <[email protected]>
* remove orgname from api
Signed-off-by: Andrew Thornton <[email protected]>
* Set background of openIDConnect logo to white in arc-green theme
* Fixed linting off arc-green theme
Signed-off-by: Leo Maroni <[email protected]>
* Revert changes of first commit (white background) and replaced the image
* Updated openid_connect (part 2)
* Update public/img/auth/openid_connect.svg
Now in one line
Co-authored-by: silverwind <[email protected]>
Co-authored-by: silverwind <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
prevent double entries in results of GetOrgsCanCreateRepoByUserID
I first try to only add GroupBy directly but xorm return broken user objects ...
... solution was to just query related UserIDs(OrgIDs) first and return OrgUsers based on this IDs
close#11258
Co-authored-by: zeripath <[email protected]>
* Fix creation of Org repos
Fix go-gitea#9269
* Change variable name to appease linter
* Update PR with suggestions
Add a note for user.CanCreateRepo() about failure assumptions
Change repo.create help message
Co-authored-by: guillep2k <[email protected]>
Instead of further handling requests to public which causes issues like #11088, immediately terminate requests to directories js, css, fomantic if no file is found which is checked against a hardcoded list. Maybe there is a way to retrieve the top-level entries below public in a dynamic fashion.
I also added fomantic to the reserved usernames and sorted the list.
Fixes: #11088
* Add a way to mark Conversation (code comment) resolved
mark Conversation is a way to mark a Conversation is stale
or be solved. when it's marked as stale, will be hided like
stale. all Pull Request writer , Offical Reviewers and poster
can add or remove Conversation resolved mark.
Signed-off-by: a1012112796 <[email protected]>
* fix lint
* Apply suggestions from code review
* Add ResolveDoer
* fix ui
Co-Authored-By: Lauris BH <[email protected]>
Co-Authored-By: 6543 <[email protected]>
* change IsResolved to an function
Add permission check in UpdateResolveConversation
* Apply suggestions from code review
* change return error for permisson check
* add default message for deleted user
* get issue message from comment
* add migration for ``ResolveDoerID`` column
another change:
* block mark pending review as resolved because it's not necessary
Co-authored-by: guillep2k <[email protected]>
* change button color
* resolve button size
* fix code style
* remove unusefull code
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: guillep2k <[email protected]>
* Fix InsertReleases Nil Insert on Attachments
* FIX "No element on slice when insert" & smal refactor
* again
* impruve
* rm useles newline
* Apply suggestions from code review
Co-Authored-By: zeripath <[email protected]>
* process insert as a whole
Co-authored-by: zeripath <[email protected]>
* Cache PullRequest Divergence
* only re-calc divergence if AddTestPullRequestTask() is exec
* migrate already open pulls
* finalize
* take care of closed¬-merged+deleted-branch pull requests
* fix nil pointer exeption
Signed-off-by: 6543 <[email protected]>
* try this
* no error its a warn
* init gitea-repositories-meta
* dont use gitDivergence type
* CI.restart()
* CI.restart()
* CI.restart()
* CI.restart()
* check IsUserAllowedToUpdate independend from CommitsBehind
* make sure duplicate token names cannot be used
* add check to api routes too
* add @lunny s suggestion
* fix & don't forget User.ID
* AccessTokenByNameExists() return error too
* unique token for each test
* fix lint
Signed-off-by: 6543 <[email protected]>
Co-authored-by: Lanre Adelowo <[email protected]>
* fix some bug about Request review
* fix ``CreateComment`` wrong using ,it will not work when use Sqlite
* fix wrong js click event code , it will send wrong data when it has
many choices
Signed-off-by: a1012112796 <[email protected]>
* Apply suggestions from code review
Co-Authored-By: Lauris BH <[email protected]>
* add getReviewerByIssueIDAndUserID
fix wrong conditions check in initIssueComments after #10972
* call CI again
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: guillep2k <[email protected]>