aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix Add/Remove WIP on pull request title failure (#29999) (#30066)Lunny Xiao2024-03-251-1/+15
| | | | Fix #29997 Backport #29999
* Performance improvements for pull request list page (#29900) (#29972)Lunny Xiao2024-03-222-5/+4
| | | | | | | | | This PR will avoid load pullrequest.Issue twice in pull request list page. It will reduce x times database queries for those WIP pull requests. Partially fix #29585 Backport #29900
* Fix invalid link of the commit status when ref is tag (#29752) (#29908)yp053272024-03-201-0/+122
| | | | | | | Backport #29752 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix PR creation via api between branches of same repo with head field ↵Giteabot2024-03-201-0/+17
| | | | | | | | | | | | | | | | | namespaced (#26986) (#29857) Backport #26986 by @norohind Fix #20175 Current implementation of API does not allow creating pull requests between branches of the same repo when you specify *namespace* (owner of the repo) in `head` field in http request body. --------- Co-authored-by: norohind <60548839+norohind@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix template error when comment review doesn't exist (#29888) (#29889)wxiaoguang2024-03-191-2/+12
| | | Backport #29888
* Fix codeowner detected diff base branch to mergebase (#29783) (#29807)Lunny Xiao2024-03-173-1/+141
| | | | | | | | | | | | | | | Fix #29763 Backport #29783 This PR fixes 2 problems with CodeOwner in the pull request. - Don't use the pull request base branch but merge-base as a diff base to detect the code owner. - CodeOwner detection in fork repositories will be disabled because almost all the fork repositories will not change CODEOWNERS files but it should not be used on fork repositories' pull requests. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix user router possbile panic (#29751) (#29786)Lunny Xiao2024-03-141-0/+9
| | | | regression from #28023 backport #29751
* Only use supported sort order for "explore/users" page (#29430) (#29443)wxiaoguang2024-03-031-0/+45
| | | | | | | | | | | | | | Backport #29430 Thanks to inferenceus : some sort orders on the "explore/users" page could list users by their lastlogintime/updatetime. It leaks user's activity unintentionally. This PR makes that page only use "supported" sort orders. Removing the "sort orders" could also be a good solution, while IMO at the moment keeping the "create time" and "name" orders is also fine, in case some users would like to find a target user in the search result, the "sort order" might help.
* Fix incorrect tests in 1.21 (#29366)wxiaoguang2024-02-241-25/+26
| | | | | | The submitted tests in the patch for the XSS fix is not right. To test, it should test "what should happen", but not "what doesn't exist" or "what is processed/decoded".
* Fix XSS vulnerabilities (#29336)65432024-02-221-0/+85
| | | | | | | | | | | - The Wiki page did not sanitize author name - the reviewer name on a "dismiss review" comment is also affected - the migration page has some spots --------- Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: jolheiser <john.olheiser@gmail.com>
* Prevent double use of `git cat-file` session. (#29298) (#29301)KN4CK3R2024-02-221-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #29298 Fixes the reason why #29101 is hard to replicate. Related #29297 Create a repo with a file with minimum size 4097 bytes (I use 10000) and execute the following code: ```go gitRepo, err := gitrepo.OpenRepository(db.DefaultContext, <repo>) assert.NoError(t, err) commit, err := gitRepo.GetCommit(<sha>) assert.NoError(t, err) entry, err := commit.GetTreeEntryByPath(<file>) assert.NoError(t, err) b := entry.Blob() // Create a reader r, err := b.DataAsync() assert.NoError(t, err) defer r.Close() // Create a second reader r2, err := b.DataAsync() assert.NoError(t, err) // Should be no error but is ErrNotExist defer r2.Close() ``` The problem is the check in `CatFileBatch`: https://github.com/go-gitea/gitea/blob/79217ea63c1f77de7ca79813ae45950724e63d02/modules/git/repo_base_nogogit.go#L81-L87 `Buffered() > 0` is used to check if there is a "operation" in progress at the moment. This is a problem because we can't control the internal buffer in the `bufio.Reader`. The code above demonstrates a sequence which initiates an operation for which the code thinks there is no active processing. The second call to `DataAsync()` therefore reuses the existing instances instead of creating a new batch reader.
* Workaround to clean up old reviews on creating a new one (#28554) (#29264)65432024-02-191-0/+126
| | | | | | | | close #28542 backport #28554 --- *Sponsored by Kithara Software GmbH*
* Refactor issue template parsing and fix API endpoint (#29069) (#29140)wxiaoguang2024-02-141-0/+55
| | | | | | | | | | | | | | | | | | Backport #29069 The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate, map[string]error)` doesn't really follow Golang's habits, then the second returned value might be misused. For example, the API function `GetIssueTemplates` incorrectly checked the second returned value and always responds 500 error. This PR refactors GetTemplatesFromDefaultBranch to ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes the API endpoint bug, and adds some tests. And by the way, add proper prefix `X-` for the header generated in `checkDeprecatedAuthMethods`, because non-standard HTTP headers should have `X-` prefix, and it is also consistent with the new code in `GetIssueTemplates`
* Preserve BOM in web editor (#28935) (#28959)Giteabot2024-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Backport #28935 by @silverwind The `ToUTF8*` functions were stripping BOM, while BOM is actually valid in UTF8, so the stripping must be optional depending on use case. This does: - Add a options struct to all `ToUTF8*` functions, that by default will strip BOM to preserve existing behaviour - Remove `ToUTF8` function, it was dead code - Rename `ToUTF8WithErr` to `ToUTF8` - Preserve BOM in Monaco Editor - Remove a unnecessary newline in the textarea value. Browsers did ignore it, it seems but it's better not to rely on this behaviour. Fixes: https://github.com/go-gitea/gitea/issues/28743 Related: https://github.com/go-gitea/gitea/issues/6716 which seems to have once introduced a mechanism that strips and re-adds the BOM, but from what I can tell, this mechanism was removed at some point after that PR. Co-authored-by: silverwind <me@silverwind.io>
* Fix uploaded artifacts should be overwritten (#28726) backport v1.21 (#28832)FuXiaoHei2024-01-221-0/+90
| | | | | | | | | | | | | Backport https://github.com/go-gitea/gitea/pull/28726 by @fuxiaohei Fix Uploaded artifacts should be overwritten https://github.com/go-gitea/gitea/issues/28549 When upload different content to uploaded artifact, it checks that content size is not match in db record with previous artifact size, then the new artifact is refused. Now if it finds uploading content size is not matching db record when receiving chunks, it updates db records to follow the latest size value.
* Prevent anonymous container access if `RequireSignInView` is enabled ↵Giteabot2024-01-221-0/+9
| | | | | | | | | | | (#28877) (#28882) Backport #28877 by @KN4CK3R Fixes #28875 If `RequireSignInView` is enabled, the ghost user has no access rights. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix reverting a merge commit failing (#28794) (#28825)Mihir Joshi2024-01-218-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport https://github.com/go-gitea/gitea/pull/28794 Fixes #22236 --- Error occurring currently while trying to revert commit using read-tree -m approach: > 2022/12/26 16:04:43 ...rvices/pull/patch.go:240:AttemptThreeWayMerge() [E] [63a9c61a] Unable to run read-tree -m! Error: exit status 128 - fatal: this operation must be run in a work tree > - fatal: this operation must be run in a work tree We need to clone a non-bare repository for `git read-tree -m` to work. https://github.com/go-gitea/gitea/commit/bb371aee6ecf5e570cdf7b5f7f0d6f47a607a325 adds support to create a non-bare cloned temporary upload repository. After cloning a non-bare temporary upload repository, we [set default index](https://github.com/go-gitea/gitea/blob/main/services/repository/files/cherry_pick.go#L37) (`git read-tree HEAD`). This operation ends up resetting the git index file (see investigation details below), due to which, we need to call `git update-index --refresh` afterward. Here's the diff of the index file before and after we execute SetDefaultIndex: https://www.diffchecker.com/hyOP3eJy/ Notice the **ctime**, **mtime** are set to 0 after SetDefaultIndex. You can reproduce the same behavior using these steps: ```bash $ git clone https://try.gitea.io/me-heer/test.git -s -b main $ cd test $ git read-tree HEAD $ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00 error: Entry '1' not uptodate. Cannot merge. ``` After which, we can fix like this: ```bash $ git update-index --refresh $ git read-tree -m 1f085d7ed8 1f085d7ed8 9933caed00 ```
* tests: missing refs/ in bare repositories (#28844) (#28852)Giteabot2024-01-191-0/+1
| | | | | | | | | Backport #28844 by @AdamMajer Git 2.43.0 will not detect a git repository as valid without refs/ subdirectory present. `git gc` cleans this up and puts it in packed-refs. We must keep refs/ non-empty. Co-authored-by: Adam Majer <amajer@suse.de>
* Rework markup link rendering (#26745) (#28803)KN4CK3R2024-01-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #26745 Fixes #26548 This PR refactors the rendering of markup links. The old code uses `strings.Replace` to change some urls while the new code uses more context to decide which link should be generated. The added tests should ensure the same output for the old and new behaviour (besides the bug). We may need to refactor the rendering a bit more to make it clear how the different helper methods render the input string. There are lots of options (resolve links / images / mentions / git hashes / emojis / ...) but you don't really know what helper uses which options. For example, we currently support images in the user description which should not be allowed I think: <details> <summary>Profile</summary> https://try.gitea.io/KN4CK3R ![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5) </details>
* Modernize merge button (#28140) (#28786)Giteabot2024-01-151-1/+8
| | | | | | | | | | | | | | | | | | Backport #28140 by @earl-warren - Make use of the `form-fetch-action` for the merge button, which will automatically prevent the action from happening multiple times and show a nice loading indicator as user feedback while the merge request is being processed by the server. - Adjust the merge PR code to JSON response as this is required for the `form-fetch-action` functionality. - Resolves https://codeberg.org/forgejo/forgejo/issues/774 - Likely resolves the cause of https://codeberg.org/forgejo/forgejo/issues/1688#issuecomment-1313044 (cherry picked from commit 4ec64c19507caefff7ddaad722b1b5792b97cc5a) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted <postmaster@gusted.xyz>
* Fix schedule tasks bugs (#28691) (#28780)Lunny Xiao2024-01-141-1/+1
| | | | | | | | | | | | | | Fix #28157 Backport #28691 This PR fix the possible bugs about actions schedule. - Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to service layer - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when actions unit has been disabled or global disabled. - Remove schedules plan from database and cancel waiting & running schedules tasks in this repository when default branch changed.
* Require token for GET subscription endpoint (#28765) (#28778)Jack Hay2024-01-131-1/+4
| | | Backport #28765 for 1.21
* Fix incorrect URL for "Reference in New Issue" (#28716) (#28723)Giteabot2024-01-071-0/+19
| | | | | | | | | | | | | Backport #28716 by wxiaoguang Gitea prefers to use relative URLs in code (to make multiple domain work for some users) So it needs to use `toAbsoluteUrl` to generate a full URL when click "Reference in New Issues" And add some comments in the test code Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Avoid unnecessary 500 panic when a commit doesn't exist (#28719) (#28721)Giteabot2024-01-071-0/+10
| | | | | | | | | | | | | Backport #28719 by wxiaoguang In #26851, it assumed that `Commit` always exists when `PageIsDiff==true`. But for a 404 page, the `Commit` doesn't exist, so the following code would cause panic because nil value can't be passed as string parameter to `IsMultilineCommitMessage(string)` (or the StringUtils.Cut in later PRs) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Upgrade xorm to new version which supported update join for all supported ↵Giteabot2023-12-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | databases (#28590) (#28668) Backport #28590 by @lunny Fix https://github.com/go-gitea/gitea/pull/28547#issuecomment-1867740842 Since https://gitea.com/xorm/xorm/pulls/2383 merged, xorm now supports UPDATE JOIN. To keep consistent from different databases, xorm use `engine.Join().Update`, but the actural generated SQL are different between different databases. For MySQL, it's `UPDATE talbe1 JOIN table2 ON join_conditions SET xxx Where xxx`. For MSSQL, it's `UPDATE table1 SET xxx FROM TABLE1, TABLE2 WHERE join_conditions`. For SQLITE per https://www.sqlite.org/lang_update.html, sqlite support `UPDATE table1 SET xxx FROM table2 WHERE join conditions` from 3.33.0(2020-8-14). POSTGRES is the same as SQLITE. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove unnecessary syncbranchToDB with tests (#28624) (#28629)Lunny Xiao2023-12-291-0/+36
| | | | | | | | | | Replace #28625 Backport #28624 by lunny #28361 introduced `syncBranchToDB` in `CreateNewBranchFromCommit`. This PR will revert the change because it's unnecessary. Every push will already be checked by `syncBranchToDB`. This PR also created a test to ensure it's right.
* Refactor CORS handler (#28587) (#28611)wxiaoguang2023-12-251-7/+78
| | | | | | | | | | | | | Backport #28587, the only conflict is the test file. The CORS code has been unmaintained for long time, and the behavior is not correct. This PR tries to improve it. The key point is written as comment in code. And add more tests. Fix #28515 Fix #27642 Fix #17098
* Do some missing checks (#28423) (#28432)Lunny Xiao2023-12-121-0/+23
| | | backport #28423
* Also sync DB branches on push if necessary (#28361) (#28403)Lunny Xiao2023-12-112-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #28056 Backport #28361 This PR will check whether the repo has zero branch when pushing a branch. If that, it means this repository hasn't been synced. The reason caused that is after user upgrade from v1.20 -> v1.21, he just push branches without visit the repository user interface. Because all repositories routers will check whether a branches sync is necessary but push has not such check. For every repository, it has two states, synced or not synced. If there is zero branch for a repository, then it will be assumed as non-sync state. Otherwise, it's synced state. So if we think it's synced, we just need to update branch/insert new branch. Otherwise do a full sync. So that, for every push, there will be almost no extra load added. It's high performance than yours. For the implementation, we in fact will try to update the branch first, if updated success with affect records > 0, then all are done. Because that means the branch has been in the database. If no record is affected, that means the branch does not exist in database. So there are two possibilities. One is this is a new branch, then we just need to insert the record. Another is the branches haven't been synced, then we need to sync all the branches into database.
* enable system users search via the API (#28013) (#28018)Giteabot2023-12-081-0/+22
| | | | | | | | | | | | Backport #28013 by @earl-warren Refs: https://codeberg.org/forgejo/forgejo/issues/1403 (cherry picked from commit dd4d17c159eaf8b642aa9e6105b0532e25972bb7) --------- Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add `HEAD` support for rpm repo files (#28309) (#28360)Giteabot2023-12-051-1/+7
| | | | | | | | | | | | | | | Backport #28309 by @KN4CK3R Fixes https://codeberg.org/forgejo/forgejo/issues/1810 zypper uses HEAD requests to check file existence. https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549 https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116 @ExplodingDragon fyi Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix comment permissions (#28213) (#28216)Lunny Xiao2023-11-257-4/+117
| | | | | | | backport #28213 This PR will fix some missed checks for private repositories' data on web routes and API routes.
* Fix permissions for Token DELETE endpoint to match GET and POST (#27610) ↵Giteabot2023-11-171-2/+29
| | | | | | | | | | | | | | | (#28099) Backport #27610 by @evantobin Fixes #27598 In #27080, the logic for the tokens endpoints were updated to allow admins to create and view tokens in other accounts. However, the same functionality was not added to the DELETE endpoint. This PR makes the DELETE endpoint function the same as the other token endpoints and adds unit tests Co-authored-by: Evan Tobin <me@evantob.in>
* enable system users for comment.LoadPoster (#28014) (#28032)Giteabot2023-11-141-0/+37
| | | | | | | | | | | | | | | | Backport #28014 by @earl-warren System users (Ghost, ActionsUser, etc) have a negative id and may be the author of a comment, either because it was created by a now deleted user or via an action using a transient token. The GetPossibleUserByID function has special cases related to system users and will not fail if given a negative id. Refs: https://codeberg.org/forgejo/forgejo/issues/1425 (cherry picked from commit 6a2d2fa24390116d31ae2507c0a93d423f690b7b) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
* Unify two factor check (#27915) (#27929)Giteabot2023-11-061-0/+55
| | | | | | | | | | | | Backport #27915 by @KN4CK3R Fixes #27819 We have support for two factor logins with the normal web login and with basic auth. For basic auth the two factor check was implemented at three different places and you need to know that this check is necessary. This PR moves the check into the basic auth itself. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Add user secrets API integration tests (#27832) (#27852)Giteabot2023-10-311-0/+98
| | | | | | | | Backport #27832 by @jbgomond Adds the missing user secrets API integration tests so #27829 does not happen again Co-authored-by: Jean-Baptiste Gomond <dev@jbgomond.com>
* Improve retrying index issues (#27554) (#27634)Giteabot2023-10-161-1/+2
| | | | | | | Backport #27554 by @wolfogre Fix #27540 Co-authored-by: Jason Song <i@wolfogre.com>
* show manual cron run's last time (#27544) (#27577)Giteabot2023-10-111-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #27544 by @earl-warren - Currently in the cron tasks, the 'Previous Time' only displays the previous time of when the cron library executes the function, but not any of the manual executions of the task. - Store the last run's time in memory in the Task struct and use that, when that time is later than time that the cron library has executed this task. - This ensures that if an instance admin manually starts a task, there's feedback that this task is/has been run, because the task might be run that quick, that the status icon already has been changed to an checkmark, - Tasks that are executed at startup now reflect this as well, as the time of the execution of that task on startup is now being shown as 'Previous Time'. - Added integration tests for the API part, which is easier to test because querying the HTML table of cron tasks is non-trivial. - Resolves https://codeberg.org/forgejo/forgejo/issues/949 (cherry picked from commit fd34fdac1408ece6b7d9fe6a76501ed9a45d06fa) Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: silverwind <me@silverwind.io>
* api: GetPullRequestCommits: return file list (#27483) (#27539)Giteabot2023-10-092-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #27483 by @msantos Fixes https://github.com/go-gitea/gitea/issues/27481 --- Patch tested: ```json [ { "url": "http://100.115.92.198:9292/api/v1/repos/msantos/test/git/commits/7664dcb44167e0f9efd994e4ca6a9164694adc27", "sha": "7664dcb44167e0f9efd994e4ca6a9164694adc27", "created": "2023-10-06T09:57:08-04:00", "html_url": "http://100.115.92.198:9292/msantos/test/commit/7664dcb44167e0f9efd994e4ca6a9164694adc27", ... "files": [ { "filename": "README.md", "status": "modified" } ], "stats": { "total": 2, "additions": 2, "deletions": 0 } } ] ``` Co-authored-by: Michael Santos <michael.santos@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Restore warning commit status (#27504) (#27529)Giteabot2023-10-092-0/+6
| | | | | | | | | | | | | Backport #27504 by @silverwind Partial revert of https://github.com/go-gitea/gitea/pull/25839. This commit status is used by a number of external integrations, so I think we should not remove it (See https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077). This is a rare case where an existing migration needed to be alterted to avoid data loss. Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de>
* Add support for HEAD ref in /src/branch and /src/commit routes (#27384) (#27407)Giteabot2023-10-031-0/+4
| | | | | | | | | | | | | Backport #27384 by @rbhz Add support for HEAD in paths: ``` /src/branch/HEAD/README.md /src/commit/HEAD/README.md ``` Closes #26920 Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
* Allow get release download files and lfs files with oauth2 token format ↵Giteabot2023-10-014-0/+33
| | | | | | | | | | (#26430) (#27379) Backport #26430 by @lunny Fix #26165 Fix #25257 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* More `db.DefaultContext` refactor (#27265) (#27347)Giteabot2023-09-291-1/+1
| | | | | | | | | | | 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>
* Fix Bug in Issue Config when only contact links are set (#26521) (#27334)Giteabot2023-09-282-15/+171
| | | | | | | | | | | | | | | | Backport #26521 by @JakobDev Blank Issues should be enabled if they are not explicit disabled through the `blank_issues_enabled` field of the Issue Config. The Implementation has currently a Bug: If you create a Issue Config file with only `contact_links` and without a `blank_issues_enabled` field, `blank_issues_enabled` is set to false by default. The fix is only one line, but I decided to also improve the tests to make sure there are no other problems with the Implementation. This is a bugfix, so it should be backported to 1.20. Co-authored-by: JakobDev <jakobdev@gmx.de>
* Another round of `db.DefaultContext` refactor (#27103) (#27262)Giteabot2023-09-251-1/+1
| | | | | | | | Backport #27103 by @JakobDev Part of #27065 Co-authored-by: JakobDev <jakobdev@gmx.de> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix review request number and add more tests (#27104) (#27168)Giteabot2023-09-213-13/+13
| | | | | | | | | | | | | | | | | | | | | Backport #27104 by @lng2020 fix #27019 ## testfixture yml 1. add issue20(a pr issue) in repo 23, org 17 2. add user15 to team 9 3. add four reviews about issue20 ## test case add two tests that are described with code comments the code before pr #26784 failed the first test <img width="479" alt="image" src="https://github.com/go-gitea/gitea/assets/70063547/1d9b5787-11b4-4c4d-931f-6a9869547f35"> current code failed the second test(as mentioned in #27019) <img width="484" alt="image" src="https://github.com/go-gitea/gitea/assets/70063547/05608055-7587-43d1-bae1-92c688270819"> Any advice is appreciated. Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
* Change green buttons to primary color (#27099)silverwind2023-09-183-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | I think it's better if the primary actions have primary color instead of green which fits better into the overall single-color UI design. This PR currently replaces every green button with primary: <img width="141" alt="Screenshot 2023-09-16 at 14 07 59" src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe"> <img width="161" alt="Screenshot 2023-09-16 at 14 07 51" src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1"> Modal actions now use uncolored/primary instead of previous green/red colors. I also removed the box-shadow on all basic buttons: <img width="259" alt="Screenshot 2023-09-16 at 14 16 39" src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490"> <img width="261" alt="Screenshot 2023-09-16 at 14 17 42" src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88"> The change currently includes the "Merge PR" button, for which we might want to make an exception to match the icon color there: <img width="442" alt="Screenshot 2023-09-16 at 14 33 53" src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">
* Fix token endpoints ignore specified account (#27080)CaiCandong2023-09-181-0/+23
| | | | | | | | | Fix #26234 close #26323 close #27040 --------- Co-authored-by: silverwind <me@silverwind.io>
* Next round of `db.DefaultContext` refactor (#27089)JakobDev2023-09-161-2/+2
| | | Part of #27065
* More refactoring of `db.DefaultContext` (#27083)JakobDev2023-09-152-2/+3
| | | Next step of #27065