Commit graph

16118 commits

Author SHA1 Message Date
Loïc Dachary b9e7a54988
[CI] tests/pgsql.ini.tmpl: do not use minio
f92e0a4018 added minio to the tests/pgsql.ini.tmpl and Forgejo CI does
not run a minio server. It will if there are external storage related
changes at some point but it is not the case now so it is not worth
the burden.

(cherry picked from commit 4cfbf4718d)
(cherry picked from commit 9bd644d601)
(cherry picked from commit 604636c7c4)
(cherry picked from commit 341cdb8540)
(cherry picked from commit 57bdc91de5)
(cherry picked from commit c6ec6517b4)
(cherry picked from commit 2f03fc1b29)
(cherry picked from commit aaecd10966)
(cherry picked from commit 7025ff7b06)
(cherry picked from commit 15e6485ae1)
(cherry picked from commit 5f7b23c659)
(cherry picked from commit a74d7ce6c5)
(cherry picked from commit f552e2fc56)
(cherry picked from commit 9fa4a90baa)
(cherry picked from commit a8be33da60)
(cherry picked from commit 205f7897aa)
(cherry picked from commit a6074d765d)
(cherry picked from commit b85c999109)
(cherry picked from commit e370e412e8)
2023-08-01 08:26:38 +02:00
Loïc Dachary a5ce64a4cf
[CI] set PASSWORD_HASH_ALGO = argon2 for integration tests
(cherry picked from commit 1d7ce2a39c)
(cherry picked from commit 3af8757583)
(cherry picked from commit 0b81815209)
(cherry picked from commit 7180a3222a)
(cherry picked from commit 069044f4a6)
(cherry picked from commit dd1438f389)
(cherry picked from commit 4ae6b5d64d)
(cherry picked from commit c572666d78)
(cherry picked from commit de0a4480bc)
(cherry picked from commit 60272ef4f7)
(cherry picked from commit a68fdde4be)
(cherry picked from commit ff448cf3a6)
(cherry picked from commit 208498caaa)
(cherry picked from commit 1abd3efad8)
(cherry picked from commit 818c7f4ca9)
(cherry picked from commit 1e552bbe44)
(cherry picked from commit 88dbd6da1d)
(cherry picked from commit b1c86fb777)
(cherry picked from commit 185b1e25b1)
(cherry picked from commit 0af35605ae)
(cherry picked from commit 350975b63f)
(cherry picked from commit 2788142515)
2023-08-01 08:26:38 +02:00
Loïc Dachary b4ed09daae
[CI] implementation: forgejo container images
(cherry picked from commit dd1971d4e6)
(cherry picked from commit 3981dbaf8c)
(cherry picked from commit 8dff3cc2d1)
(cherry picked from commit e7673e5d22)
(cherry picked from commit 326174064b)
(cherry picked from commit eb769dbde4)
(cherry picked from commit 335829ade2)
(cherry picked from commit 5e8e4f549d)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit b777fc91d0)
(cherry picked from commit 02cda642ec)
(cherry picked from commit 96ef93f3bc)
(cherry picked from commit aa424551f2)

Conflicts:
	Dockerfile
	Dockerfile.rootless
(cherry picked from commit e54fa86e49)
(cherry picked from commit 043fa6d664)
(cherry picked from commit 805b162480)
(cherry picked from commit 86bf362a3c)
(cherry picked from commit 13e0007959)
(cherry picked from commit 00ff6f7cb3)
(cherry picked from commit 95c7d8e883)
(cherry picked from commit fb033d2bb6)
(cherry picked from commit 1147910a55)
(cherry picked from commit 6590b6e99c)
(cherry picked from commit 78938113e4)
2023-08-01 08:26:38 +02:00
Loïc Dachary fda7f31fd7
[CI] Woodpecker based releases process
(cherry picked from commit c2a7aaeee8)
(cherry picked from commit 6b6007fbce)
(cherry picked from commit 63608a221e)
(cherry picked from commit 5cfe60baa7)
(cherry picked from commit 2af4c73d12)
(cherry picked from commit 1985959bfe)
(cherry picked from commit 880424c77e)
(cherry picked from commit c78a861d1b)
(cherry picked from commit 25c1227011)
(cherry picked from commit 7195e894ee)
(cherry picked from commit cf15153873)
(cherry picked from commit 9bee773c95)
(cherry picked from commit 581c3060da)
(cherry picked from commit bf550f9b2c)
(cherry picked from commit b570eca0b9)

