Commit Graph

1586 Commits (91610a987e4c805a9305d4ee951963f80dbeb9ee)

Author SHA1 Message Date
ChristopherHX 651ef66966
Add workflow_job webhook ()
Provide external Integration information about the Queue lossly based on
https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job

Naming conflicts between GitHub & Gitea are here, Blocked => Waiting,
Waiting => Queued

Rationale Enhancement for ephemeral runners management 
ChristopherHX a92d5f65ce
Fix auto concurrency cancellation skips commit status updates ()
* add missing commit status
* conflicts with concurrency support

Closes 

Co-authored-by: Giteabot <teabot@gitea.io>
wxiaoguang 657239b480
Fix material icon & diff highlight ()
Lunny Xiao ae63568ce3
Move notifywatch to service layer ()
No logic change.
wxiaoguang 7290bfaccb
Only keep popular licenses ()
Fix 
Dustin Firebaugh 3f1f808b9e
Full-file syntax highlighting for diff pages ()
Fix , fix 

This adds a step in the `GitDiffForRender` that does syntax highlighting for the
entire file and then only references lines from that syntax highlighted
code. This allows things like multi-line comments to be syntax
highlighted correctly.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 6f13331754
Improve theme display ()
Document: https://gitea.com/gitea/docs/pulls/180

