summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Fix nuget/conan/container packages upload bugs (#31967) (#31982)Giteabot2024-09-051-0/+16
| | | | | Backport #31967 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove "dsa-1024" testcases from Test_SSHParsePublicKey and ↵Giteabot2024-08-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test_calcFingerprint (#31905) (#31914) Backport #31905 by @s4uliu5 DSA is considered inherently insecure and is already disabled/removed in OpenSSH 9.8. Therefore "dsa-1024" tescases are failing. ``` --- FAIL: Test_calcFingerprint (0.02s) --- FAIL: Test_calcFingerprint/dsa-1024 (0.00s) --- FAIL: Test_calcFingerprint/dsa-1024/SSHKeygen (0.00s) ssh_key_test.go:196: Error Trace: /src/gitea/models/asymkey/ssh_key_test.go:196 Error: Received unexpected error: Unable to verify key content [result: /tmp/gitea_keytest1239408114 is not a public key file. ] Test: Test_calcFingerprint/dsa-1024/SSHKeygen ssh_key_test.go:197: Error Trace: /src/gitea/models/asymkey/ssh_key_test.go:197 Error: Not equal: expected: "SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc" actual : "" Diff: --- Expected +++ Actual @@ -1 +1 @@ -SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc + Test: Test_calcFingerprint/dsa-1024/SSHKeygen FAIL ``` Fix #31624 Co-authored-by: Saulius Gurklys <s4uliu5@gmail.com>
* Fix agit automerge (#31207) (#31881)Giteabot2024-08-201-1/+1
| | | | | | | Backport #31207 by @lunny Fix #31134 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix panic of ssh public key page after deletion of auth source (#31829) (#31836)Giteabot2024-08-162-16/+17
| | | | | | | | | | Backport #31829 by @lunny Fix #31730 This PR rewrote the function `PublicKeysAreExternallyManaged` with a simple test. The new function removed the loop to make it more readable. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fixes for unreachable project issues when transfer repository from ↵Giteabot2024-08-142-0/+12
| | | | | | | | | | | | | | | | | organization (#31770) (#31828) Backport #31770 by @emrebdr When transferring repositories that have issues linked to a project board to another organization, the issues remain associated with the original project board. This causes the columns in the project board to become bugged, making it difficult to move other issues in or out of the affected columns. As a solution, I removed the issue relations since the other organization does not have this project table. Fix for #31538 Co-authored-by: Edip Emre Bodur <emrebdr29@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com>
* Show lock owner instead of repo owner on LFS setting page (#31788) (#31817)Giteabot2024-08-112-7/+92
| | | | | | | | | | | | | | | | | Backport #31788 by @wolfogre Fix #31784. Before: <img width="1648" alt="image" src="https://github.com/user-attachments/assets/03f32545-4a85-42ed-bafc-2b193a5d8023"> After: <img width="1653" alt="image" src="https://github.com/user-attachments/assets/e5bcaf93-49cb-421f-aac1-5122bc488b02"> Co-authored-by: Jason Song <i@wolfogre.com>
* Rename head branch of pull requests when renaming a branch (#31759) (#31774)Giteabot2024-08-041-0/+7
|
* Fix the display of project type for deleted projects (#31732) (#31734)Giteabot2024-07-301-0/+7
| | | | | | | | | | Backport #31732 by @yp05327 Fix: #31727 After: ![image](https://github.com/user-attachments/assets/1dfb4b31-3bd6-47f7-b126-650f33f453e2) Co-authored-by: yp05327 <576951401@qq.com>
* Add permission check when creating PR (#31033) (#31720)yp053272024-07-291-0/+8
| | | | | Backport #31033 user should be a collaborator of the base repo to create a PR
* Make GetRepositoryByName more safer (#31712) (#31718)Giteabot2024-07-291-6/+7
| | | | | | | Backport #31712 by @lunny Fix #31708 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Return an empty string when a repo has no avatar in the repo API (#31187) ↵Jimmy Praet2024-07-051-2/+8
| | | | | | | | | | | | | | | | (#31567) Backport #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: Kemal Zebari <60799661+kemzeb@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix web notification icon not updated once you read all notifications ↵Giteabot2024-06-241-4/+5
| | | | | | | | | | | | (#31447) (#31466) Backport #31447 by kiatt210 Fix #29065 Remove status filtering from GetUIDsAndNotificationCounts sql. Co-authored-by: kiatt210 <40639725+kiatt210@users.noreply.github.com> Co-authored-by: kiatt210 <kiatt210@github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix duplicate sub-path for avatars (#31365) (#31368)wxiaoguang2024-06-153-2/+60
| | | Backport #31365, only backport necessary changes.
* Fix the possible migration failure on 286 with postgres 16 (#31209) (#31218)Giteabot2024-06-021-1/+1
| | | | | | | Backport #31209 by @lunny Try to fix #31205 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix branch order (#31174) (#31193)Giteabot2024-05-311-8/+4
| | | | | | | | | | Backport #31174 by @lunny Fix #31172 The original order or the default order should not be ignored even if we have an is_deleted order. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make gitea webhooks openproject compatible (#28435) (#31081)Giteabot2024-05-261-0/+15
| | | | | Backport #28435 by Chief-Detektor Co-authored-by: André Rosenhammer <andre.rosenhammer@gmail.com>
* Fix wrong display of recently pushed notification (#25812) (#31043)yp053272024-05-2312-30/+261
| | | | | | | | | | | Backport #25812 ~~ps: removed some new codes in `tests/integration/pull_merge_test.go`~~ --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix automerge will not work because of some events haven't been triggered ↵Giteabot2024-05-221-3/+3
| | | | | | | | | | | | | | | | | | (#30780) (#31039) Backport #30780 by @lunny Replace #25741 Close #24445 Close #30658 Close #20646 ~Depends on #30805~ Since #25741 has been rewritten totally, to make the contribution easier, I will continue the work in this PR. Thanks @6543 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor sha1 and time-limited code (#31023) (#31030)Giteabot2024-05-212-8/+4
| | | | | Backport #31023 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix data-race during testing (#30999) (#31024)Giteabot2024-05-202-18/+32
| | | | | | | Backport #30999 by wxiaoguang Fix #30992 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Filter out duplicate action(activity) items for a repository (#30957) (#30976)Giteabot2024-05-142-1/+31
| | | | | Backport #30957 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Protected tag is no internal server error (#30962) (#30970)Giteabot2024-05-141-0/+24
| | | | | | | | | | Backport #30962 by @KN4CK3R Fixes #30959 Adds an API test for protected tags. Fix existing tag in combination with fixtures. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Remove If Exist check on migration for mssql because that syntax required ↵Giteabot2024-05-123-10/+12
| | | | | | | | | | | | | | SQL server 2016 (#30894) (#30946) Backport #30894 by @lunny Fix #30872 We will assume the database is consistent before executing the migration. So the indexes should exist. Removing `IF EXIST` then is safe enough. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix various problems around projects board view (#30696) (#30902)Giteabot2024-05-086-67/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30696 by @lunny # The problem The previous implementation will start multiple POST requests from the frontend when moving a column and another bug is moving the default column will never be remembered in fact. # What's changed - [x] This PR will allow the default column to move to a non-first position - [x] And it also uses one request instead of multiple requests when moving the columns - [x] Use a star instead of a pin as the icon for setting the default column action - [x] Inserted new column will be append to the end - [x] Fix #30701 the newly added issue will be append to the end of the default column - [x] Fix when deleting a column, all issues in it will be displayed from UI but database records exist. - [x] Add a limitation for columns in a project to 20. So the sorting will not be overflow because it's int8. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor AppURL usage (#30885) (#30891)wxiaoguang2024-05-082-16/+6
| | | | | | | Backport #30885 Fix #30883 Fix #29591 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Get repo list with OrderBy alpha should respect owner too (#30784) (#30875)Giteabot2024-05-061-2/+2
| | | | | | | | | | | | | | | | | Backport #30784 by @6543 instead of: - zowner/gcode - awesome/nul - zowner/nul - zowner/zzz we will get: - awesome/nul - zowner/gcode - zowner/nul - zowner/zzz Co-authored-by: 6543 <6543@obermui.de>
* Fix no edit history after editing issue's title and content (#30814) (#30845)Giteabot2024-05-031-56/+0
| | | | | | | | | Backport #30814 by @yp05327 Fix #30807 reuse functions in services Co-authored-by: yp05327 <576951401@qq.com>
* Fix duplicate status check contexts (#30660) (#30779)Zettat1232024-05-012-25/+61
| | | | | | | | | | | | | | | | | | | | | Backport #30660. Caused by #30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
* Get repo assignees and reviewers should ignore deactivated users (#30770) ↵65432024-04-302-7/+23
| | | | | | | | | | | | | (#30782) Backport #30770 If an user is deactivated, it should not be in the list of users who are suggested to be assigned or review-requested. old assignees or reviewers are not affected. --- *Sponsored by Kithara Software GmbH*
* Rename migration package name for 1.22-rc1 (#30730)wxiaoguang2024-04-277-13/+14
| | | Ref: Propose to restart 1.22 release #30501
* Add some tests to clarify the "must-change-password" behavior (#30693)wxiaoguang2024-04-271-2/+10
| | | | | | | | | | Follow #30472: When a user is created by command line `./gitea admin user create`: Old behavior before #30472: the first user (admin or non-admin) doesn't need to change password. Revert to the old behavior before #30472
* Update misspell to 0.5.1 and add `misspellings.csv` (#30573)silverwind2024-04-277-31/+31
| | | | | | Misspell 0.5.0 supports passing a csv file to extend the list of misspellings, so I added some common ones from the codebase. There is at least one typo in a API response so we need to decided whether to revert that and then likely remove the dict entry.
* Improve job commit description (#30579)yp053272024-04-261-0/+11
| | | | | | | | | | | | | | | | | | | | | Fix https://github.com/go-gitea/gitea/issues/30567 When job is a schedule: ![image](https://github.com/go-gitea/gitea/assets/18380374/b07e9d43-e8b7-4ee2-87b3-a7050c3a8ca5) When it is a normal one: ![image](https://github.com/go-gitea/gitea/assets/18380374/0d58dab9-74bb-421b-8952-0578cdf21a52) also add a 'space' behind `:` ![image](https://github.com/go-gitea/gitea/assets/18380374/4cebece0-bfe6-4ad9-b806-e5c49bb9be43) ![image](https://github.com/go-gitea/gitea/assets/18380374/02da7681-474b-4c0f-9dad-b6558f6cb484) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve oauth2 client "preferred username field" logic and the error ↵wxiaoguang2024-04-253-12/+18
| | | | | | | | | | | | | handling (#30622) Follow #30454 And fix #24957 When using "preferred_username", if no such field, `extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an error. All other USERNAME options do not return such error. And fine tune some logic and error messages, make code more stable and more friendly to end users.
* Fix some bug on migrations (#30647)Lunny Xiao2024-04-242-6/+1
| | | Fix https://github.com/go-gitea/gitea/pull/23894#discussion_r1573718690
* Interpolate runs-on with variables when scheduling tasks (#30640)sillyguodong2024-04-232-6/+21
| | | | | | | | | | Follow #29468 1. Interpolate runs-on with variables when scheduling tasks. 2. The `GetVariablesOfRun` function will check if the `Repo` of the run is nil. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add a db consistency check to remove runners that do not belong to a ↵Zettat1232024-04-231-2/+24
| | | | | repository (#30614) Follow #30406
* Fix wrong table name (#30557)Lunny Xiao2024-04-236-8/+18
| | | | | | The table name should be `oauth2_application` but `o_auth2_application` Caused by https://github.com/go-gitea/gitea/pull/21316/files#diff-9610efbc608a41f1f2eaff5790423f0a187906f6ff0beb23a5e8d18366cc2ccfR38
* Enable more `revive` linter rules (#30608)silverwind2024-04-2212-22/+4
| | | | | | | | | | | Noteable additions: - `redefines-builtin-id` forbid variable names that shadow go builtins - `empty-lines` remove unnecessary empty lines that `gofumpt` does not remove for some reason - `superfluous-else` eliminate more superfluous `else` branches Rules are also sorted alphabetically and I cleaned up various parts of `.golangci.yml`.
* chore: use errors.New to replace fmt.Errorf with no parameters will much ↵Cheng2024-04-213-4/+6
| | | | | better (#30621) use errors.New to replace fmt.Errorf with no parameters will much better
* Fix package list performance (#30520)KN4CK3R2024-04-201-11/+11
| | | | | | | | | Fixes #28255 The new query uses the id field to sort by "newer". This most not be correct (usually it is) but it's faster (see #28255). If someone has a better idea, please propose changes. Co-authored-by: Giteabot <teabot@gitea.io>
* Clarify permission "HasAccess" behavior (#30585)wxiaoguang2024-04-204-28/+84
| | | | | | | | | | | | | | | Follow #30495 "HasAccess" behavior wasn't clear, to make it clear: * Use a new name `HasAnyUnitAccess`, it will be easier to review related code and permission problems. * Separate everyone access mode to a separate field, then all calls to HasAccess are reverted to old behavior before #30495. * Add new tests. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Allow everyone to read or write a wiki by a repo unit setting (#30495)wxiaoguang2024-04-1712-97/+263
| | | | | Replace #6312 Help #5833 Wiki solution for #639
* Refactor web routes (#30519)wxiaoguang2024-04-172-13/+23
| | | | | | | Re-organize the routes in web.go and use ctx constants instead of `context.UnitTypes()` --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Reduce unnecessary database queries on actions table (#30509)Lunny Xiao2024-04-171-0/+6
|
* Improve "must-change-password" logic and document (#30472)wxiaoguang2024-04-141-2/+2
| | | | | Unify the behaviors of "user create" and "user change-password". Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix commitstatus summary (#30431)Lunny Xiao2024-04-143-14/+36
| | | | | | | | | | The target_url is necessary for the UI, but missed in commit_status_summary table. This PR fix it. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Add comment for ContainsRedirectURI about the exact match (#30457)wxiaoguang2024-04-131-0/+5
| | | | Close #26897 Replace #30336
* Fix rename branch 500 when the target branch is deleted but exist in ↵Lunny Xiao2024-04-121-6/+25
| | | | | database (#30430) Fix #30428
* Add commit status summary table to reduce query from commit status table ↵Lunny Xiao2024-04-124-12/+114
| | | | | | | | | | | | (#30223) This PR adds a new table named commit status summary to reduce queries from the commit status table. After this change, commit status summary table will be used for the final result, commit status table will be for details. --------- Co-authored-by: Jason Song <i@wolfogre.com>