[CI] implementation: Woodpecker based CI (squash)

Upgrade xgo to Go v1.20 for building binaries

(cherry picked from commit 6308c776b6)

[CI] v1.20: switch PR check from Woodpecker CI to Forgejo Actions

The PR checks for v1.19 still rely on Woodpecker CI. Keeping
.woodpecker in v1.20 while both Woodpecker CI & Forgejo Actions are
enabled would dupicate the checks.

The release process in releases remains Woodpecker CI.

(cherry picked from commit 93e42f3f53)
(cherry picked from commit 599c5162ad)
(cherry picked from commit 6f8b723a55)
(cherry picked from commit e238d7d72f)
(cherry picked from commit 2258fb575b)
(cherry picked from commit 52195d9456)
(cherry picked from commit 633a61809e)
(cherry picked from commit 9ff1e2561d)
2023-08-01 08:26:38 +02:00
Loïc Dachary 4839f1d293
[CI] implementation: publish forgejo- binaries instead of gitea-
(cherry picked from commit 6d910daafb)
(cherry picked from commit d447861cc9)
(cherry picked from commit dc6e9d8799)
(cherry picked from commit ef232fa20c)
(cherry picked from commit 290c55517a)
(cherry picked from commit db48af1784)
(cherry picked from commit 85f33237a2)
(cherry picked from commit 76899ee33e)
(cherry picked from commit 148b3ee9cb)
(cherry picked from commit 1f6ad8f465)
(cherry picked from commit c330afdba3)
(cherry picked from commit b1f87075a7)
(cherry picked from commit 7da40992cc)
(cherry picked from commit 7ab19ff5e5)
(cherry picked from commit e61e44921b)
(cherry picked from commit 83646119fb)
(cherry picked from commit 20cf748e61)
(cherry picked from commit 0a99919cec)
(cherry picked from commit 21215222a6)
(cherry picked from commit 0f6c5658d7)
(cherry picked from commit 1752e43d3c)
(cherry picked from commit 2332080929)
(cherry picked from commit 590aabf2a2)
2023-08-01 08:26:38 +02:00
Earl Warren 302c4e30ac
[CLI] implement forgejo-cli actions
(cherry picked from commit 08be2b226e)
(cherry picked from commit b6cfa88c6e)
(cherry picked from commit 59704200de)

[CLI] implement forgejo-cli actions generate-secret

(cherry picked from commit 6f7905c8ec)
(cherry picked from commit e085d6d273)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb2)

[CLI] implement forgejo-cli actions register

(cherry picked from commit 2f95143000)
(cherry picked from commit 42f2f8731e)

[CLI] implement forgejo-cli actions register (squash) no private

Do not go through the private API, directly modify the database

(cherry picked from commit 1ba7c0d39d)

[CLI] implement forgejo-cli actions

(cherry picked from commit 6f7905c8ec)
(cherry picked from commit e085d6d273)

[CLI] implement forgejo-cli actions generate-secret (squash) NoInit

(cherry picked from commit 962c944eb2)
(cherry picked from commit 4c121ef022)

Conflicts:
	cmd/forgejo/actions.go
	tests/integration/cmd_forgejo_actions_test.go
(cherry picked from commit 36997a48e3)

[CLI] implement forgejo-cli actions (squash) restore --version

Refs: https://codeberg.org/forgejo/forgejo/issues/1134
(cherry picked from commit 9739eb52d8)
2023-08-01 08:26:36 +02:00
Earl Warren af9e7d8e9e
[CLI] implement forgejo-cli
(cherry picked from commit 2555e315f7)
(cherry picked from commit 51b9c9092e)

[CLI] implement forgejo-cli (squash) support initDB

