]>
source.dussan.org Git - gitea.git/log
GiteaBot [Tue, 31 May 2022 00:10:30 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
singuliere [Mon, 30 May 2022 22:47:55 +0000 (00:47 +0200)]
docs: update the ROOT documentation and error messages (#19832)
* docs: update the ROOT documentation and error messages
* The documentation now reflects what happens in the
setting/repository.go::newRepository function:
filepath.Join(AppWorkPath, RepoRootPath) was missing.
* The error message displayed when RepoRootPath is not found now
displays the value of RepoRootPath. Given the complexity of the
construction of this value, only referring to it in the abstract
is likely to be misleading to the Gitea admin trying to interpret
the message.
Co-authored-by: delvh <dev.lh@web.de>
GiteaBot [Mon, 30 May 2022 00:10:14 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
delvh [Sun, 29 May 2022 18:10:21 +0000 (20:10 +0200)]
Add version hint in the docs when packages are available (#19838)
* Add version hint in the docs when packages are available
* Change italic to bold
Yehonatan Ezron [Sun, 29 May 2022 17:59:25 +0000 (20:59 +0300)]
docs(hacking-on-gitea): fix installation instruction for elasticsearch docker (#19829)
wxiaoguang [Sun, 29 May 2022 08:19:56 +0000 (16:19 +0800)]
Fix i18n for Link Account button, re-format tmpl (#19835)
GiteaBot [Sun, 29 May 2022 00:10:54 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
Mai-Lapyst [Sun, 29 May 2022 00:03:17 +0000 (02:03 +0200)]
Adding button to link accounts from user settings (#19792)
* Adding button to link accounts from user settings
* Only display button to link user accounts when at least one OAuth2 provider is active
Yehonatan Ezron [Sat, 28 May 2022 20:44:51 +0000 (23:44 +0300)]
fix(telegram): fix link bot to release tag (#19830)
* fix(telegram): fix link bot to release tag
* test(webhook): fix matrixPayload Release
* test(webhook): fix TestTelegramPayload Release
Lauris BH [Sat, 28 May 2022 15:10:14 +0000 (18:10 +0300)]
Fix raw endpoint PDF file headers (#19825)
singuliere [Sat, 28 May 2022 08:47:13 +0000 (10:47 +0200)]
docs: FAQ: the WorkPath can be set from --work-path (#19822)
GiteaBot [Sat, 28 May 2022 00:10:25 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
Vladimir Yakovlev [Fri, 27 May 2022 19:40:00 +0000 (22:40 +0300)]
Fix duplicate paragraph in documentation (#19820)
Ondřej Čertík [Thu, 26 May 2022 09:19:24 +0000 (03:19 -0600)]
Make WIP prefixes case insensitive, e.g. allow `Draft` as a WIP prefix (#19780)
The issue was that only the actual title was converted to uppercase, but
not the prefix as specified in `WORK_IN_PROGRESS_PREFIXES`. As a result,
the following did not work:
WORK_IN_PROGRESS_PREFIXES=Draft:,[Draft],WIP:,[WIP]
One possible workaround was:
WORK_IN_PROGRESS_PREFIXES=DRAFT:,[DRAFT],WIP:,[WIP]
Then indeed one could use `Draft` (as well as `DRAFT`) in the title.
However, the link `Start the title with DRAFT: to prevent the pull request
from being merged accidentally.` showed the suggestion in uppercase; so
it is not possible to show it as `Draft`. This PR fixes it, and allows
to use `Draft` in `WORK_IN_PROGRESS_PREFIXES`.
Fixes #19779.
Co-authored-by: zeripath <art27@cantab.net>
silverwind [Wed, 25 May 2022 16:29:40 +0000 (18:29 +0200)]
Fix follower display on user page (#19805)
IT-AlexKor [Wed, 25 May 2022 13:33:35 +0000 (16:33 +0300)]
Show source/target branches on PR's list (#19747)
Add ability to show source/target branches for Pull Request's list. It can be useful to see which branches are used in each PR right in the list.
Co-authored-by: Alexey Korobkov <akorobkov@cian.ru>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
istiak101 [Wed, 25 May 2022 11:45:45 +0000 (17:45 +0600)]
Github style following followers (#19482)
Removed tabbed following and followers from user page and added Github style following followers.
techknowlogick [Wed, 25 May 2022 04:42:28 +0000 (00:42 -0400)]
alpine 3.16 (#19797)
Co-authored-by: 6543 <6543@obermui.de>
zeripath [Wed, 25 May 2022 00:51:53 +0000 (01:51 +0100)]
Prevent loop if there is an error in GetNotificationCount (#19799)
If the context is cancelled `.NotificationUnreadCount` in a template can
cause an infinite loop with `ctx.ServerError()` being called, which
creates a template that then calls `.NotificationUnreadCount` calling
`GetNotificationCount()` with the cancelled context resulting in an
error that calls `ctx.ServerError`... and so on...
This PR simply stops calling `ctx.ServerError` in the error handler code
for `.NotificationUnreadCount` as we have already started rendering and
so it is too late to call `ctx.ServerError`. Additionally we skip
logging the error if it's a context cancelled error.
Fix #19793
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
silverwind [Wed, 25 May 2022 00:19:13 +0000 (02:19 +0200)]
Add 'make tidy' (#19800)
Convenience command to run 'go mod tidy'. The compat flag is set to the
minimum supported go version instead of min version minus one which is
go's default, which eliminated some checksums in go.sum as a result.
wxiaoguang [Tue, 24 May 2022 06:57:15 +0000 (14:57 +0800)]
Update document to use FHS `/usr/local/bin/gitea` instead of `/app/...` for Docker (#19794)
* Update document to use FHS `/usr/local/bin/gitea` instead of `/app/...` in Docker
* Update docs/content/doc/installation/with-docker.zh-cn.md
GiteaBot [Tue, 24 May 2022 00:10:14 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
Jan-Eric Schober [Mon, 23 May 2022 15:54:48 +0000 (17:54 +0200)]
Add the possibility to allow the user to have a favicon which differs from the main logo (#18542)
* Changed the filename of the favicon SVG
This allows the user to have a favicon which differs from the logo.
* Added favicon.svg
This is needed to accommodate the changes for allowing the user to have a differing logo and favicon
* Adjusted page to accommodate what icon is used as favicon
* Added functionality to also generate the favicon.svg via generate-images.js
* Adjusted the description for the new favicon compatibility
Co-authored-by: silverwind <me@silverwind.io>
* Updated generate-images.js to generate favicons from a separate favicons.svg file
This belongs to PR #18542.
* Added description on how custom favicons can be generated
* Replaced space indents with tabs
* Synced changes with current state of the file
* Synced changes with current state of the file
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
GiteaBot [Mon, 23 May 2022 00:10:14 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 22 May 2022 00:10:22 +0000 (00:10 +0000)]
[skip ci] Updated licenses and gitignores
zeripath [Sat, 21 May 2022 18:50:50 +0000 (19:50 +0100)]
Estimate Action Count in Statistics (#19775)
zeripath [Sat, 21 May 2022 14:29:49 +0000 (15:29 +0100)]
Prevent NPE when cache service is disabled (#19703)
The cache service can be disabled - at which point ctx.Cache will be nil
and the use of it will cause an NPE.
The main part of this PR is that the cache is used for restricting
resending of activation mails and without this we cache we cannot
restrict this. Whilst this code could be re-considered to use the db and
probably should be, I think we can simply disable this code in the case
that the cache is disabled.
There are also several bug fixes in the /nodeinfo API endpoint.
Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath [Sat, 21 May 2022 13:06:24 +0000 (14:06 +0100)]
Detect truncated utf-8 characters at the end of content as still representing utf-8 (#19773)
Our character detection algorithm can potentially incorrectly detect utf-8 as iso-8859-x
if there is a truncated character at the end of the partially read file.
This PR changes the detection algorithm to truncated utf8 characters at the end of the
buffer.
Fix #19743
Signed-off-by: Andrew Thornton <art27@cantab.net>
silentcodeg [Sat, 21 May 2022 12:09:37 +0000 (14:09 +0200)]
Add silentcodeg to MAINTAINERS (#19771)
* Add silentcodeg to MAINTAINERS
* add missing trailing g to chat nick
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Eekle [Sat, 21 May 2022 09:15:40 +0000 (10:15 +0100)]
Allows repo search to match against "owner/repo" pattern strings (#19754)
* Allows repo search to match against "owner/repo" pattern strings
* Gofumpt
* Adds test case for "owner/repo" style repo search
* With "owner/repo" search terms, prioritise results which match the owner field
* Fixes unquoted SQL string in repo search
silverwind [Sat, 21 May 2022 01:10:03 +0000 (03:10 +0200)]
Update JS dependencies (#19767)
- Update all JS dependencies minus Vue
- Tested mermaid, swagger, build
Co-authored-by: 6543 <6543@obermui.de>
zeripath [Fri, 20 May 2022 16:57:49 +0000 (17:57 +0100)]
Nuke the incorrect permission report on /api/v1/notifications (#19761)
The permissions created in convertRepo use a minimal perm.AccessModeRead instead of
correctly computing the permission for the repository. This incorrect permission is
then reported to the user.
I do not believe that reporting the permissions is helpful and therefore I propose
we simply null these out. The user can check their permissions using a different
endpoint.
Fix #19759
Signed-off-by: Andrew Thornton <art27@cantab.net>
Lunny Xiao [Fri, 20 May 2022 14:08:52 +0000 (22:08 +0800)]
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context
* remove some unnecessary wrap functions
Lunny Xiao [Fri, 20 May 2022 10:20:51 +0000 (18:20 +0800)]
Move org functions (#19753)
* Move org functions
* Fix comment
silentcodeg [Fri, 20 May 2022 07:36:34 +0000 (09:36 +0200)]
[doctor] pq: syntax error at or near "." quote user table name (#19765)
silentcodeg [Fri, 20 May 2022 03:39:52 +0000 (05:39 +0200)]
[doctor] update the help with fix capabilities (#19762)
* [doctor] update the help with fix capabilities
silverwind [Fri, 20 May 2022 03:04:45 +0000 (05:04 +0200)]
Remove fomantic progress module (#19760)
Replace it with HTML `<progress>` element. The bar won't go green at
100% anymore but I think it's not something that fits stylistically anyways.
wxiaoguang [Fri, 20 May 2022 02:26:04 +0000 (10:26 +0800)]
Make Ctrl+Enter (quick submit) work for issue comment and wiki editor (#19729)
* Make Ctrl+Enter (quick submit) work for issue comment and wiki editor
* Remove the required `SubmitReviewForm.Type`, empty type (triggered by quick submit) means "comment"
* Merge duplicate code
delvh [Fri, 20 May 2022 00:48:42 +0000 (02:48 +0200)]
Enable packages by default again (as described by docs) (#19746)
silverwind [Thu, 19 May 2022 22:08:08 +0000 (00:08 +0200)]
Replace blue button and label classes with primary (#19763)
* make blue really blue
* replace blue button and label classes with primary
* add --color-blue-dark
* add light color variants, tweak a few colors
* fix colors
* add comment
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
KN4CK3R [Thu, 19 May 2022 15:56:45 +0000 (17:56 +0200)]
Fix org package owner permissions (#19742)
Old code did not respect owner visibility and the organization access calculation was wrong if the user was not a member.
Guo Y.K [Thu, 19 May 2022 15:20:34 +0000 (23:20 +0800)]
Update base.go (#19739)
use http.StatusTemporaryRedirect(307) when serve avatar directly
browser caches 301 redirections, pre-signed s3 url would expire at some later point
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
silentcodeg [Thu, 19 May 2022 13:46:56 +0000 (15:46 +0200)]
[doctor] do not update User Stars numbers unless --fix (#19750)
delvh [Thu, 19 May 2022 01:59:28 +0000 (03:59 +0200)]
Fix incorrect translation key (#19744)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Eekle [Wed, 18 May 2022 21:36:49 +0000 (22:36 +0100)]
Improved ref comment link when origin is body/title (#19741)
* Makes comments in body text/title return the base page URL instead of "" in RefCommentHTMLURL()
* Add comment explaining branch
Co-authored-by: delvh <dev.lh@web.de>
silentcodeg [Wed, 18 May 2022 15:04:12 +0000 (17:04 +0200)]
[doctor] explain what enable-push-options does (#19740)
silentcodeg [Wed, 18 May 2022 00:34:32 +0000 (02:34 +0200)]
Add doctor orphan check for orphaned pull requests without an existing base repo (#19731)
KN4CK3R [Tue, 17 May 2022 11:58:42 +0000 (13:58 +0200)]
ContainerRegistry - removed Basic Auth header (#19735)
* Removed Basic Auth header.
* Fixed test.
GiteaBot [Tue, 17 May 2022 00:10:28 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
6543 [Mon, 16 May 2022 21:01:13 +0000 (23:01 +0200)]
Add changelog for v1.16.8 (#19724) (#19730)
* Add changelog for v1.16.8 (#19724)
* Add changelog for v1.16.8
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* bump
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Gusted [Mon, 16 May 2022 16:45:12 +0000 (16:45 +0000)]
Improve commit list/view on mobile (#19712)
- This is a continuation on [the work](https://github.com/go-gitea/gitea/pull/19546) I've done for improving mobile experience on Gitea.
- The current behavior of going trough the commits list is horrible, each individual item gets it's own row and thereby isn't quite compact as it should be on mobile. The commit view's header is in a bit better state, it's quite only that content is overlapping each other.
- This patch fixes those problems. Each row in the commit list table will actually take a row in the UI. The commit view's header has now a better organized way of placing the information.
Gusted [Mon, 16 May 2022 09:49:17 +0000 (09:49 +0000)]
Fix issue overview for teams (#19652)
- Don't use hacky solution to limit to the correct RepoID's, instead use
current code to handle these limits. The existing code is more correct
than the hacky solution.
- Resolves #19636
- Add test-case
zeripath [Mon, 16 May 2022 07:36:57 +0000 (08:36 +0100)]
Fix nodeinfo caching and prevent NPE if cache non-existent (#19721)
Extract from #19703
Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 [Sun, 15 May 2022 18:43:27 +0000 (20:43 +0200)]
Update go-chi/cache to utilize Ping() (#19719)
* update gitea.com/go-chi/cache -> v0.2.0
* ajust to new interface
* refactor
John Olheiser [Sun, 15 May 2022 17:45:11 +0000 (12:45 -0500)]
Disable blank issues (#19717)
f0x52 [Sun, 15 May 2022 16:40:29 +0000 (18:40 +0200)]
clarify what session provider 'db' does (#19713)
* clarify what session provider 'db' does
* Also update session.PROVIDER in app.example.ini
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
GiteaBot [Sun, 15 May 2022 00:10:15 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
zuzuviewer [Sat, 14 May 2022 13:30:19 +0000 (21:30 +0800)]
Fix duplicate entry error when add team member (#19702)
6543 [Fri, 13 May 2022 17:27:58 +0000 (19:27 +0200)]
[Refactor] convert team(s) to apiTeam(s) (#13745)
* Refactor: teams to api convert
* make org load optional
* more info in tests
Gusted [Fri, 13 May 2022 12:49:22 +0000 (14:49 +0200)]
Use a better OlderThan for DeleteInactiveUsers (#19693)
* Use a better OlderThan for DeleteInactiveUsers
- Currently the OlderThan is zero, for instances that enable or run this
task this could actually delete just new users that still need to
confirm their email. This patch fixes that by setting the default to the
`ActiveCodeLives` setting, which corresponds to the amount of time that
a user can active their account, thus avoiding the issue of deleting
unactivated email users.
* Use correct duration
GiteaBot [Fri, 13 May 2022 00:10:14 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
silverwind [Thu, 12 May 2022 15:51:50 +0000 (17:51 +0200)]
Introduce eslint-plugin-jquery (#19690)
Introduce the plugin that allows us to gradually forbid jQuery code.
I've enabled all rules that already pass.
Next step will be to go through each rule and fix the issues by using
native DOM equivalents, which I think can be done in separate PRs, but
if prefered I could also start here.
wxiaoguang [Thu, 12 May 2022 13:39:02 +0000 (21:39 +0800)]
Use Vue to refactor pull merge UI (#19650)
* Use Vue to refactor pull merge UI
* add comments
* fix comments
* small fine tune
* fix tests
* adopt new pull default messages
* clean up
Co-authored-by: 6543 <6543@obermui.de>
GiteaBot [Thu, 12 May 2022 00:10:15 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
Lunny Xiao [Wed, 11 May 2022 13:06:02 +0000 (21:06 +0800)]
Fix oauth setting list bug (#19682)
6543 [Wed, 11 May 2022 11:16:35 +0000 (13:16 +0200)]
Delete user related oauth stuff on user deletion too (#19677)
* delete user related oauth stuff on user deletion too
* extend doctor check-db-consistency
Lunny Xiao [Wed, 11 May 2022 10:09:36 +0000 (18:09 +0800)]
Move access and repo permission to models/perm/access (#19350)
* Move access and repo permission to models/perm/access
* Remove unnecessary code
silverwind [Wed, 11 May 2022 01:05:50 +0000 (03:05 +0200)]
Tidy up `<head>` template (#19678)
Neiter `<meta>` nor `<link>` require a closing slash at the end in HTML,
remove it.
silverwind [Tue, 10 May 2022 21:55:54 +0000 (23:55 +0200)]
Update go tool dependencies (#19676)
* Update go tool dependencies
Updated all tool dependencies to latest tags, hoping CI will like it.
* fix new lint errors
* handle more strings.Title cases
* remove lint skip
silverwind [Tue, 10 May 2022 19:44:36 +0000 (21:44 +0200)]
Update JS dependencies (#19675)
* Update JS dependencies
- Update all JS dependencies minus vue and vue-loader
- Adapt to jest 28
- Add new eslint rules
- Tested Mermaid and Swagger-UI
* switch to @happy-dom/jest-environment for faster tests
* bump eslint env to es2022
Gusted [Tue, 10 May 2022 14:18:20 +0000 (16:18 +0200)]
Use better message for consistency check (#19672)
- Don't log the reflect struct, but instead log the ID of the struct.
This improves the error message, as you would actually know which row is
the error.
Lunny Xiao [Tue, 10 May 2022 12:41:37 +0000 (20:41 +0800)]
Fix new release from tags list UI (#19670)
6543 [Tue, 10 May 2022 10:32:42 +0000 (12:32 +0200)]
Update go deps (#19665)
* update gitea.com/go-chi/binding
* update github.com/42wim/sshsig
* update github.com/PuerkitoBio/goquery
* update github.com/blevesearch/bleve/v2
* update github.com/caddyserver/certmagic
* update github.com/duo-labs/webauthn
* update github.com/editorconfig/editorconfig-core-go/v2
* update github.com/emirpasic/gods
* update github.com/gliderlabs/ssh
* update github.com/go-chi/cors
* update github.com/go-enry/go-enry/v2
* update github.com/go-git/go-git/v5
* update github.com/go-ldap/ldap/v3
* update github.com/golang-jwt/jwt/v4
* update github.com/google/pprof
* update github.com/klauspost/compress
* update github.com/lib/pq
* update github.com/markbates/goth
* update github.com/minio/minio-go/v7
* update github.com/olivere/elastic/v7
* update github.com/unrolled/render
* update github.com/urfave/cli
* update github.com/xanzy/go-gitlab
* update github.com/yuin/goldmark
* adopt breaking changes of certmagic
singuliere [Tue, 10 May 2022 00:49:01 +0000 (01:49 +0100)]
[doctor] Add check/fix for bogus action rows (#19656)
Signed-off-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Loïc Dachary <loic@dachary.org>
GiteaBot [Tue, 10 May 2022 00:10:16 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
Jack Hay [Mon, 9 May 2022 19:04:27 +0000 (15:04 -0400)]
Add tooltip to pending PR comments (#19662)
KN4CK3R [Mon, 9 May 2022 18:20:21 +0000 (20:20 +0200)]
Add Webfinger endpoint (#19462)
This adds the [Webfinger](https://webfinger.net/) endpoint for federation.
Supported schemes are `acct` and `mailto`. The profile and avatar url are returned as metadata.
Jimmy Praet [Mon, 9 May 2022 16:33:19 +0000 (18:33 +0200)]
Update documentation to disable duration settings with -1 instead of 0 (#19647)
To turn off the notification endpoint polling, the value should be set to -1, not 0.
zeripath [Mon, 9 May 2022 15:54:51 +0000 (16:54 +0100)]
Set the LastModified header for raw files (#18356)
Although the use of LastModified dates for caching of git objects should be
discouraged (as it is not native to git - and there are a LOT of ways this
could be incorrect) - LastModified dates can be a helpful somewhat more human
way of caching for simple cases.
This PR adds this header and handles the If-Modified-Since header to the /raw/
routes.
Fix #18354
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Lunny Xiao [Mon, 9 May 2022 15:19:16 +0000 (23:19 +0800)]
Don't select join table's columns (#19660)
* Don't select join table
* Add comment
GiteaBot [Mon, 9 May 2022 00:10:13 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
KN4CK3R [Sun, 8 May 2022 22:29:50 +0000 (00:29 +0200)]
Calculate filename hash only once (#19654)
* Calculate hash only once.
* remove unused Sha1 template helper function, use ctx.Data["FileNameHash"]
* fix unit tests
Lunny Xiao [Sun, 8 May 2022 20:22:55 +0000 (04:22 +0800)]
Admin should not delete himself (#19423)
Admin should not be able to delete themselves.
Also partially fix #15449
Lunny Xiao [Sun, 8 May 2022 19:13:27 +0000 (03:13 +0800)]
Restore reviewed-on message (#19657)
Regression from #18177
Lunny Xiao [Sun, 8 May 2022 16:46:32 +0000 (00:46 +0800)]
Move some helper files out of models (#19355)
* Move some helper files out of models
* Some improvements
Co-authored-by: delvh <dev.lh@web.de>
Lunny Xiao [Sun, 8 May 2022 15:51:50 +0000 (23:51 +0800)]
Repository level enable package or disable (#19323)
6543 [Sun, 8 May 2022 13:46:34 +0000 (15:46 +0200)]
Delete related PullAutoMerge and ReviewState on User/Repo Deletion (#19649)
* delete pullautomerges on repo/user deletion
* delete reviewstates on repo/user deletion
* optimize automerhe code
* add index to reviewstate
Lunny Xiao [Sun, 8 May 2022 12:32:45 +0000 (20:32 +0800)]
Allow custom default merge message with .gitea/default_merge_message/<merge_style>_TEMPLATE.md (#18177)
* Allow custom default merge message with .gitea/MERGE_MESSAGE_<merge_style>_TEMPLATE.md
* Some improvements
* Follow some advices
* Fix bug
* Fix bug
* Fix lint
* Fix close comment
* Fix test
* Fix and docs
* Improve codes
* Update docs and remove unnecessary variables
* return error for GetDefaultMergeMessage
* Fix test
* improve code
* ignore unknow unit type
* return error for GetDefaultMergeMessage
* Update services/pull/merge.go
* Some improvements
* Follow some advices
* Fix bug
* Fix lint
* Improve codes
* Update docs and remove unnecessary variables
* return error for GetDefaultMergeMessage
* improve code
* Handle deleted HeadRepo in GetDefaultMergeMessage
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix test
* Fix test
Co-authored-by: zeripath <art27@cantab.net>
delvh [Sat, 7 May 2022 18:28:10 +0000 (20:28 +0200)]
Allow to mark files in a PR as viewed (#19007)
Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
kolaente [Sat, 7 May 2022 17:05:52 +0000 (19:05 +0200)]
Auto merge pull requests when all checks succeeded via API (#9307)
* Fix indention
Signed-off-by: kolaente <k@knt.li>
* Add option to merge a pr right now without waiting for the checks to succeed
Signed-off-by: kolaente <k@knt.li>
* Fix lint
Signed-off-by: kolaente <k@knt.li>
* Add scheduled pr merge to tables used for testing
Signed-off-by: kolaente <k@knt.li>
* Add status param to make GetPullRequestByHeadBranch reusable
Signed-off-by: kolaente <k@knt.li>
* Move "Merge now" to a seperate button to make the ui clearer
Signed-off-by: kolaente <k@knt.li>
* Update models/scheduled_pull_request_merge.go
Co-authored-by: 赵智超 <1012112796@qq.com>
* Update web_src/js/index.js
Co-authored-by: 赵智超 <1012112796@qq.com>
* Update web_src/js/index.js
Co-authored-by: 赵智超 <1012112796@qq.com>
* Re-add migration after merge
* Fix frontend lint
* Fix version compare
* Add vendored dependencies
* Add basic tets
* Make sure the api route is capable of scheduling PRs for merging
* Fix comparing version
* make vendor
* adopt refactor
* apply suggestion: User -> Doer
* init var once
* Fix Test
* Update templates/repo/issue/view_content/comments.tmpl
* adopt
* nits
* next
* code format
* lint
* use same name schema; rm CreateUnScheduledPRToAutoMergeComment
* API: can not create schedule twice
* Add TestGetBranchNamesForSha
* nits
* new go routine for each pull to merge
* Update models/pull.go
Co-authored-by: a1012112796 <1012112796@qq.com>
* Update models/scheduled_pull_request_merge.go
Co-authored-by: a1012112796 <1012112796@qq.com>
* fix & add renaming sugestions
* Update services/automerge/pull_auto_merge.go
Co-authored-by: a1012112796 <1012112796@qq.com>
* fix conflict relicts
* apply latest refactors
* fix: migration after merge
* Update models/error.go
Co-authored-by: delvh <dev.lh@web.de>
* Update options/locale/locale_en-US.ini
Co-authored-by: delvh <dev.lh@web.de>
* Update options/locale/locale_en-US.ini
Co-authored-by: delvh <dev.lh@web.de>
* adapt latest refactors
* fix test
* use more context
* skip potential edgecases
* document func usage
* GetBranchNamesForSha() -> GetRefsBySha()
* start refactoring
* ajust to new changes
* nit
* docu nit
* the great check move
* move checks for branchprotection into own package
* resolve todo now ...
* move & rename
* unexport if posible
* fix
* check if merge is allowed before merge on scheduled pull
* debugg
* wording
* improve SetDefaults & nits
* NotAllowedToMerge -> DisallowedToMerge
* fix test
* merge files
* use package "errors"
* merge files
* add string names
* other implementation for gogit
* adapt refactor
* more context for models/pull.go
* GetUserRepoPermission use context
* more ctx
* use context for loading pull head/base-repo
* more ctx
* more ctx
* models.LoadIssueCtx()
* models.LoadIssueCtx()
* Handle pull_service.Merge in one DB transaction
* add TODOs
* next
* next
* next
* more ctx
* more ctx
* Start refactoring structure of old pull code ...
* move code into new packages
* shorter names ... and finish **restructure**
* Update models/branches.go
Co-authored-by: zeripath <art27@cantab.net>
* finish UpdateProtectBranch
* more and fix
* update datum
* template: use "svg" helper
* rename prQueue 2 prPatchCheckerQueue
* handle automerge in queue
* lock pull on git&db actions ...
* lock pull on git&db actions ...
* add TODO notes
* the regex
* transaction in tests
* GetRepositoryByIDCtx
* shorter table name and lint fix
* close transaction bevore notify
* Update models/pull.go
* next
* CheckPullMergable check all branch protections!
* Update routers/web/repo/pull.go
* CheckPullMergable check all branch protections!
* Revert "PullService lock via pullID (#19520)" (for now...)
This reverts commit
6cde7c9159a5ea75a10356feb7b8c7ad4c434a9a .
* Update services/pull/check.go
* Use for a repo action one database transaction
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
* Update services/issue/status.go
Co-authored-by: delvh <dev.lh@web.de>
* Update services/issue/status.go
Co-authored-by: delvh <dev.lh@web.de>
* use db.WithTx()
* gofmt
* make pr.GetDefaultMergeMessage() context aware
* make MergePullRequestForm.SetDefaults context aware
* use db.WithTx()
* pull.SetMerged only with context
* fix deadlock in `test-sqlite\#TestAPIBranchProtection`
* dont forget templates
* db.WithTx allow to set the parentCtx
* handle db transaction in service packages but not router
* issue_service.ChangeStatus just had caused another deadlock :/
it has to do something with how notification package is handled
* if we merge a pull in one database transaktion, we get a lock, because merge infoce internal api that cant handle open db sessions to the same repo
* ajust to current master
* Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
* dont open db transaction in router
* make generate-swagger
* one _success less
* wording nit
* rm
* adapt
* remove not needed test files
* rm less diff & use attr in JS
* ...
* Update services/repository/files/commit.go
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* ajust db schema for PullAutoMerge
* skip broken pull refs
* more context in error messages
* remove webUI part for another pull
* remove more WebUI only parts
* API: add CancleAutoMergePR
* Apply suggestions from code review
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix lint
* Apply suggestions from code review
* cancle -> cancel
Co-authored-by: delvh <dev.lh@web.de>
* change queue identifyer
* fix swagger
* prevent nil issue
* fix and dont drop error
* as per @zeripath
* Update integrations/git_test.go
Co-authored-by: delvh <dev.lh@web.de>
* Update integrations/git_test.go
Co-authored-by: delvh <dev.lh@web.de>
* more declarative integration tests (dedup code)
* use assert.False/True helper
Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
KN4CK3R [Sat, 7 May 2022 16:21:15 +0000 (18:21 +0200)]
Hide private repositories in packages (#19584)
Jimmy Praet [Sat, 7 May 2022 15:49:43 +0000 (17:49 +0200)]
Only show accessible teams in dashboard dropdown list (#19642)
Fixes #19637
a1012112796 [Sat, 7 May 2022 12:24:02 +0000 (20:24 +0800)]
prevent double click new issue/pull/comment button (#16157)
* prevent double click new issue/pull/comment button
when network is not good, these button maybe
double clicked, then more than one same issues
pulls or comments will be created. this pull
request will fix this bug.
Signed-off-by: a1012112796 <1012112796@qq.com>
Gusted [Sat, 7 May 2022 05:35:12 +0000 (05:35 +0000)]
Improve reviewing PR UX (#19612)
GiteaBot [Sat, 7 May 2022 00:10:19 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin
6543 [Fri, 6 May 2022 23:39:14 +0000 (01:39 +0200)]
Add Changelog v1.16.7 (#19575) (#19644)
* Add Changelog v1.16.7 (#19575)
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
* jup
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
techknowlogick [Fri, 6 May 2022 17:25:18 +0000 (13:25 -0400)]
Set safe dir for git operations in .drone.yml CI (#19641)
Our drone by necessity runs on git repositories not owned by the drone process. Unfortunately this means that git operations and thence CI builds will fail without the `safe.directory` option being set.
See: https://drone.gitea.io/go-gitea/gitea/54632/2/8
wxiaoguang [Fri, 6 May 2022 14:25:59 +0000 (22:25 +0800)]
Add missing `sorting` column in `project_issue` table (#19635)
Gusted [Fri, 6 May 2022 09:12:30 +0000 (09:12 +0000)]
Simplify `IsVendor` (#19626)
The changes in this file were upstreamed directly into go-enry as https://github.com/go-enry/go-enry/pull/44
and therefore they are no longer needed.
zeripath [Fri, 6 May 2022 03:54:22 +0000 (05:54 +0200)]
Prevent NPE when checking repo units if the user is nil (#19625)
CheckRepoUnitUser should tolerate nil users.
Fix #19613
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>