![image](https://github.com/go-gitea/gitea/assets/2114189/68e38573-b911-45d9-b7aa-40d96d836ecb)
TheFox0x7 4c4c56c7cd
Decouple context from repository related structs ()
Calls that required context implicitly are made to pass it as argument
wxiaoguang 4ed71eb754
Improve log format ()
wxiaoguang 6422f05a4e
Decouple diff stats query from actual diffing ()
The diff stats are no longer part of the diff generation.
Use `GetDiffShortStat` instead to get the total number of changed files,
added lines, and deleted lines.
As such, `gitdiff.GetDiff` can be simplified:
It should not do more than expected.

And do not run "git diff --shortstat" for pull list. Fix 
Lunny Xiao 1b2dffff8e
Add global lock for migrations to make upgrade more safe with multiple replications ()
TheFox0x7 e7cf62f2f7
remove context from mail struct ()
it can be passed by argument instead
Lunny Xiao 0453177b61
Refactor: move part of updating protected branch logic to service layer ()
sommerf-lf 7cdde20c73
Email option to embed images as base64 instead of link ()
ref: 
ref: 

Documentation: https://gitea.com/gitea/docs/pulls/69

# Example
Content:

![image](https://github.com/user-attachments/assets/e73ebfbe-e329-40f6-9c4a-f73832bbb181)
Result in Email:

![image](https://github.com/user-attachments/assets/55b7019f-e17a-46c3-a374-3b4769d5c2d6)
Result with source code:
(first image is external image, 2nd is now embedded)

![image](https://github.com/user-attachments/assets/8e2804a1-580f-4a69-adcb-cc5d16f7da81)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
TheFox0x7 ae3a18e01a
Remove context from git struct ()
Argument is moved from struct init in command run, which lets us remove
context from struct.
Denys Konovalov ffb276578f
Adjust appearence of commit status webhook ()
Some visual improvement for the commit status webhook message introduced
by 

- use short commit SHA as already done in e. g. commit webhook
- fix spacing, link text
- do not set user link for internal gitea-actions user

Before: 

![grafik](https://github.com/user-attachments/assets/9c460846-c350-444c-89b5-8a0d5e26cb86)

After:

![grafik](https://github.com/user-attachments/assets/05519cd8-6d8f-432b-bd9d-082de558a55a)
wxiaoguang 216243eee2
Refactor error system ()
It should not expose `util.SilentWrap` or construct it manually.
Lunny Xiao dbed39d632
Add migrations and doctor fixes ()
Fix 
wxiaoguang 02657e85a4
Refactor mail code ()
`mail.go` contains various different functions, it's time to split it.
Lunny Xiao 5cbdf83f70
Use pullrequestlist instead of []*pullrequest ()
Just renames no code changed.
ChristopherHX b684f51d20
Webhook add X-Gitea-Hook-Installation-Target-Type Header ()
This is a X-GitHub Header port

* repository for repository webhooks (matches GitHub)
* organization for organization webhooks (matches GitHub)
* user for user webhooks (Gitea specific)
* system for system webhooks  (Gitea specific)
* default for default hooks needs testing (Gitea specific)

- `X-Gitea-Hook-Installation-Target-Type`
- `X-GitHub-Hook-Installation-Target-Type`
Lunny Xiao aca21549f2
Add composor source field ()
Fix 
Guillaume 303af554c9
Improve "generate new access token" form ()
Fix: https://github.com/go-gitea/gitea/issues/33519

As discussed in [PR
](https://github.com/go-gitea/gitea/pull/33614), the
ScopedAccessTokenSelector Vue component is not particularly useful.

This PR removes the component and reverts to using HTML templates. It
also introduces some (hopefully) useful refactoring.

The Vue component was causing the UX bug reported in the linked issue.
Required form fields are now properly working, as expected (see
screenshot).

![Screenshot from 2025-02-25
22-00-28](https://github.com/user-attachments/assets/41167854-0718-48b0-a3ee-75ca3a7b8b20)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 56a0a9c750
Fix git empty check and HEAD request ()
Lunny Xiao f2fbb897f3
Deleting repository should unlink all related packages ()
Fix 

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
TheFox0x7 cc1fdc84ca
Use test context in tests and new loop system in benchmarks ()
Replace all contexts in tests with go1.24 t.Context()

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
ericLemanissier 40faa6dc78
git graph: don't show detached commits ()
Current git graph is not usable for mirrors of repos having a lot of
PRs, as can be seen at
https://demo.gitea.com/ericLemanissier/conan-center-index/graph

![image](https://github.com/user-attachments/assets/ace40dd2-3eea-4d69-8e19-10fb7224e326)


Manually running `git log --graph --date-order --all` on such a repo
indeed shows:
```
*   commit c4a34bd39d7977c8630177c5f88507000ea3e943
|\  Merge: a4bbd3ad6b 35a102c77c
| | Author: toge <toge.mail@gmail.com>
| | Date:   Wed Feb 19 08:36:41 2025 +0000
| |
| |     Merge 35a102c77cbc38d84baca0ca63466fb410336ea8 into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| |
| * commit 35a102c77cbc38d84baca0ca63466fb410336ea8
| | Author: toge <toge.mail@gmail.com>
| | Date:   Wed Feb 19 17:36:35 2025 +0900
| |
| |     update 4.4.2
| |
| | * commit 5d610f4fd3c0428731e402a2f618fad9ce055875
| |/| Merge: a4bbd3ad6b fe916fb70a
|/| | Author: Antony Peacock <ant.peacock@gmail.com>
| | | Date:   Wed Feb 19 08:31:30 2025 +0000
| | |
| | |     Merge fe916fb70a8bf49503cce70a5c7124bcc4314ddc into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| | |
| | * commit fe916fb70a8bf49503cce70a5c7124bcc4314ddc
| | | Author: Antony Peacock <ant.peacock@gmail.com>
| | | Date:   Wed Feb 19 08:31:18 2025 +0000
| | |
| | |     Remove parquet cmakelist patch
| | |
| | | * commit 9f6d2759d650ec3c86d01bb940e829e7e14220c2
| |_|/| Merge: a4bbd3ad6b f0963429b0
|/| | | Author: Thomas Sedlmair <thomas.sedlmair@googlemail.com>
| | | | Date:   Wed Feb 19 08:03:08 2025 +0100
| | | |
| | | |     Merge f0963429b0952499da0da7e559f8d53387097307 into a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98
| | | |
| | | * commit f0963429b0952499da0da7e559f8d53387097307
| |_|/  Author: Thomas Sedlmair <thomas.sedlmair@googlemail.com>
|/| |   Date:   Wed Feb 19 08:01:43 2025 +0100
| | |
| | |       added cwt-cucumber 2.5
| | |
```

On the other hand, running `git log --graph --date-order --branches
--tags` returns the expected:
```
* commit a4bbd3ad6bb5a0f8e5117a897d8c55941f533d98 (HEAD -> master)
| Author: Dan <mstr.danila@gmail.com>
| Date:   Fri Feb 14 18:46:11 2025 +0200
|
|     grpc: add version 1.69.0 ()
|
|     * grpc: add version 1.69.0
|
|     * add cmake tool requires
|
|     ---------
|
|     Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
|
* commit a7868807cb2e21206ebf95278cb588f29a3e2205
| Author: Guillaume Egles <gegles@users.noreply.github.com>
| Date:   Thu Feb 13 05:44:35 2025 -0800
|
|     openssl: add versions `3.0.16`, `3.1.8`, `3.2.4`, `3.3.3`, `3.4.1`, stop publishing revisions for version `3.0.15` ()
|
* commit 86057d3e63ac71e2fe48c07bb301f2d54187044d
| Author: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
| Date:   Thu Feb 13 13:34:41 2025 +0000
|
|     android-ndk: dont set LD and AS variables ()
|
|     * android-ndk: dont set LD and AS variables
|
|     * android-ndk: refactor test package
|
* commit 123e382fafd2f5e811e10faac02efc275c45ec2a
| Author: Nikita <root.kidik@gmail.com>
| Date:   Thu Feb 13 12:29:39 2025 +0300
|
|     libffi: fix conditionals when building on Windows ()
|
|     * fix: add missing or `clang`
|
|     * fix: libffi - always require as tool `automake`
```
Lunny Xiao 9f560d47c9
Make actions URL in commit status webhooks absolute ()
Gitea Actions generated target url doesn't contain host and port. So we
need to include them for external webhook visiting.

Fix 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 15e020eec8
Refactor error system ()
Lunny Xiao 7df09e31fa
Move issue pin to an standalone table for querying performance ()
Noticed a SQL in gitea.com has a bigger load. It seems both `is_pull`
and `pin_order` are not indexed columns in the database.

```SQL
SELECT `id`, `repo_id`, `index`, `poster_id`, `original_author`, `original_author_id`, `name`, `content`, `content_version`, `milestone_id`, `priority`, `is_closed`, `is_pull`, `num_comments`, `ref`, `pin_order`, `deadline_unix`, `created_unix`, `updated_unix`, `closed_unix`, `is_locked`, `time_estimate` FROM `issue` WHERE (repo_id =?) AND (is_pull = 0) AND (pin_order > 0) ORDER BY pin_order
```

I came across a comment
https://github.com/go-gitea/gitea/pull/24406#issuecomment-1527747296
from @delvh , which presents a more reasonable approach. Based on this,
this PR will migrate all issue and pull request pin data from the
`issue` table to the `issue_pin` table. This change benefits larger
Gitea instances by improving scalability and performance.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang f35850f48e
Refactor error system ()
Lunny Xiao 69de5a65c2
Fix project issues list and counting ()
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Lunny Xiao 5df9fd3e9c
Add API to support link package to repository and unlink it ()
Fix 

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Lunny Xiao 58c124cc4f
Move commits signature and verify functions to service layers ()
No logic change, just move functions.
ChristopherHX 2b8cfb557d
Artifacts download api for artifact actions v4 ()
* download endpoint has to use 302 redirect
* fake blob download used if direct download not possible
* downloading v3 artifacts not possible

New repo apis based on GitHub Rest V3
- GET /runs/{run}/artifacts (Cannot use run index of url due to not
being unique)
- GET /artifacts
- GET + DELETE /artifacts/{artifact_id}
- GET /artifacts/{artifact_id}/zip
- (GET /artifacts/{artifact_id}/zip/raw this is a workaround for a http
302 assertion in actions/toolkit)
- api docs removed this is protected by a signed url like the internal
artifacts api and no longer usable with any token or swagger
  - returns http 401 if the signature is invalid
    - or change the artifact id
    - or expired after 1 hour

Closes 
Closes 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
ericLemanissier 57997f1518
Fix mirror bug ()
follows-up be4e961240

Fix https://github.com/go-gitea/gitea/issues/33200

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Zettat123 8aede14b1d
Use default Git timeout when checking repo health ()
Lunny Xiao f232d8f530
Performance optimization for pull request files loading comments attachments ()
Exploding Dragon fba365b425
Only show the latest version in the Arch index ()
Only show the latest version of the package in the arch repo.

closes 

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang e741448a14
Fix various problems (artifact order, api empty slice, assignee check, fuzzy prompt, mirror proxy, adopt git) ()
* Make artifact list output a stable order
* Fix 
* Fix 
* Fix 
* Fix 
* Fix 
wxiaoguang f58f5bb3d8
Avoid duplicate SetContextValue call ()
And fix FIXME and TODO
Zettat123 06f1065636
Add a transaction to `pickTask` ()
In the old `pickTask`, when getting secrets or variables failed, the
task could get stuck in the `running` status (task status is `running`
but the runner did not fetch the task). To fix this issue, these steps
should be in one transaction.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 245ac321c3
Fix context usage ()
Some old code use direct type-casting to get context, it causes
problems.

This PR fixes all legacy problems and use correct `ctx.Value` to get
low-level contexts.

Fix 
Jason Song c422f179dd
Enhance routers for the Actions variable operations ()
- Find the variable before updating or deleting
- Move the main logic from `routers/web/repo/setting/variables.go` to
`routers/web/shared/actions/variables.go`.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
wxiaoguang 30993e9508
Feature: Support workflow event dispatch via API ()
Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open )

---------

Co-authored-by: Bence Santha <git@santha.eu>
Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Lunny Xiao 72518a8dab
Rework suggestion backend ()
Fix  

The suggestion backend logic now is

- If the keyword is empty, returned the latest 5 issues/prs with index
desc order
- If the keyword is digital, find all issues/prs which `index` has a
prefix with that, with index asc order
- If the keyword is non-digital or if the queried records less than 5,
searching issues/prs title with a `like`, with index desc order

## Empty keyword
<img width="310" alt="image"
src="https://github.com/user-attachments/assets/1912c634-0d98-4eeb-8542-d54240901f77"
/>

## Digital
<img width="479" alt="image"
src="https://github.com/user-attachments/assets/0356a936-7110-4a24-b21e-7400201bf9b8"
/>

## Digital and title contains the digital
<img width="363" alt="image"
src="https://github.com/user-attachments/assets/6e12f908-28fe-48de-8ccc-09cbeab024d4"
/>

## non-Digital
<img width="435" alt="image"
src="https://github.com/user-attachments/assets/2722bb53-baa2-4d67-a224-522a65f73856"
/>
<img width="477" alt="image"
src="https://github.com/user-attachments/assets/06708dd9-80d1-4a88-b32b-d29072dd1ba6"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 704b65e012
Revert "Feature: Support workflow event dispatch via API ()" ()
This reverts commit 523751dc82.
Bence Sántha 523751dc82
Feature: Support workflow event dispatch via API ()
ref: https://github.com/go-gitea/gitea/issues/31765

---------

Signed-off-by: Bence Santha <git@santha.eu>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
TheFox0x7 1ec8d80fa3
refactor: decouple context from migration structs ()
Use context as much as possible.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Lunny Xiao 466cc725bc
Move gitgraph from modules to services layer ()
Just move, no code change.