Commit Graph

18125 Commits

Author SHA1 Message Date
Thomas Desveaux
c888c933a9
Fix NuGet Package API for $filter with Id equality (#31188)
Fixes issue when running `choco info pkgname` where `pkgname` is also a
substring of another package Id.

Relates to #31168

---

This might fix the issue linked, but I'd like to test it with more choco
commands before closing the issue in case I find other problems if
that's ok.

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-06-04 06:45:56 +00:00
silverwind
4f9b8b397c
Fix overflow on notifications (#31178)
Fixes https://github.com/go-gitea/gitea/issues/31170.

<img width="1312" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/627711ed-93ca-4be6-b958-10d673ae9517">
2024-06-04 06:10:04 +00:00
silverwind
a7557494ca
Update chroma to v2.14.0 (#31177)
https://github.com/alecthomas/chroma/releases/tag/v2.14.0

Tested it with a typescript file.
2024-06-04 05:34:34 +00:00
yp05327
93570de496
Update air package path (#31233) 2024-06-04 13:00:44 +08:00
Yarden Shoham
433963e52c
Bump @github/relative-time-element to v4.4.1 (#31232)
I tested and all timestamps work as before.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2024-06-04 03:01:06 +00:00
6543
aace3bccc3
Add option for mailer to override mail headers (#27860)
Add option to override headers of mails, gitea send out

---
*Sponsored by Kithara Software GmbH*
2024-06-03 20:42:52 +02:00
silverwind
8c68c5e436
Move custom tw- helpers to tailwind plugin (#31184)
Move the previous custom `tw-` classes to be defined in a tailwind
plugin. I think it's cleaner that way and I also verified double-class
works as expected:

<img width="299" alt="Screenshot 2024-05-30 at 19 06 24"
src="https://github.com/go-gitea/gitea/assets/115237/003cbc76-2013-46a0-9e27-63023fa7c7a4">
2024-06-03 18:21:28 +00:00
silverwind
0f0db6a14f
Remove unnecessary inline style for tab-size (#31224)
Move the rule to the parent node. `tab-size` is inherited so will work
just as before.
2024-06-03 17:21:45 +00:00
Kemal Zebari
cb27c438a8
Document possible action types for the user activity feed API (#31196)
Resolves #31131.

It uses the the go-swagger `enum` property to document the activity
action types.
2024-06-03 13:40:48 +00:00
yp05327
fc641b3a28
Remove sqlite-viewer and using database client (#31223)
sqlite-viewer can not edit sqlite.
database client can connect to almost all common databases, which is
very useful I think. Of cause, it can edit sqlite.

https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-database-client2

And for using sqlite, sqlite3 is required. So also added a new feature:
https://github.com/warrenbuckley/codespace-features
found from: https://containers.dev/features
2024-06-03 10:41:29 +00:00
silverwind
4b20b51f82
Update golangci-lint to v1.59.0 (#31221)
One new error regarding `fmt.Fscanf` error return in `gitdiff.go` but
I'm not touching that further right now as handling the error would
introduce a behaviour difference.
2024-06-03 07:04:35 +00:00
GiteaBot
c6854202be [skip ci] Updated licenses and gitignores 2024-06-03 00:27:17 +00:00
silverwind
9b05bfb173
Fix overflow in issue card (#31203)
Before:

<img width="373" alt="Screenshot 2024-06-01 at 01 31 26"
src="https://github.com/go-gitea/gitea/assets/115237/82a210f2-c82e-4b7e-ac43-e70e46fa1186">

After:
<img width="376" alt="Screenshot 2024-06-01 at 01 31 32"
src="https://github.com/go-gitea/gitea/assets/115237/82d1b9f7-4fad-47bd-948a-04e1e7e006e6">
2024-06-03 00:09:51 +00:00
Lunny Xiao
2788a7ca27
Fix agit checkout command line hint & fix ShowMergeInstructions checking (#31219) 2024-06-03 06:45:21 +08:00
Lunny Xiao
98a61040b1
Fix the possible migration failure on 286 with postgres 16 (#31209)
Try to fix #31205
2024-06-02 03:01:08 +00:00
Max Wipfli
3cc7f763c3
Only update poster in issue/comment list if it has been loaded (#31216)
Previously, all posters were updated, even if they were not part of
posterMaps. In that case, a ghost user was erroneously inserted.

Fixes #31213.
2024-06-02 10:32:20 +08:00
Kemal Zebari
ab458ce10b
Return an empty string when a repo has no avatar in the repo API (#31187)
Resolves #31167.

https://github.com/go-gitea/gitea/pull/30885 changed the behavior of
`repo.AvatarLink()` where it can now take the empty string and append it
to the app data URL. This does not point to a valid avatar image URL,
and, as the issue mentions, previous Gitea versions returned the empty
string.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-01 11:49:42 +00:00
wxiaoguang
a4275951ba
Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
Lunny Xiao
352a2cae24
Performance improvements for pull request list API (#30490)
Fix #30483

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-31 12:10:11 +00:00
TheBrokenRail
972f807ee7
Fix URL In Gitea Actions Badge Docs (#31191)
The example URL given in the documentation leads to a 404.

For instance,
`https://your-gitea-instance.com/{owner}/{repo}/actions/workflows/{workflow_file}?branch={branch}&event={event}`
translates to
`https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml`,
which is a 404.

I had to check the [linked GitHub
docs](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge)
to learn that you have to add `/badge.svg` to the URL.

Example:
https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/actions/workflows/build.yml/badge.svg
2024-05-31 19:41:44 +08:00
Jason Song
572fa55fbc
Drop IDOrderDesc for listing Actions task and always order by id DESC (#31150)
Close #31066

Just follow what `FindRunOptions` and `FindScheduleOptions` do.
2024-05-31 02:30:02 +00:00
Lunny Xiao
1137a0357e
Fix branch order (#31174)
Fix #31172

The original order or the default order should not be ignored even if we
have an is_deleted order.
2024-05-31 09:58:41 +08:00
Lunny Xiao
fb7b743bd0
Azure blob storage support (#30995)
This PR implemented object storages(LFS/Packages/Attachments and etc.)
for Azure Blob Storage. It depends on azure official golang SDK and can
support both the azure blob storage cloud service and azurite mock
server.

Replace #25458
Fix #22527 

- [x] CI Tests
- [x] integration test, MSSQL integration tests will now based on
azureblob
  - [x] unit test 
- [x] CLI Migrate Storage
- [x] Documentation for configuration added

------

TODO (other PRs):
- [ ] Improve performance of `blob download`.

---------

Co-authored-by: yp05327 <576951401@qq.com>
2024-05-30 07:33:50 +00:00
Lunny Xiao
015efcd8bf
Use repo as of renderctx's member rather than a repoPath on metas (#29222)
Use a `gitrepo.Repository` in the markup's RenderContext but not store
the repository's path.
2024-05-30 07:04:01 +00:00
wxiaoguang
d612a24e3e
Ignore FindRecentlyPushedNewBranches err (#31164)
Fix #31163
2024-05-30 02:24:22 +00:00
GiteaBot
ce751761ce [skip ci] Updated translations via Crowdin 2024-05-30 00:26:20 +00:00
wxiaoguang
34daee6baf
Fix markup preview (#31158)
Fix #31157

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/4d918cce-cd0d-4601-9c81-4b32df1b0b38)
2024-05-29 16:28:55 +00:00
techknowlogick
31011f5cde
Swap word order in Comment and Close (#31148)
Reduce accident closing of tickets only to re-open them right away. This
aligns the text on these buttons with what GitHub has.

Commit is authored by @LazyDodo, and was committed to the Blender fork
by @brechtvl

Background details:
https://projects.blender.org/infrastructure/gitea-custom/pulls/7

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
2024-05-29 15:54:17 +00:00
Lunny Xiao
5c1b550e00
Fix push multiple branches error with tests (#31151) 2024-05-29 06:43:02 +00:00
silverwind
7034efc7dc
Use vertical layout for multiple code expander buttons (#31122)
Fixes: https://github.com/go-gitea/gitea/issues/31068

- Now it only does a single call to `GetExpandDirection` per line
instead of multiples.
- Exposed `data-expand-direction` to frontend so it can correctly size
the buttons (it's a pain to do in tables).

<img width="142" alt="Screenshot 2024-05-27 at 20 44 56"
src="https://github.com/go-gitea/gitea/assets/115237/8b0b45a6-8e50-4081-8822-5e0775d8d941">
<img width="142" alt="Screenshot 2024-05-27 at 20 44 51"
src="https://github.com/go-gitea/gitea/assets/115237/b7ba2c57-8f55-4e9f-9606-c96d16b77892">
<img width="132" alt="Screenshot 2024-05-27 at 20 44 46"
src="https://github.com/go-gitea/gitea/assets/115237/0e838fb8-5e8c-4250-9843-a68b88d5418b">
<img width="80" alt="Screenshot 2024-05-27 at 20 44 33"
src="https://github.com/go-gitea/gitea/assets/115237/da6c7f83-c160-4389-8ab2-889d0568cbe8">
<img width="80" alt="Screenshot 2024-05-27 at 20 44 26"
src="https://github.com/go-gitea/gitea/assets/115237/cdb490b2-5040-484a-92e5-46fc5e37c199">
<img width="78" alt="Screenshot 2024-05-27 at 20 44 20"
src="https://github.com/go-gitea/gitea/assets/115237/d2978ab0-764e-41ff-922c-25f8fe749f28">

Would backport as trivial enhancement.
2024-05-29 06:08:45 +00:00
Samuel FORESTIER
c93cbc991e
Remove duplicate ProxyPreserveHost in Apache httpd doc (#31143)
---

(fix up for #31003)
2024-05-29 00:35:21 +00:00
GiteaBot
207c0c6c92 [skip ci] Updated translations via Crowdin 2024-05-29 00:26:43 +00:00
Jörg Thalheim
4fe415683e
Add an immutable tarball link to archive download headers for Nix (#31139)
This allows `nix flake metadata` and nix in general to lock a *branch*
tarball link in a manner that causes it to fetch the correct commit even
if the branch is updated with a newer version.

Co-authored-by: Jade Lovelace <software@lfcode.ca>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-05-28 15:30:34 +00:00
silverwind
1e3c4d8fc7
Improve mobile review ui (#31091)
Fixes: https://github.com/go-gitea/gitea/issues/31071

Not perfect but much better than before.

Before: Overflows, sticky not working, filename unreadable:

<img width="506" alt="Screenshot 2024-05-27 at 02 02 40"
src="https://github.com/go-gitea/gitea/assets/115237/a06b1edf-dece-4402-98c2-68670fca265f">

After:
<img width="457" alt="Screenshot 2024-05-27 at 01 59 06"
src="https://github.com/go-gitea/gitea/assets/115237/2a282c96-e719-4554-b418-81963ae6269c">
2024-05-28 13:41:37 +00:00
Lunny Xiao
de4616690f
Add topics for repository API (#31127)
Fix ##31100
2024-05-28 10:03:54 +00:00
Lunny Xiao
b6f15c7948
Add missed return after ctx.ServerError (#31130) 2024-05-28 12:31:59 +03:00
Lunny Xiao
cd7d1314fc
Fix API repository object format missed (#31118)
Fix #31117
2024-05-28 02:43:13 +00:00
silverwind
858d4f221d
Fix DashboardRepoList margin (#31121)
Fixes: https://github.com/go-gitea/gitea/issues/31115

<img width="476" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/ba508ba9-b02d-47c6-ad9f-495101c81330">
2024-05-28 02:13:42 +00:00
silverwind
b6b32a5529
Update JS dependencies (#31120)
- Add `eslint-plugin-no-use-extend-native` to exclude list because it
requires flat config
- Exclude `@github/text-expander-element` because new version has broken
positioning
- Tested mermaid, monaco, swagger, chartjs
2024-05-28 01:50:28 +00:00
GiteaBot
0222f19f19 [skip ci] Updated translations via Crowdin 2024-05-28 00:26:53 +00:00
metiftikci
aa92b13164
Prevent simultaneous editing of comments and issues (#31053)
fixes #22907 

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)
2024-05-27 15:34:18 +00:00
Lunny Xiao
1ed8e6aa5f
Update demo site location from try.gitea.io -> demo.gitea.com (#31054) 2024-05-27 15:05:12 +00:00
Lunny Xiao
89cc501171
Move documents under actions (#31110)
Move secrets and badge under actions
2024-05-27 14:53:48 +00:00
wxiaoguang
8fc2ec1872
Update pip related commands for docker (#31106)
Thanks to graelo and silverwind for figuring out the problem.

Fix #31101
2024-05-27 13:53:33 +00:00
wxiaoguang
20c40259f1
Fix missing memcache import (#31105)
Fix #31102
2024-05-27 13:43:32 +00:00
Rowan Bohde
c0880e7695
feat: add support for a credentials chain for minio access (#31051)
We wanted to be able to use the IAM role provided by the EC2 instance
metadata in order to access S3 via the Minio configuration. To do this,
a new credentials chain is added that will check the following locations
for credentials when an access key is not provided. In priority order,
they are:

1. MINIO_ prefixed environment variables
2. AWS_ prefixed environment variables
3. a minio credentials file
4. an aws credentials file
5. EC2 instance metadata
2024-05-27 20:56:04 +08:00
Lunny Xiao
98751108b1
Rename project board -> column to make the UI less confusing (#30170)
This PR split the `Board` into two parts. One is the struct has been
renamed to `Column` and the second we have a `Template Type`.

But to make it easier to review, this PR will not change the database
schemas, they are just renames. The database schema changes could be in
future PRs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
2024-05-27 08:59:54 +00:00
delvh
072b029b33
Simplify review UI (#31062)
Instead of always displaying all available actions as buttons, merge
them into a single dropdown menu, same as GitHub. That decreases visual
overload and is more mobile-friendly, while not losing any
functionality.

## Screenshots
<details><summary>Before</summary>

![grafik](https://github.com/go-gitea/gitea/assets/51889757/b957fab0-4cc7-4cf5-a6c8-33f571be7b19)
</details> 
<details><summary>After (unexpanded)</summary>


![grafik](https://github.com/go-gitea/gitea/assets/51889757/c8fd3428-4092-4295-bd55-c243409ba90d)
</details>
 
<details><summary>After (expanded)</summary>

![grafik](https://github.com/go-gitea/gitea/assets/51889757/c0eada91-54be-42ce-9db1-0db56d971438)
</details>
2024-05-27 08:24:34 +00:00
silverwind
6e140b58dd
Prevent tab shifting, remove extra margin on fluid pages (#31090)
1. Extend concept of https://github.com/go-gitea/gitea/pull/29831 to all
tabular menus, there were only three left that weren't already
`<overflow-menu>`.

<img width="634" alt="Screenshot 2024-05-27 at 00 42 16"
src="https://github.com/go-gitea/gitea/assets/115237/d9a7e219-d05e-40a1-9e93-777f9a8a90dd">
<img width="965" alt="Screenshot 2024-05-27 at 00 29 32"
src="https://github.com/go-gitea/gitea/assets/115237/e6ed71b1-11fb-4a74-9adb-af4524286cff">

2. Remove extra padding on `fluid padded` container like for example PR
diff view. The page margin is already correctly sized via
`.ui.container`, so this was just extraneous padding that looked ugly.

Before:
<img width="1351" alt="Screenshot 2024-05-27 at 00 45 11"
src="https://github.com/go-gitea/gitea/assets/115237/4b45fd11-b1b2-4fbb-a618-26eb22be9472">

After:
<img width="1344" alt="Screenshot 2024-05-27 at 00 45 22"
src="https://github.com/go-gitea/gitea/assets/115237/d09593eb-6c7f-45e7-85b6-f0050047004b">

3. Replace `gt-word-break` with `tw-break-anywhere` in issue-title,
fixing overflow.

Before:
<img width="1333" alt="Screenshot 2024-05-27 at 00 50 14"
src="https://github.com/go-gitea/gitea/assets/115237/64d15d04-b456-401e-a972-df636965f0eb">

After:
<img width="1316" alt="Screenshot 2024-05-27 at 00 50 26"
src="https://github.com/go-gitea/gitea/assets/115237/ed1ce830-1408-414b-8263-eeaf773f52c8">
2024-05-27 06:45:16 +00:00
Zettat123
31a0c4dfb4
Improve the handling of jobs.<job_id>.if (#31070)
Fix #25897
Fix #30322

#29464 cannot handle some complex `if` conditions correctly because it
only checks `always()` literally. In fact, it's not easy to evaluate the
`if` condition on the Gitea side because evaluating it requires a series
of contexts. But act_runner is able to evaluate the `if` condition
before running the job (for more information, see
[`gitea/act`](517d11c671/pkg/runner/run_context.go (L739-L753)))
. So we can use act_runner to check the `if` condition.

In this PR, how to handle a blocked job depends on its `needs` and `if`:
- If not all jobs in `needs` completed successfully and the job's `if`
is empty, set the job status to `StatusSkipped`
- In other cases, the job status will be set to `StatusWaiting`, and
then act_runner will check the `if` condition and run the job if the
condition is met
2024-05-27 14:15:34 +08:00