Commit Graph

14955 Commits

Author SHA1 Message Date
Giteabot 4aabd8e823
Set `ref` to fully-formed of the tag when trigger event is `release` (#23944) (#23989)
Backport #23944 by @sillyguodong

Fix #23943
When trigger event is `release`, ref should be like
`refs/tags/<tag_name>` instead of `CommitID`

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2023-04-08 20:43:46 +08:00
Giteabot 6a5b8eb7b6
Fix redirect bug when creating issue from a project (#23971) (#23997)
Backport #23971 by @lunny

Fix #23966

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-04-08 12:38:56 +02:00
Giteabot a00e473341
Remove `Repository.getFilesChanged` to fix Actions `paths` and `paths-ignore` filter (#23920) (#23969)
Backport #23920 by @ChristopherHX

Remove the misbehaving function and call
Repository.GetFilesChangedBetween instead.

Fixes #23919

---

~~_TODO_ test this~~ `Repository.getFilesChanged` seems to be only used
by Gitea Actions, but a similar function already exists

**Update** I tested this change and the issue is gone.

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2023-04-08 16:16:21 +08:00
Giteabot 4019a6d4b2
Discolor pull request tab labels (#23950) (#23987)
Backport #23950 by @silverwind

https://github.com/go-gitea/gitea/pull/22687 has discolored the repo tab
labels. This does the same for PR tabs for consistency. Value `0` is
still rendered like before.

Before:
<img width="502" alt="Screenshot 2023-04-06 at 19 35 24"
src="https://user-images.githubusercontent.com/115237/230454329-db6244ff-7d7e-4a2f-9240-f618a1c57f8c.png">

After:
<img width="497" alt="Screenshot 2023-04-06 at 19 35 07"
src="https://user-images.githubusercontent.com/115237/230454321-a0be6551-8c31-45e4-a1fb-ffc0d85d87bf.png">
<img width="497" alt="Screenshot 2023-04-06 at 19 38 37"
src="https://user-images.githubusercontent.com/115237/230454570-2fe2aa67-dfa7-4b2e-8c04-8dd40e6e99fc.png">

Co-authored-by: silverwind <me@silverwind.io>
2023-04-07 22:32:42 -04:00
Jason Song 0487e39f82
Treat PRs with agit flow as fork PRs when triggering actions. (#23884) (#23967)
Backport #23884.

There is no fork concept in agit flow, anyone with read permission can
push `refs/for/<target-branch>/<topic-branch>` to the repo. So we should
treat it as a fork pull request because it may be from an untrusted
user.
2023-04-07 17:43:12 -04:00
Giteabot 3a7cb1a83b
Use Get/Set instead of Rename when Regenerate session id (#23975) (#23983)
Backport #23975 by @wxiaoguang

Do not use Rename here, because the old sid and new sid may be in
different redis cluster slot.

Fix #23869

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-07 14:21:20 -05:00
Giteabot f317186aa6
Do not crash when parsing an invalid workflow file (#23972) (#23976)
Backport #23972 by @wolfogre

Fix #23658.

Related to https://gitea.com/gitea/act/pulls/39

Co-authored-by: Jason Song <i@wolfogre.com>
2023-04-07 09:55:59 -04:00
Giteabot 5b7df68555
Ensure RSS icon is present on all repo tabs (#23904) (#23973)
Backport #23904 by @silverwind

Previously, not all repo tabs had shown the RSS icon in the repo header
because the context data was not being set. Added this context data in a
new function.

Before:

<img width="806" alt="image"
src="https://user-images.githubusercontent.com/115237/229639615-9cc00e75-3a26-4ff4-a6f2-316c1fccc596.png">

After:

<img width="815" alt="Screenshot 2023-04-04 at 00 16 17"
src="https://user-images.githubusercontent.com/115237/229639201-2e1c015b-1f13-46d4-aa14-e7a82fab3982.png">

Co-authored-by: silverwind <me@silverwind.io>
2023-04-07 14:55:30 +02:00
Giteabot 833a4b1775
Hardcode path to docker images (#23955) (#23968)
Backport #23955 by @techknowlogick

Fix #23954

This allows for building on platforms that don't have docker hub as the
default container registry.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-04-07 14:54:28 +02:00
Giteabot 1b8ecd179b
Title can be empty when creating tag only (#23917) (#23961)
Backport #23917 by @Zettat123

Fixes #23809

Make the title not required. If the title is empty when creating release
(not tag), an error message will be displayed.

![image](https://user-images.githubusercontent.com/15528715/229761056-c52e338b-5f25-4d7d-bb44-2cb0304abcee.png)

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-04-07 20:13:57 +08:00
6543 085b56302c
Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) (#23878)
Backport #23874
2023-04-07 18:10:17 +08:00
Lunny Xiao 5066b208de
Merge `push to create`, `open PR from push`, and `push options` docs articles into one (#23744) (#23959)
backport #23744
2023-04-07 15:49:26 +08:00
wxiaoguang ac658bb92c
Backport locales to 1.19 (#23960)
This time the backport is done by `backport-locales.go` automatically,
no manual fix.

However, there are some new broken translations in 1.20 (main branch),
so we must fix our ini package next time, then the broken could be
resolved fundmentally.
2023-04-07 15:29:54 +08:00
Giteabot 001d3fb820
Delete deleted release attachments immediately from storage (#23913) (#23958)
Backport #23913 by @lunny

Previously, deleted release attachments were kept forever on the
external storage.
Note: It may be very slow now if there are many attachments to be
deleted on this release.

Fix #23728

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-04-06 18:38:34 -04:00
silverwind 8092251133
Left-align review comments (#23937)
Small extract from https://github.com/go-gitea/gitea/pull/23553 for
1.19:

Before:
<img width="1190" alt="Screenshot 2023-04-05 at 21 47 55"
src="https://user-images.githubusercontent.com/115237/230190330-3cee8904-8558-43ea-b9d3-424d807d0b73.png">

After:
<img width="1181" alt="Screenshot 2023-04-05 at 21 47 38"
src="https://user-images.githubusercontent.com/115237/230190315-c1c3cae5-1bc3-4c2d-bd3d-c119fa01be82.png">
2023-04-06 09:45:45 +02:00
Giteabot 55239cbab7
Fix image border-radius (#23886) (#23930)
Backport #23886 by @wxiaoguang

1. Instead of polluting the `border-radius` style globally, each "img"
usage should declare their own styles.
2. There were some bugs in code, I believe the `.img` selector was done
by mistake.

After:


![image](https://user-images.githubusercontent.com/2114189/229415742-161b018f-14c3-471d-bcf7-34f83e5c2d89.png)


![image](https://user-images.githubusercontent.com/2114189/229415789-829d364a-76da-47a5-8c61-398cc990873c.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-05 17:07:44 +02:00
Giteabot df74ee0376
Scroll collapsed file into view (#23702) (#23929)
Backport #23702 by @jpraet

Fixes #23701, #23515.

Alternate approach to #23604 using CSS scroll-margin-top, which is also
taken into account for direct links to files in a diff:

* On the PR diff, this currently shows the previous file first:
https://try.gitea.io/jpraet/test/pulls/13/files#diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333
* On the commit diff, the first line of the linked file is currently
under the sticky header:
1a19e6b14e (diff-b94d08b409f9d05fb65b6cccaf7b3e4ecc7cc333)

Co-authored-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
2023-04-05 13:49:22 +03:00
Giteabot 8d88f148d7
docs: make the required backticks in email password more explicit (#23923) (#23926)
Backport #23923 by @teauxfu

updated the example config to make the needed backticks around the
password more obvious

Co-authored-by: alex <alexmw777@gmail.com>
2023-04-04 15:06:54 -04:00
Giteabot 7bfab90a8f
docs: fix typo (#23924) (#23925)
Backport #23924 by @teauxfu

fixes a minor typo in the email templates page

Co-authored-by: alex <alexmw777@gmail.com>
2023-04-04 18:13:09 +02:00
Lunny Xiao 1a8da2e08f
Update docs markdown file weight to make it clear (#23909) (#23921)
backport #23909
2023-04-04 11:27:38 -04:00
Giteabot 7c180ff8eb
Fix code view (diff) broken layout (#23096) (#23918)
Backport #23096 by @wxiaoguang

Close #22911

I think it's ready for review now, feel free to test it, welcome to help
to improve.

### Before


![image](https://user-images.githubusercontent.com/2114189/220958734-06871615-b498-4143-8449-3d443f08ffaa.png)

### After


![image](https://user-images.githubusercontent.com/2114189/220958621-0dce2728-57b8-4a1f-ac5d-48c7c2d42f5c.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-04 16:02:29 +02:00
Giteabot c34f7cdb1a
Use ghost user if package creator does not exist (#23822) (#23915)
Backport #23822 by @KN4CK3R

Fixes #23818

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-04-04 20:37:28 +08:00
Giteabot fd0baf637d
Org pages style fixes (#23901) (#23914)
Backport #23901 by @silverwind

Few fixes/enhancements around org pages:

Use flexbox for member and repo lists and tweak rendering of tabs and
list:

<img width="765" alt="Screenshot 2023-04-03 at 22 54 24"
src="https://user-images.githubusercontent.com/115237/229625716-92a834c3-9121-4729-8b9b-3a3973cf9a91.png">
<img width="771" alt="Screenshot 2023-04-03 at 22 55 15"
src="https://user-images.githubusercontent.com/115237/229625719-acc08ce8-4489-44a6-a9b9-e36755c55b1d.png">

Vertically center remove/leave buttons, add link to avatar:

<img width="1223" alt="Screenshot 2023-04-03 at 21 51 20"
src="https://user-images.githubusercontent.com/115237/229612616-b662b795-e754-41a1-a77a-381c267e6104.png">

Co-authored-by: silverwind <me@silverwind.io>
2023-04-04 19:05:41 +08:00
Giteabot dff3ce089d
User/Org Feed render description as per web (#23887) (#23906)
Backport #23887 by @6543

User descriptions should be rendered so that links and other markup
appear correct in RSS feeds.

test will be added by #23874

Co-authored-by: 6543 <6543@obermui.de>
2023-04-04 00:44:50 -04:00
Giteabot 9836b7db7b
Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823) (#23905)
Backport #23823 by @wxiaoguang

Thanks to @trwnh

Close #23802

The ActivityPub id is an HTTPS URI that should remain constant, even if
the user changes their name.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-03 22:41:57 -05:00
Giteabot d752f0d7d0
Add git dashes separator to some "log" and "diff" commands (#23606) (#23720)
Backport #23606 by @wxiaoguang

Reference:
https://github.com/go-gitea/gitea/issues/22578#issuecomment-1444180053

Credits to @tdesveaux , thank you very much for catching the problem. If
you'd like to open a PR, feel free to replace this one.

Git reports fatal errors for ambiguous arguments:

```
fatal: ambiguous argument 'refs/a...refs/b': unknown revision or path not in the working tree.
        Use '--' to separate paths from revisions, like this:
        'git <command> [<revision>...] -- [<file>...]'
```

So the `--` separator is necessary in some cases.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-03 21:43:51 -04:00
Giteabot 669c76c0fd
Fix `cases.Title` crash for concurrency (#23885) (#23903)
Backport #23885 by @wxiaoguang

Regression of #19676 and #21814

Fix #23872

`cases.Title` is not thread-safe, it has internal state, so it can't be
used as a global shared variable.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-04 01:26:14 +02:00
Giteabot ac57ec5c47
Fix user profile description rendering (#23882) (#23902)
Backport #23882 by @wxiaoguang

Found an UI problem when testing #23874

The `ul li` styles were polluted.

Before:


![image](https://user-images.githubusercontent.com/2114189/229409756-22438268-ee36-4e4a-a20b-04ee8ee4a79d.png)


After:


![image](https://user-images.githubusercontent.com/2114189/229409809-25cea715-b6f1-4346-9bb4-3fbb58fcca65.png)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-03 16:00:24 -05:00
Giteabot f6dab64412
Convert .Source.SkipVerify to $cfg.SkipVerify (#23839) (#23899)
Backport #23839 by @yp05327

`Source` doesn't have `SkipVerify`, it is defined in `cfg`

Co-authored-by: yp05327 <576951401@qq.com>
2023-04-03 13:02:28 -04:00
Giteabot 847f0bb9f3
Fix review box viewport overflow issue (#23800) (#23898)
Backport #23800 by @silverwind

Fix regression that came likely from
https://github.com/go-gitea/gitea/pull/23271:

Long lines of text currently cause the review box's CodeMirror element
to resize which apparently is not recognized by [popper's resize
detection](https://popper.js.org/docs/v2/modifiers/event-listeners/) and
which causes the element to go partially out of viewport until a reflow
happens:


![wrap](https://user-images.githubusercontent.com/115237/228673260-f8ffe89e-5724-4fb9-b93f-30b146c4c436.gif)

Fix this by setting the element to a static width derived from viewport
width and remove the previously clumsy media queries.

Co-authored-by: silverwind <me@silverwind.io>
2023-04-03 12:11:08 -04:00
Giteabot 1886bd6a01
Rename actions unit to `repo.actions` and add docs for it (#23733) (#23881)
Backport #23733 by @wolfogre

I neglected that the `NameKey` of `Unit` is not only for translation,
but also configuration. So it should be `repo.actions` to maintain
consistency.

## ⚠️ BREAKING ⚠️

If users already use `actions.actions` in `DISABLED_REPO_UNITS` or
`DEFAULT_REPO_UNITS`, it will be treated as an invalid unit key.

Co-authored-by: Jason Song <i@wolfogre.com>
2023-04-03 12:54:36 +02:00
wxiaoguang 7e07f5c4dc
Backport some locales to 1.19 (#23880)
There are still broken locales (eg: #23866), so this backport is still done manually.
2023-04-03 03:21:42 -04:00
Jason Song 799536db46
Fix checks for `needs` in Actions (#23789) (#23831)
Backport #23789.

Fix:
- https://gitea.com/gitea/act_runner/issues/77
- https://gitea.com/gitea/act_runner/issues/81

Before:
<img width="1489" alt="image"

src="https://user-images.githubusercontent.com/9418365/228501567-f752cf87-a7ed-42c6-8f3d-ba741795c1fe.png">

Highlights:
- Upgrade act to make things doable, related to
  - https://gitea.com/gitea/act/pulls/32
  - https://gitea.com/gitea/act/pulls/33
  - https://gitea.com/gitea/act/pulls/35
- Make `needs` works
- Sort jobs in the original order in the workflow files
2023-04-03 13:24:45 +08:00
Giteabot c68650a7fb
Prefill input values in oauth settings as intended (#23829) (#23871)
Backport #23829 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
2023-04-03 04:33:12 +02:00
Giteabot fe7caa05cc
Check `IsActionsToken` for LFS authentication (#23841) (#23875)
Backport #23841 by @Zettat123

Close #23824 

Actions cannot fetch LFS objects from private repos because we don't
check if the user is the `ActionUser`.

Co-authored-by: Zettat123 <zettat123@gmail.com>
2023-04-02 21:30:33 +01:00
Giteabot 026167f854
Remove assertion debug code for show/hide refactoring (#23576) (#23868)
Backport #23576 by @wxiaoguang

When doing the refactoring:

* #22950

I added some debug mode code (assertShown) to help to catch bugs, it did
catch some bugs like:

* #23074

If it has been proved that there is no more bugs, this assertion could
be removed easily and clearly.

Feel free to decide when to remove it (feel free to convert it from
Draft to Ready for Review).
2023-04-02 16:20:06 +08:00
Giteabot 8abfbe2165
Fix JS error when changing PR's target branch (#23862) (#23864)
Backport #23862 by @wxiaoguang

Caught by @justusbunsi 

An old bug from #6488

In `pullrequest_targetbranch_change`, the `data` might be empty, because
`UpdatePullRequestTarget` may respond `http.StatusNoContent`.

And the old code's `$branchTarget.text(data.base_branch);` doesn't make
sense, because in the end, the page will be always reloaded.

So, just remove the `$branchTarget.text(data.base_branch);`, everything
should be fine.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-04-01 21:15:46 -04:00
Giteabot 16bfe983c2
Fix 500 error if there is a name conflict when edit authentication source (#23832) (#23852)
Backport #23832 by @yp05327

Co-authored-by: yp05327 <576951401@qq.com>
2023-03-31 12:53:25 -04:00
Giteabot 503af4b807
CSS color tweaks (#23828) (#23842)
Backport #23828 by @silverwind

Change grey shades in arc-green to match the theme more:

<img width="661" alt="Screenshot 2023-03-30 at 21 42 34"
src="https://user-images.githubusercontent.com/115237/228957952-8e099e56-6923-4aa6-8ce9-3c1cd898b73e.png">

Adjusted grey shade in light theme:

<img width="652" alt="image"
src="https://user-images.githubusercontent.com/115237/228963876-3bde6181-8397-4dc2-be72-33982e6c7acb.png">

Increase contrast in arc-green, change background to slightly darker
shade, change forgeground to slightly brighter colors:

<img width="283" alt="Screenshot 2023-03-30 at 22 33 20"
src="https://user-images.githubusercontent.com/115237/228957957-272c24a5-dd0b-427a-b6b7-e62836bdd73c.png">

Increase contrast of grey text in light theme as well by making them
darker:

<img width="273" alt="Screenshot 2023-03-30 at 22 33 35"
src="https://user-images.githubusercontent.com/115237/228957959-283139c7-6fa7-4b68-9fdd-16c668ad1301.png">

Add color rule for border multiple select items:

<img width="183" alt="Screenshot 2023-03-30 at 22 29 31"
src="https://user-images.githubusercontent.com/115237/228957954-6b5a752d-bbb0-4519-ab35-d02c0804d955.png">
<img width="181" alt="Screenshot 2023-03-30 at 22 29 46"
src="https://user-images.githubusercontent.com/115237/228957956-fca9790a-d6c9-4f31-8d1b-d183ab3ac669.png">

Added color rule for red `*` on required form fields:

<img width="97" alt="image"
src="https://user-images.githubusercontent.com/115237/228958760-517ad9ef-565d-4349-b734-9b559ab42429.png">

Co-authored-by: silverwind <me@silverwind.io>
2023-03-31 17:24:09 +08:00
Giteabot 8b3dd7de5d
Fix incorrect visibility dropdown list in add/edit user page (#23804) (#23833)
Backport #23804 by @yp05327

Visibility dropdown list will not work in add/edit user page when error
occurred

Co-authored-by: yp05327 <576951401@qq.com>
2023-03-31 16:25:21 +08:00
Giteabot a04535e212
[Patch] Fix closed PR also triggers Webhooks and actions (#23782) (#23834)
Backport #23782 by @sillyguodong

Fix #23707 
Cause by #23189
This PR is a quick fix that, when pushing commits to closed PR, webhook
and actions also be triggered.

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2023-03-31 14:29:23 +08:00
wxiaoguang a1460333dc
Fix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790) (#23825)
Backport #23790

Fix regression of #22683

Pass all variables into sub-template.

Close #23787
2023-03-31 12:15:51 +08:00
wxiaoguang d15f20b2d2
Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) (#23791)
Follow #21962

After I eat my own dogfood, I would say that
ONLY_SHOW_RELEVANT_REPOS=false is necessary for many private/enterprise
instances, because many private repositories do not have
"description/topic", users just want to search by their names.

This PR also adds `PageIsExploreRepositories` check, to make code more
strict, because the `search` template is shared for different purpose.

And during the test, I found a bug that the "Search" button didn't
respect the "relevant" parameter, so this PR fixes the bug by the way
together.
2023-03-30 09:09:22 -05:00
sillyguodong 863da7d5a1
Fix cancel button in the page of project edit not work (#23655) (#23813)
Backport #23655

Before, in project edit page, the cancel button is not work.


https://user-images.githubusercontent.com/33891828/227182731-6478e29f-0e52-48c4-beb0-6a7d1dda6a1d.mov

1. The wrong classname `cancel` was added to the `<a>` tag. That
classname caused the default click event of `<a>` tag to be cancelled.
Because we have the following settings in the global. So I remove the
classname `cancel`.


9be90a5875/web_src/js/features/common-global.js (L325-L327)

2. Another change is that page will redirect to the previous page.


https://user-images.githubusercontent.com/33891828/227187326-c653c6d6-9715-440f-a732-ba0a6f012c81.mov
2023-03-30 11:15:50 +02:00
wxiaoguang 1cad923b36
Backport locales (with manual fix) (#23808)
Backport locales (with manual fix)
2023-03-30 14:58:57 +08:00
Jason Song edb6ba28f1
Add missing translation for `actions.runners.reset_registration_token_success` (#23732) (#23781)
Backport #23732.

Used at


4011821c94/routers/web/shared/actions/runners.go (L157)
2023-03-29 22:05:26 -04:00
Giteabot 494721cc90
Don't apply the group filter when listing LDAP group membership if it is empty (#23745) (#23788)
Backport #23745 by @zeripath

When running listLdapGroupMemberships check if the groupFilter is empty
before using it to list memberships.

Fix #23615

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
2023-03-29 15:00:12 -04:00
Giteabot d27e693ecf
Add CSS rules for basic colored labels (#23774) (#23777)
Backport #23774 by @silverwind

Before:

<img width="164" alt="Screenshot 2023-03-28 at 23 35 46"
src="https://user-images.githubusercontent.com/115237/228372437-663111b9-7285-4fa2-9125-fb5e1cad21d7.png">

After:
<img width="166" alt="Screenshot 2023-03-28 at 23 35 54"
src="https://user-images.githubusercontent.com/115237/228372441-49430517-6b2d-4389-b11c-c30a724f6de7.png">

Also I removed the `!important` on the primary label as it's very likely
unnecessary with the amount of specificity the selector already has.

Co-authored-by: silverwind <me@silverwind.io>
2023-03-29 14:15:00 -04:00
Zettat123 81a995cd84
Fix project card preview select and template select (#23684) (#23731)
Backport #23684 
Now user cannot set Card Previews when creating a new project.

Before:


https://user-images.githubusercontent.com/15528715/227488883-29bbd636-8b98-45b3-b2f8-de5206b045dc.mp4

After:


https://user-images.githubusercontent.com/15528715/227488976-3447f252-805a-4f18-ae0e-1cddd921dcc3.mp4
2023-03-29 14:52:50 +08:00
Giteabot d977e7ec10
Add creation time in tag list page (#23693) (#23773)
Backport #23693 by @balki

Fixes #21699

Co-authored-by: Balki <189196+balki@users.noreply.github.com>
2023-03-28 18:00:07 -04:00