(cherry picked from commit 5c31ae602a)
(cherry picked from commit bbf76489a7)

Conflicts:
	because of d0dbe52e76
	upgrade to https://pkg.go.dev/github.com/urfave/cli/v2
(cherry picked from commit b6c1bcc008)
2023-08-01 08:24:56 +02:00
Earl Warren 5dc9aacfce
[CI] DEFAULT_ACTIONS_URL = https://codeberg.org
(cherry picked from commit 52b364ddbd)
(cherry picked from commit 99887cd567)
(cherry picked from commit cd5788782a)
(cherry picked from commit 71c698a704)
(cherry picked from commit 71386241dd)
(cherry picked from commit b7ab05aeac)
(cherry picked from commit e78b9ca59c)
(cherry picked from commit edb3adf460)
(cherry picked from commit 3e40088197)

[BRANDING] DEFAULT_ACTIONS_URL = https://code.forgejo.org

(cherry picked from commit d0e4512c90)
(cherry picked from commit 8ba6e04709)
(cherry picked from commit 6349081044)
(cherry picked from commit e06bd44495)
(cherry picked from commit d58219d8e1)
(cherry picked from commit 052f2c2aa4)
(cherry picked from commit 29dc395386)
(cherry picked from commit 9eef3f59f3)
(cherry picked from commit d650391fed)
(cherry picked from commit c2e6e8c55d)
(cherry picked from commit e28a47741d)

[CI] DEFAULT_ACTIONS_URL support for self & github (squash)

Refs: https://codeberg.org/forgejo/forgejo/issues/1062
(cherry picked from commit 74cc25376e)
(cherry picked from commit 405430708f)
2023-08-01 08:24:56 +02:00
Earl Warren 08848605f0
[CI] Revert "Restrict [actions].DEFAULT_ACTIONS_URL to only github or self (#25581)"
This reverts commit 67bd9d4f1e.

(cherry picked from commit 0547e94023)
(cherry picked from commit d21ad654ad)
(cherry picked from commit b905e9d838)
2023-08-01 08:24:56 +02:00
Loïc Dachary e0ede14564
[TESTS] MockVariable temporarily replaces a global value
defer test.MockVariable(&variable, 1234)()

