Giteabot
76e892317b
Fix issue will be detected as pull request when checking `First-time contributor` ( #28237 ) ( #28271 )
...
Backport #28237 by @yp05327
Fix #28224
Co-authored-by: yp05327 <576951401@qq.com>
1 year ago
Lunny Xiao
bc3d8bff73
Fix comment permissions ( #28213 ) ( #28216 )
...
backport #28213
This PR will fix some missed checks for private repositories' data on
web routes and API routes.
1 year ago
Giteabot
a2314ca9c5
Revert "Fix EOL handling in web editor" ( #28101 ) ( #28172 )
...
Backport #28101 by @lng2020
Reverts go-gitea/gitea#27141
close #28097
Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
1 year ago
Giteabot
124a9957d0
Fix viewing wiki commit on empty repo ( #28040 ) ( #28044 )
...
Backport #28040 by @JakobDev
Fixes https://codeberg.org/forgejo/forgejo/issues/1758
For some weird reason we need to cast this nil.
Co-authored-by: JakobDev <jakobdev@gmx.de>
1 year ago
Giteabot
824d40edc6
Fix citation error when the file size is larger than 1024 bytes ( #27958 ) ( #27965 )
...
Backport #27958 by @yp05327
Mentioned in:
https://github.com/go-gitea/gitea/pull/27931#issuecomment-1798016960
Same to #25131 , so use the same method to fix this problem.
Co-authored-by: yp05327 <576951401@qq.com>
1 year ago
Giteabot
9ca1853495
Fix http protocol auth ( #27875 ) ( #27876 )
...
Backport #27875 by @lunny
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 year ago
Giteabot
5087de1a5c
Fix `link-action` redirect network error ( #27734 ) ( #27749 )
...
Backport #27734 by @lng2020
<img width="823" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/99da3d5a-c28a-4fd0-8ae0-88461a9142e2 ">
Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
1 year ago
Giteabot
7ec7c733c7
Replace ajax with fetch, improve image diff ( #27267 ) ( #27583 )
...
Backport #27267 by @silverwind
1. Dropzone attachment removal, pretty simple replacement
2. Image diff: The previous code fetched every image twice, once via
`img[src]` and once via `$.ajax`. Now it's only fetched once and a
second time only when necessary. The image diff code was partially
rewritten.
Co-authored-by: silverwind <me@silverwind.io>
1 year ago
Giteabot
a9d547f55b
When comparing with an non-exist repository, return 404 but 500 ( #27437 ) ( #27442 )
...
Backport #27437 by @lunny
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 year ago
Giteabot
28d970e4a6
Hide archived labels when filtering by labels on the issue list ( #27115 ) ( #27381 )
...
Backport #27115 by @puni9869
Followup https://github.com/go-gitea/gitea/pull/26820
## Archived labels UI for issue filter and issue filter actions for
issues/pull request pages.
Changed:
* Enhanced the Issue filter and Issue filter actions UI page to
seamlessly incorporate a list of archived labels.
* Pagination functionality is same as before. If archived label checkbox
is checked then we are adding a query string`archived=true` in the url
to save the state of page.
* Issue filter actions menu is separated into different template.
* Adding the archived flag in issue url labels.
* Pull Request page is also work the same.
Outsourced:
* Defer the implementation of specialized handling for archived labels
to upcoming pull requests. This step will be undertaken subsequent to
the successful merge of this pull request.
Screenshots
### Issue page
<img width="1360" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/d7efb2ef-5b2b-449d-83f0-d430a32ec432 ">
### Issue page with label filter on archived label checkbox when not
checked --> No archived label is there in list
<img width="1249" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/ceea68ef-91f2-4693-910f-2e25e236bfc9 ">
### Issue page with label filter on archived label checkbox when checked
--> Show archived label in the list.
<img width="710" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/2414d26b-2079-4c3c-bd9e-f2f5411bcabf ">
### Issue page with label filter on issue action menu on archived label
checkbox when checked --> Show archived label in the list.
<img width="409" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/259cac87-3e21-4778-99a2-a6a0b8c81178 ">
### Applied the archived=true in Issue labels when archived checkbox is
checked.
<img width="984" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/657ce3db-c0ae-402e-b12d-3b580d3c2ed0 ">
---
Part of https://github.com/go-gitea/gitea/issues/25237
Signed-off-by: puni9869 <punitinani1@hotmail.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
Co-authored-by: delvh <dev.lh@web.de>
1 year ago
Giteabot
0c4f97c112
Fix repo count in org action settings ( #27245 ) ( #27353 )
...
Backport #27245 by @yp05327
Only in org action settings, repo count is missing
Before:



In other setting page:

After:



Co-authored-by: yp05327 <576951401@qq.com>
1 year ago
Giteabot
f13a294b47
More `db.DefaultContext` refactor ( #27265 ) ( #27347 )
...
Backport #27265 by @JakobDev
Part of #27065
This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
Co-authored-by: JakobDev <jakobdev@gmx.de>
1 year ago
Giteabot
84ee02faa7
Improve tree not found page ( #26570 ) ( #27346 )
...
Backport #26570 by @yp05327
Before:

After:

In Github:
https://github.com/yp05327/test/blob/main/test.drawio
Updated:
UI changed


Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 year ago
Giteabot
71d1bfea7f
Improve issue history dialog and make poster can delete their own history ( #27323 ) ( #27327 )
...
Backport #27323 by @wxiaoguang
Fix #27313 (see the comment)
And some UI improvements:
### Before


### After



Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
Giteabot
fc7d3f7315
Another round of `db.DefaultContext` refactor ( #27103 ) ( #27262 )
...
Backport #27103 by @JakobDev
Part of #27065
Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
1 year ago
Giteabot
a1029cb2ca
Fix EOL handling in web editor ( #27141 ) ( #27234 )
...
Backport #27141 by @silverwind
Fixes https://github.com/go-gitea/gitea/issues/27136 .
This does the following for Monaco's EOL setting:
1. Use editorconfig setting if present
2. Use the file's dominant line ending as detected by monaco, which uses
LF for empty file
Co-authored-by: silverwind <me@silverwind.io>
1 year ago
Lunny Xiao
47b878858a
Search branches ( #27055 )
...
Resolve #25233
<img width="1315" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/3ba59b58-471a-4e1b-985c-87edac2268c0 ">
<img width="1297" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/b6caa12f-323b-4f70-9c44-ef91cb71a26c ">
1 year ago
KN4CK3R
ed64f1c2b8
Support `.git-blame-ignore-revs` file ( #26395 )
...
Closes #26329
This PR adds the ability to ignore revisions specified in the
`.git-blame-ignore-revs` file in the root of the repository.

The banner is displayed in this case. I intentionally did not add a UI
way to bypass the ignore file (same behaviour as Github) but you can add
`?bypass-blame-ignore=true` to the url manually.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
KN4CK3R
c766140dad
Add `RemoteAddress` to mirrors ( #26952 )
...
This PR adds a new field `RemoteAddress` to both mirror types which
contains the sanitized remote address for easier (database) access to
that information. Will be used in the audit PR if merged.
1 year ago
JakobDev
f91dbbba98
Next round of `db.DefaultContext` refactor ( #27089 )
...
Part of #27065
1 year ago
JakobDev
c548dde205
More refactoring of `db.DefaultContext` ( #27083 )
...
Next step of #27065
1 year ago
JakobDev
76659b1114
Reduce usage of `db.DefaultContext` ( #27073 )
...
Part of #27065
This reduces the usage of `db.DefaultContext`. I think I've got enough
files for the first PR. When this is merged, I will continue working on
this.
Considering how many files this PR affect, I hope it won't take to long
to merge, so I don't end up in the merge conflict hell.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
JakobDev
8d0343e028
Fix issue templates when blank isses are disabled ( #27061 )
...
Fixes #27060
---------
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
1 year ago
Nanguan Lin
cda97a7253
Update status and code index after changing the default branch ( #27018 )
...
Fix #26723
Add `ChangeDefaultBranch` to the `notifier` interface and implement it
in `indexerNotifier`. So when changing the default branch,
`indexerNotifier` sends a message to the `indexer queue` to update the
index.
---------
Co-authored-by: techknowlogick <matti@mdranta.net>
1 year ago
Lunny Xiao
e3ed67859a
Move some functions to service layer ( #26969 )
1 year ago
Lunny Xiao
4f32abaf94
move repository deletion to service layer ( #26948 )
...
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
Lunny Xiao
f20e317d6d
Improve hint when uploading a too large avatar ( #26935 )
...
Fix #26390
---------
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
1 year ago
CaiCandong
a78c2eae24
Replace `util.SliceXxx` with `slices.Xxx` ( #26958 )
1 year ago
Lunny Xiao
b9df9fa2e2
Move createrepository from module to service layer ( #26927 )
...
Repository creation depends on many models, so moving it to service
layer is better.
1 year ago
merlleu
a7d9a70552
allow "latest" to be used in release vTag when downloading file ( #26748 )
...
Hello,
In the discord I saw
[someone](https://discord.com/channels/322538954119184384/1069795723178160168/1145061200644800514 )
complaining that you can't use the "latest" keyword as release tag to
download a specific file:
In his example:
https://www.uberwald.me/gitea/public/fvtt-ecryme/releases/latest/system.json
However the latest keyword works for the release page, so I think it's a
good thing to implement this on the release attachment download url too.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
FuXiaoHei
460a2b0edf
Artifacts retention and auto clean up ( #26131 )
...
Currently, Artifact does not have an expiration and automatic cleanup
mechanism, and this feature needs to be added. It contains the following
key points:
- [x] add global artifact retention days option in config file. Default
value is 90 days.
- [x] add cron task to clean up expired artifacts. It should run once a
day.
- [x] support custom retention period from `retention-days: 5` in
`upload-artifact@v3`.
- [x] artifacts link in actions view should be non-clickable text when
expired.
1 year ago
yp05327
0850be6750
Fix the display of org level badges ( #26504 )
...
Follow #24654 #22705 #24232
In some pages we still have missing badges, for example:



1 year ago
Lunny Xiao
540bf9fa6d
Move notification interface to services layer ( #26915 )
...
Extract from #22266
1 year ago
wxiaoguang
e8aae43f56
Move web/api context related testing function into a separate package ( #26859 )
...
Just like `models/unittest`, the testing helper functions should be in a
separate package: `contexttest`
And complete the TODO:
> // TODO: move this function to other packages, because it depends on
"models" package
1 year ago
JakobDev
3cae50e841
Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled ( #26813 )
...
You can currently visit `{repo}/issues/new` and create a blank issue,
even if it's disabled. This PR fixes this,
Fixes https://codeberg.org/forgejo/forgejo/issues/1356
Co-authored-by: Giteabot <teabot@gitea.io>
1 year ago
CaiCandong
c576b50441
Fix being unable to use a repo that prohibits accepting PRs as a PR source. ( #26785 )
...
## Description
Sometimes, we need to use an upstream mirror repository to update the
current development repository, but mirror repositories are prohibited
from PR. It should not appear in `merge to,` but it can appear in `pull
from.`
Fix #24585 #26193 #26781
Related #24183
Many thanks to @apnote for assisting me in reproducing this bug!
## ScreenShot
---
### Before
<img
src="https://github.com/go-gitea/gitea/assets/50507092/3d76c376-1f54-45b9-80c9-6ba8319d6a9a "
width="400px">
<img
src="https://github.com/go-gitea/gitea/assets/50507092/fbfd9f7f-421f-4a2e-9a3e-f2958bbf3312 "
width="400px">
### After
<img
src="https://github.com/go-gitea/gitea/assets/50507092/e6984524-4f61-4310-b795-4d8598bd8963 "
width="400px">
<img
src="https://github.com/go-gitea/gitea/assets/50507092/04065b44-78d7-4721-bf31-0f1674150727 "
width="400px">
2 years ago
Lunny Xiao
476b9d1589
Use docs.gitea.com instead of docs.gitea.io ( #26739 )
2 years ago
Chongyi Zheng
43652746f2
Move `modules/mirror` to `services` ( #26737 )
...
To solve the cyclic imports in a better way
Closes #20261
2 years ago
wxiaoguang
412e5c0946
Make web context initialize correctly for different cases ( #26726 )
...
The web context (modules/context.Context) is quite complex, it's
difficult for the callers to initialize correctly.
This PR introduces a `NewWebContext` function, to make sure the web
context have the same behavior for different cases.
2 years ago
yp05327
d2e4039def
Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips ( #26658 )
...
GitHub like role descriptor



---------
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
yp05327
7e30986667
Remove ref name in PR commits page ( #25876 )
...
The branch name display here is based on the repo's default branch which
is not correct.

For example, if I changed the default branch, the branch name here will
also be changed:


you can confirm this in :
https://try.gitea.io/yp05327/testrepo/pulls/1/commits
I think we do not need to display branch name here, as we already have
the branch info above.

2 years ago
wxiaoguang
e8b990999f
Make "link-action" backend code respond correct JSON content ( #26680 )
...
Otherwise the `link-action` JS code couldn't parse the response.
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
yp05327
a4a567f29f
Check disabled workflow when rerun jobs ( #26535 )
...
In GitHub, we can not rerun jobs if the workflow is disabled.
---------
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
yp05327
f6e7798405
Add link to job details and tooltip to commit status in repo list in dashboard ( #26326 )
...
Tooltip:

Link to the target job:

2 years ago
a1012112796
f00fdd1abd
fix reopen logic for agit flow pull request ( #26399 )
...
the head branch is meaningless for a agit flow pull request, so should
not check it when reopen it.
related: #24231
fix #26334
Signed-off-by: a1012112796 <1012112796@qq.com>
2 years ago
Jason Song
b658f2c61b
Return empty when searching issues with no repos ( #26545 )
2 years ago
CaiCandong
940f997512
Fix label filter between `all` and `no` ( #26557 )
...
Regression of https://github.com/go-gitea/gitea/pull/25886 .
# Description
For `labelIDs`:
9afcb0e046/routers/web/repo/issue.go (L171-L174)
- `nil` mean no filter
- `[0]` mean `no label` filter
When `selectLabels == "0"`, labelIDs should be `[0]` rather than `nil`
# Before:
https://github.com/go-gitea/gitea/assets/50507092/3dac5075-6da0-4769-ba20-48a56f4063c0
# After:
https://github.com/go-gitea/gitea/assets/50507092/ff79fd4c-b02e-4dfb-9309-ae7851f4dcdb
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
wxiaoguang
c6b92c84fe
Sync repo's IsEmpty status correctly ( #26517 )
...
Close #26509
2 years ago
a1012112796
19872063a3
add disable workflow feature ( #26413 )
...
As title, that's simmilar with github.


---------
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Jason Song <i@wolfogre.com>
2 years ago
puni9869
cafce3b4b5
Allow to archive labels ( #26478 )
...
## Archived labels
This adds the structure to allow for archived labels.
Archived labels are, just like closed milestones or projects, a medium to hide information without deleting it.
It is especially useful if there are outdated labels that should no longer be used without deleting the label entirely.
## Changes
1. UI and API have been equipped with the support to mark a label as archived
2. The time when a label has been archived will be stored in the DB
## Outsourced for the future
There's no special handling for archived labels at the moment.
This will be done in the future.
## Screenshots


Part of https://github.com/go-gitea/gitea/issues/25237
---------
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago