Commit Graph

4786 Commits (d1a755e5b7c676750f3dfad2254e047e2d23c4ac)

Author SHA1 Message Date
Kai Leonhardt b5d2e31d6d
Drop timeout for requests made to the internal hook api ()
This change targets https://github.com/go-gitea/gitea/issues/32663
We drop the hardcoded timeout of 60 seconds for requests to the internal
hook api. With this change the timeout is completly removed.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
charles b956cee06f
Fix file name could not be searched if the file was not a text file when using the Bleve indexer ()
Close 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Andreas Svanberg 0da7318cf3
Allow filtering issues by any assignee ()
This is the opposite of the "No assignee" filter, it will match all
issues that have at least one assignee.

Before
![Before
change](https://github.com/user-attachments/assets/4aea194b-9add-4a84-8d6b-61bfd8d9e58e)

After
![After change with any
filter](https://github.com/user-attachments/assets/99f1205d-ba9f-4a0a-a60b-cc1a0c0823fe)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Lunny Xiao a9e8ac0fe0
Don't create duplicated functions for code repositories and wiki repositories ()
Fix
https://github.com/go-gitea/gitea/pull/33910#pullrequestreview-2688913865

This PR changed the Repositroy interface in `gitrepo` package which
makes it only focus the relative path in the disk and abstract whether
it's a wiki repository or not.
John Smith 8f051d598c
Added Description Field for Secrets and Variables ()
Fixes 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 9d7c02f9f7
Try to figure out attribute checker problem ()
For 
Lunny Xiao 7fd44a85ca
Move hooks function to gitrepo and reduce expose repopath ()
Extract from  
Follow 
Lunny Xiao c88e71c1d2
Refactor functions to reduce repopath expose ()
Lunny Xiao 0056fdb942
Move git references checking to gitrepo packages to reduce expose of repository path ()
Kerwin Bryant 92f997ce6b
Add file tree to file view page ()
Resolve 

This pull request introduces a file tree on the left side when reviewing
files of a repository.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Lunny Xiao 55cc649d3d
Add abstraction layer to delete repository from disk ()
Extract from  
Follow 
wxiaoguang a0e0a30d23
Make SearchMode have default value and add comments ()
* Make `SearchMode` have default value if it is empty
* Add some comments for the "match" queries
* Fix a copy-paste mistake in `buildMatchQuery` (`db.go`)
* Add missing `q.Analyzer = repoIndexerAnalyzer`, it is in old code,
although I do not see real difference ....
wxiaoguang 0dfa94edc8
Add old svg class name to git entry icon ()
Fix https://github.com/go-gitea/gitea/pull/33837#discussion_r1995521288
Lunny Xiao 9c673d066c
Add abstraction layer to check if the repository exists on disk ()
Extract from  

This PR uses `gitrepo.IsRepositoryExist` instead of `util.IsExist` to
detect whether the repository exist in disk. This will move `RepoPath`
detail behind of package `gitrepo` to make it easier to do possible
changes where storing the repositories.

No code change
TheFox0x7 5d65b9060b
remove context from retry downloader ()
follow up to https://github.com/go-gitea/gitea/pull/33399 as I
apparently missed this one.
wxiaoguang 8a0f7f0975
Fix markdown render ()
Fix , some code block is moved to make it easier to test.

Added a new test
wxiaoguang 403775e74e
Improve issue & code search ()
Each "indexer" should provide the "search modes" they support by
themselves. And we need to remove the "fuzzy" search for code.
wxiaoguang 3996518ed4
Refactor cache-control ()
And fix 
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 
wxiaoguang f61f30153b
Fix file icon mapping ()
Use the file extension mapping from VSCode's extensions.
Otherwise js/ts/vba/... files won't get correct icons.
wxiaoguang 657239b480
Fix material icon & diff highlight ()
wxiaoguang c102492e5a
Fix LFS URL ()
Fix 
wxiaoguang 34e5df6d30
Add material icons for file list ()
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 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 
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.
wxiaoguang 216243eee2
Refactor error system ()
It should not expose `util.SilentWrap` or construct it manually.
wxiaoguang 27bf63ad20
Refactor global init code and add more comments ()
Follow up 

Now there are 3 "global" functions:

* registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown`
* registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"`
* registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"`


And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and
`attachDirAuto`, use `data-global-init` to replace fragile
`.js-autofocus-end` selector.

Another benefit is that by the new approach, no matter how many times
`registerGlobalInitFunc` is called, we only need to do one
"querySelectorAll" in the last step, it could slightly improve the
performance.
wxiaoguang f991807f7e
Try to fix ACME path when renew ()
Try to fix 
wxiaoguang 3ee5ee2029
Upgrade golangci-lint to v1.64.5 ()
Use `usetesting` instead of deprecated `tenv`.
1. Follow up 
2. Make lint pass and add some comments
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>
wxiaoguang c2e23d3301
Fix PR web route permission check ()
See the FIXME comment in code. Otherwise, if a repo's issue unit is
disabled, then the PRs can't be edited anymore.

By the way, make the permission log output look slightly better.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: metiftikci <metiftikci@hotmail.com>
wxiaoguang 15e020eec8
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>
Darren Hoo 950abfe8ee
enable literal string for code search ()
Close: 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
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>
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 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>
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.
Alexander McRae a1f1bccd7a
Add go wrapper around git diff-tree --raw -r -M ()
* Implemented calling git diff-tree
 * Ensures wrapper function is called with valid arguments
 * Parses output into go struct, using strong typing when possible
Lunny Xiao 6999651b6d
Fix unnecessary comment when moving issue on the same project column ()
Fix 
wxiaoguang 5dddcc1773
chore: fix some trivial problems and TODOs ()
1. Fix incorrect `MentionCount` (actually it seems to be deadcode,
affects nothing)
2. Remove fallback sha1 support for time limit token
3. Use route middleware `reqRepoActionsWriter` for `ArtifactsDeleteView`
4. Use clearer message "Failed to authenticate user" instead of "Verify"
when auth fails
5. `tests/integration/benchmarks_test.go` is not quite right, actually
it is never used, so delete it.
6. Remove or update TODO comments
K Kovacs 34692a20b1
Worktime tracking for the organization level ()
Dear Gitea team,

first of all, thanks for the great work you're doing with this project.

I'm planning to introduce Gitea at a client site, and noticed that while
there is time recording, there are no project-manager-friendly reports
to actually make use of that data, as were also mentioned by others in
  and .

Since I had a little time last weekend, I had put together something
that I hope to be a useful contribution to this great project (while of
course useful for me too).

This PR adds a new "Worktime" tab to the Organisation level. There is a
date range selector (by default set to the current month), and there are
three possible views:

- by repository,
- by milestone, and
- by team member.

Happy to receive any feedback!

There are several possible future improvements of course (predefined
date ranges, charts, a member time sheet, matrix of repos/members, etc)
but I hope that even in this relatively simple state this would be
useful to lots of people.

<img width="1161" alt="Screen Shot 2022-05-25 at 22 12 58"
src="https://user-images.githubusercontent.com/118010/170366976-af00c7af-c4f3-4117-86d7-00356d6797a5.png">

Keep up the good work!

Kristof

---------

Co-authored-by: user <user@kk-git1>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Bruno Sofiato 040c830dec
Inclusion of rename organization api ()
This adds an endpoint (`/orgs/{org}/rename`) to rename organizations.

I've modeled the endpoint using the rename user endpoint --
`/admin/users/{username}/rename` -- as base.

It is the 1st time I wrote a new API endpoint (I've tried to follow the
rename users endpoint code while writing it). So feel free to ping me if
there is something wrong or missing.

Resolves 

---------

Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 0e8738b4b6
Fix SSH LFS memory usage ()
Fix