(cherry picked from commit 9c78752444)
(cherry picked from commit d7795d7b25)
(cherry picked from commit d0ffbd112c)
(cherry picked from commit f3e62a57bf)
2023-08-01 08:24:56 +02:00
Denys Konovalov b9baed2c74
Introduce flex-list & flex-item elements for Gitea UI (#25790)
This PR introduces a new UI element type for Gitea called `flex-item`.
It consists of a horizontal card with a leading, main and trailing part:


![grafik](https://github.com/go-gitea/gitea/assets/47871822/395dd3f3-3906-4481-8f65-be6ac0acbe03)

The idea behind it is that in Gitea UI, we have many cases where we use
this kind of layout, but it is achieved in many different ways:
  - grid layout
  - `.ui.list` with additional hacky flexbox
- `.ui.key.list` - looks to me like a style set originally created for
ssh/gpg key list, was used in many other places
  - `.issue.list` - created for issue cards, used in many other places
  - ...

This new style is based on `.issue.list`, specifically the refactoring
of it done in #25750.

In this PR, the new element is introduced and lots of templates are
being refactored to use that style. This allows to remove a lot of
page-specific css, makes many of the elements responsive or simply
provides a cleaner/better-looking way to present information.

A devtest section with the new style is also available.

<details>
<summary>Screenshots (left: before, right: after)</summary>

![Bildschirmfoto vom 2023-07-09
21-01-21](https://github.com/go-gitea/gitea/assets/47871822/545b7da5-b300-475f-bd6d-b7d836950bb5)
![Bildschirmfoto vom 2023-07-09
21-01-56](https://github.com/go-gitea/gitea/assets/47871822/b6f70415-6795-4f71-a5ea-117d56107ea1)
![Bildschirmfoto vom 2023-07-09
21-02-45](https://github.com/go-gitea/gitea/assets/47871822/47407121-3f2a-4778-8f6d-ad2687c2e7b3)
![Bildschirmfoto vom 2023-07-09
21-03-44](https://github.com/go-gitea/gitea/assets/47871822/76167aaf-c3b2-46f6-9ffd-709f20aa6a34)
![Bildschirmfoto vom 2023-07-09
21-04-52](https://github.com/go-gitea/gitea/assets/47871822/af8fdde5-711e-4524-99cf-fb5d68af85b9)
![Bildschirmfoto vom 2023-07-09
21-05-25](https://github.com/go-gitea/gitea/assets/47871822/ae406946-e3e4-4109-abfe-b3588a07b468)
![Bildschirmfoto vom 2023-07-09
21-06-35](https://github.com/go-gitea/gitea/assets/47871822/2dbacc04-24d6-4f91-9e42-e16d6e4b5f1f)
![Bildschirmfoto vom 2023-07-09
21-09-03](https://github.com/go-gitea/gitea/assets/47871822/d3ca4e56-a72f-4179-adc8-98bfd638025b)
![Bildschirmfoto vom 2023-07-09
21-09-44](https://github.com/go-gitea/gitea/assets/47871822/df1fa689-499c-4e54-b6fb-3b81644b725f)
![Bildschirmfoto vom 2023-07-09
21-10-27](https://github.com/go-gitea/gitea/assets/47871822/b21cac71-a85a-4c8c-bb99-ab90373d8e09)
![Bildschirmfoto vom 2023-07-09
21-11-12](https://github.com/go-gitea/gitea/assets/47871822/89be39cf-0af9-4f2d-9fca-42f9eb5e7824)
![Bildschirmfoto vom 2023-07-09
21-12-01](https://github.com/go-gitea/gitea/assets/47871822/079579ea-1ecb-49c0-b32b-b59ed957caec)
![Bildschirmfoto vom 2023-07-09
21-17-44](https://github.com/go-gitea/gitea/assets/47871822/61ac6ec4-a319-4d5c-9c99-2e02a77295ba)
![Bildschirmfoto vom 2023-07-09
21-18-27](https://github.com/go-gitea/gitea/assets/47871822/5b55b73f-6244-47f7-a3e6-c5e4a7474585)
![Bildschirmfoto vom 2023-07-09
21-19-18](https://github.com/go-gitea/gitea/assets/47871822/c1b7c22e-3e5a-46d4-b8d6-5560db478c0b)
![Bildschirmfoto vom 2023-07-09
21-29-13](https://github.com/go-gitea/gitea/assets/47871822/82ffca8d-ab2e-4a18-9954-5b685bf6a422)
![Bildschirmfoto vom 2023-07-09
21-30-11](https://github.com/go-gitea/gitea/assets/47871822/ad2fdccc-2be8-41bb-bfdc-a084aa387b61)
![Bildschirmfoto vom 2023-07-09
21-32-44](https://github.com/go-gitea/gitea/assets/47871822/2d298ba7-d084-48b5-a139-f86d56262110)
![Bildschirmfoto vom 2023-07-09
21-33-28](https://github.com/go-gitea/gitea/assets/47871822/4cbd838e-9de8-4ad0-8ed9-438da5c9a5cb)


</details>

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-08-01 00:13:42 +02:00
Denys Konovalov fc6c3d626e
Mention devtest in frontend contributing guidelines (#26249)
Our `devtest` page contains some good UI examples which should be taken
as example when working on Gitea UI. Mention it in our frontend
contributing guidelines to for new contributors to know about it.
2023-07-31 12:49:21 +02:00
Panagiotis "Ivory" Vasilopoulos d58c542579
Add 'Show on a map' button to Location in profile, fix layout (#26214)
Not too important, but I think that it'd be a pretty neat touch.

Also fixes some layout bugs introduced by a previous PR.

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Caesar Schinas <caesar@caesarschinas.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-31 08:44:45 +00:00
silverwind 72363be7ca
Use shared template for webhook icons (#26242)
Fixes: https://github.com/go-gitea/gitea/issues/26241
2023-07-31 08:00:52 +00:00
silverwind 7e160f8824
Reduce margins on user settings page, introduce flex-container (#26046)
Same as https://github.com/go-gitea/gitea/pull/26026 but for the user
settings page. It introduces a new `flex-container` class and shares it
across both pages.

Before and After:
<img width="1264" alt="Screenshot 2023-07-21 at 19 35 57"
src="https://github.com/go-gitea/gitea/assets/115237/1358dab4-55c0-40ce-a4d5-673099304f3d">
<img width="1269" alt="Screenshot 2023-07-21 at 19 35 42"
src="https://github.com/go-gitea/gitea/assets/115237/34812f6d-dc65-4009-b977-90e03efdc6d1">
2023-07-31 07:16:03 +00:00
Jason Song 1e76a824bc
Refactor and enhance issue indexer to support both searching, filtering and paging (#26012)
Fix #24662.

Replace #24822 and #25708 (although it has been merged)


## Background

In the past, Gitea supported issue searching with a keyword and
conditions in a less efficient way. It worked by searching for issues
with the keyword and obtaining limited IDs (as it is heavy to get all)
on the indexer (bleve/elasticsearch/meilisearch), and then querying with
conditions on the database to find a subset of the found IDs. This is
why the results could be incomplete.

To solve this issue, we need to store all fields that could be used as
conditions in the indexer and support both keyword and additional
conditions when searching with the indexer.

## Major changes

- Redefine `IndexerData` to include all fields that could be used as
filter conditions.
- Refactor `Search(ctx context.Context, kw string, repoIDs []int64,
limit, start int, state string)` to `Search(ctx context.Context, options
*SearchOptions)`, so it supports more conditions now.
- Change the data type stored in `issueIndexerQueue`. Use
`IndexerMetadata` instead of `IndexerData` in case the data has been
updated while it is in the queue. This also reduces the storage size of
the queue.
- Enhance searching with Bleve/Elasticsearch/Meilisearch, make them
fully support `SearchOptions`. Also, update the data versions.
- Keep most logic of database indexer, but remove
`issues.SearchIssueIDsByKeyword` in `models` to avoid confusion where is
the entry point to search issues.
- Start a Meilisearch instance to test it in unit tests.
- Add unit tests with almost full coverage to test
Bleve/Elasticsearch/Meilisearch indexer.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-07-31 06:28:53 +00:00
JakobDev aba9096999
Show image size on view page (#25884)
This simply shows the Image size on the view page. This is useful, if
you search a image with a specific size.


![grafik](https://github.com/go-gitea/gitea/assets/15185051/9868e361-1c2e-447f-b824-70aa28bafcbc)
2023-07-31 05:04:45 +00:00
caicandong 983167cf49
Fix pull request check list is limited (#26179)
In the original implementation, we can only get the first 30 records of
the commit status (the default paging size), if the commit status is
more than 30, it will lead to the bug #25990. I made the following two
changes.
- On the page, use the ` db.ListOptions{ListAll: true}` parameter
instead of `db.ListOptions{}`
- The `GetLatestCommitStatus` function makes a determination as to
whether or not a pager is being used.

fixed #25990
2023-07-31 02:21:09 +00:00
JakobDev ea385f5d39
Fix API leaking Usermail if not logged in (#25097)
The API should only return the real Mail of a User, if the caller is
logged in. The check do to this don't work. This PR fixes this. This not
really a security issue, but can lead to Spam.

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-07-31 01:18:38 +00:00
GiteaBot 7dc2e50113 [skip ci] Updated licenses and gitignores 2023-07-31 00:32:16 +00:00
KN4CK3R d08ab7be9c
Fix typo in metadata (#26207)
https://github.com/go-gitea/gitea/pull/26194#discussion_r1277094525

There is no need to backport because these names are just used internal.
2023-07-30 23:54:22 +00:00
silverwind 8e644d3460
Update js and py dependencies (#26243)
- Update all JS and PY dependencies minus
`eslint-plugin-eslint-comments` (because of
https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/89)
- Regenerate SVGs
- Remove depreacted eslint rule
- Tested mermaid and swagger
2023-07-31 01:16:12 +02:00
silverwind 04d7ced063
De-emphasize issue sidebar buttons (#26171)
I find the colored buttons in the issue sidebar distracting, given that
they are not primary actions, I think we can de-colorize them.

Before:
<img width="285" alt="Screenshot 2023-07-26 at 19 42 22"
src="https://github.com/go-gitea/gitea/assets/115237/7e784805-4e01-4199-94bb-0538a0130264">
<img width="288" alt="Screenshot 2023-07-26 at 19 43 06"
src="https://github.com/go-gitea/gitea/assets/115237/3a89c661-e24a-4ebf-a585-d404d0a6a78a">
<img width="285" alt="Screenshot 2023-07-26 at 19 44 36"
src="https://github.com/go-gitea/gitea/assets/115237/c1aa8c13-6f41-4763-8149-d1c07cb4be5c">:

After:
<img width="286" alt="Screenshot 2023-07-26 at 19 42 04"
src="https://github.com/go-gitea/gitea/assets/115237/74d640c2-e0ab-4fef-87aa-9e788e9010e2">
<img width="285" alt="Screenshot 2023-07-26 at 19 42 51"
src="https://github.com/go-gitea/gitea/assets/115237/3b69976a-9aa4-4e1c-8df3-4168f4a9fcf9">
<img width="286" alt="Screenshot 2023-07-26 at 19 45 15"
src="https://github.com/go-gitea/gitea/assets/115237/897222fd-4df2-4d99-98eb-e5f8fb77c4d6">
2023-07-30 22:46:53 +00:00
silverwind aa723dea9b
Don't autosize textarea in diff view (#26233)
Resizing the comment editor can be a very expensive operation because it
triggers page reflows, which on large PRs can take upwards of seconds to
complete. Disable this mechanism on the diff page only where we know
that the page can get large.

Fixes https://github.com/go-gitea/gitea/issues/26201 for the textarea
editor.

I don't think this can be fixed for EasyMDE because as far as I can
tell, it exposes no option to disable this resizing.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-31 00:11:15 +02:00
silverwind 4244ce0d28
Add /public/assets to .ignore (#26232)
Ignore compiled assets when searching via ripgrep and similar search
tools.
2023-07-30 12:34:20 +02:00
silverwind 72d89eb8dd
Fix attachment clipboard copy on insecure origin (#26224)
Fixes: https://github.com/go-gitea/gitea/issues/26202

Actually later I found out the code did not use `clippie`, so I fixed
it. The bug was never in the clippie module like I initially suspected.
Also, I added a tooltip for feedback.

<img width="139" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/da501670-9c15-4412-969a-b559773c7ab9">

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-30 00:56:45 +02:00
puni9869 11074258fc
Fix commit compare style (#26209)
as title

Fixes : #25825
Before
<img width="1334" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c54a41b0-39bd-4094-a956-081a8f4128f2">

After change
<img width="1340" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/c112d235-6bbe-4bcb-9529-78da3ab0fa14">

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-29 16:19:12 +00:00
caicandong fd836ff68b
Fix unable to display individual-level project (#26198)
As title

Before:

![image](https://github.com/go-gitea/gitea/assets/50507092/94afc3bf-5597-4151-a59b-5632840ffa21)

After:

![image](https://github.com/go-gitea/gitea/assets/50507092/df81aa0b-98a6-477d-a270-2e45b3dca0fc)

fix #26189
2023-07-29 15:35:53 +00:00
Zettat123 b33cf4fabc
Fix access check for org-level project (#26182)
Fix #25934

Add `ignoreGlobal` parameter to `reqUnitAccess` and only check global
disabled units when `ignoreGlobal` is true. So the org-level projects
and user-level projects won't be affected by global disabled
`repo.projects` unit.
2023-07-29 14:13:24 +00:00
Kerwin Bryant 05d0b7ca91
Fixed incorrect locale references (#26218)
Fixed two incorrect headers for setting the page navigation bar:
* User settings page, should not use the title "`org.settings`"
* Repo settings page, should not use the title "`org.settings`"
2023-07-29 21:34:22 +08:00
Panagiotis "Ivory" Vasilopoulos 1c89f15f42
Use calendar icon for Joined on... in profiles (#26215) 2023-07-29 19:34:49 +08:00
delvh e01824f2b8
Add changelog for 1.20.2 (#26208)
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-29 15:07:03 +08:00
sebastian-sauer 55532061c8
Add commits dropdown in PR files view and allow commit by commit review (#25528)
This PR adds a new dropdown to select a commit or a commit range
(shift-click like github) of a Pull Request.
After selection of a commit only the changes of this commit will be shown.
When selecting a range of commits the diff of this range is shown.

This allows to review a PR commit by commit or by viewing only commit ranges.
The "Show changes since your last review" mechanism github uses is implemented, too.
When reviewing a single commit or a commit range the "Viewed" functionality is disabled.

## Screenshots

### The commit dropdown

![image](https://github.com/go-gitea/gitea/assets/51889757/0db3ae62-1272-436c-be64-4730c5d611e3)

### Selecting a commit range

![image](https://github.com/go-gitea/gitea/assets/51889757/ad81eedb-8437-42b0-8073-2d940c25fe8f)

### Show changes of a single commit only

![image](https://github.com/go-gitea/gitea/assets/51889757/6b1a113b-73ef-4ecc-adf6-bc2340bb8f97)

### Show changes of a commit range

![image](https://github.com/go-gitea/gitea/assets/51889757/6401b358-cd66-4c09-8baa-6cf6177f23a7)


Fixes https://github.com/go-gitea/gitea/issues/20989
Fixes https://github.com/go-gitea/gitea/issues/19263

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2023-07-28 21:18:12 +02:00
puni9869 4971a10543
Warn instead of reporting an error when a webhook cannot be found (#26039)
Attemp fix: #25744
Fixing the log level when we delete any repo then we get error hook not
found by id. That should be warn level to reduce the noise in the logs.

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-07-28 17:46:48 +00:00
puni9869 1d8d90fd37
Fixing the align of commit stats in commit_page template. (#26161)
Fixing the align center to row and space around for commit_page
template.
2023-07-28 13:12:44 -04:00
Lunny Xiao ce27de4d48
Fix allowed user types setting problem (#26200)
Fix #25951
2023-07-28 12:15:39 -04:00
wxiaoguang d88fed0db1
Hide branch/tag icon if branches/tags are empty (#26204)
The branch/tag icons aren't hidden correctly if there is no branch/tag. This PR fixes it.
2023-07-28 23:05:24 +08:00
KN4CK3R 7866a6e0e2
Prevent primary key update on migration (#26192)
Fixes #25918

The migration fails on MSSQL because xorm tries to update the primary
key column. xorm prevents this if the column is marked as auto
increment:

c622cdaf89/internal/statements/update.go (L38-L40)

I think it would be better if xorm would check for primary key columns
here because updating such columns is bad practice. It looks like if
that auto increment check should do the same.

fyi @lunny
2023-07-28 09:54:31 +02:00
Earl Warren 494ee56de2
improve unit test for caching (#26185)
- Configure `setting.CacheService.TTL` which will force the code to go
trough the caching mechanism.
- Remove the TODO and uncomment the test code.

(cherry picked from commit a201f2f189)

Refs: https://codeberg.org/forgejo/forgejo/pulls/974

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-07-27 22:24:40 +02:00
Earl Warren eaea530d6b
Render plaintext task list items for markdown files (#26186)
- The library that's being used for org-mode, [doesn't render the status
of list items](https://github.com/niklasfasching/go-org/issues/63).
- Add a modified version of the proposed CSS snippet to still display
the status for the list items. The alternative was parsing HTML and
transforming it, which is too complicated for this small task.
- Resolves https://codeberg.org/Codeberg/Community/issues/1099

(cherry picked from commit 9753c7e4b8)

Refs: https://codeberg.org/forgejo/forgejo/pulls/1071

Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-07-27 14:15:31 +00:00
puni9869 16afe4f631
Add tooltip to describe LFS table column and color delete LFS file button red (#26181)
Fix: https://github.com/go-gitea/gitea/issues/26152
Thease changes are related to UX and accessibility changes in desktop
mode.

<img width="50" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/30a75b50-4f8d-4108-9219-2c69b2a8fa6f">

Also  this is incomplete header 
<img width="264" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/87837076-dfc7-4a68-863a-795edf61eb02">
Lets add a tooltip if it is applicable or add `title` attribute so that
it will be clearly visible.

After 

![image](https://github.com/go-gitea/gitea/assets/80308335/e1f91458-a0ab-4a9a-b32a-d1eaaac05b37)

![image](https://github.com/go-gitea/gitea/assets/80308335/fe2031d3-0b26-427f-8438-49e8f54bc12f)
2023-07-27 13:39:09 +00:00
delvh bd6ef71854
Show branches and tags that contain a commit (#25180)
Now, you can see for a commit which existing branches and tags contain it.
You first have to click on the `load branches and tags` button, they are not preloaded by default.
All branches and tags are ordered descending by creation date.
You can even see without much hassle if the given commit is already part of the default branch.

Closes #25152 

## Screenshots

### Initial

![image](https://github.com/go-gitea/gitea/assets/51889757/84db2c0b-aaef-4f69-ab92-0b812793d2ad)

### Loaded

![image](https://github.com/go-gitea/gitea/assets/51889757/a9b84e66-8e44-4c55-b017-c37f4a45f41b)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-27 12:47:41 +02:00
Lunny Xiao bd7b5e61aa
Release attachments duplicated check (#26176) 2023-07-27 09:24:22 +00:00
wxiaoguang 8baa42c8d7
Calculate MAX_WORKERS default value by CPU number (#26177)
To avoid consuming user's 100% CPU, limit the default value of
MAX_WORKERS

Fix #26063 (the CPU 100% problem mentioned in it)
2023-07-27 16:40:35 +08:00
cassiozareck 73fb1ecdcf
Fixing redirection issue for logged-in users (#26105)
This PR addresses an issue where logged-in users get redirected to the
homepage when trying to access a URL with the redirect_to parameter. The
issue was traced back to a middleware function in
services/auth/middleware.go that redirects logged-in users to the
homepage. This function didn't account the redirect_to parameter.

The fix modifies the middleware function to check for this case and
redirect the user to the specified URL instead of the homepage.

Closes: #26005

---------

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-07-27 13:08:51 +08:00
silverwind c6975e583a
Update govulncheck, fix typo (#26168)
- Update govulncheck to latest version
- Fix typo in variable name
2023-07-26 22:51:02 +00:00
KN4CK3R 2d7fe4cc1e
Fix handling of plenty Nuget package versions (#26075)
Fixes #25953

- Do not load full version information (v3)
- Add pagination support (v2)
2023-07-26 19:43:21 +00:00
Niko Hoffrén 6ce89883eb
Fix typos in Contributing.md (#26170)
Fixed typos considering CONTRIBUTING.md.

This line:
GitHub API compatability #github-api-compatability
changed to:
GitHub API compatibility #github-api-compatibility

and this line:
GitHub API compatability
changed to:
GitHub API compatibility
2023-07-26 15:14:13 -04:00
yp05327 36732005b4
Disable download action logs button when there's no logs (#26114)
If there's no logs, you can also click the download button, then you
will get `job is not started` page

![image](https://github.com/go-gitea/gitea/assets/18380374/c0dad309-1fb9-4505-99da-bf0038423744)
https://gitea.com/yp05327/testrepo/actions/runs/38

After:
If there's no steps displayed, the download button will be disabled.

![image](https://github.com/go-gitea/gitea/assets/18380374/5f51ba70-3d0b-46d8-ad77-f02c4c8fa52c)
2023-07-26 20:51:26 +02:00
John Olheiser 79995a8194
Re-add static images to docs (#26167)
https://github.com/go-gitea/gitea/pull/26051 I accidentally rebased
locally without my re-addition for these files, so they were missed in
the merge, but only for `main`.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 14:25:39 +00:00