summaryrefslogtreecommitdiffstats
path: root/models (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test(oauth): RFC 6749 Section 10.2 conformanceEarl Warren2024-06-061-1/+1
| | | | | | | | | See: 1b088fade6c69e63843d1bdf402454c363b22ce2 Prevent automatic OAuth grants for public clients 07fe5a8b1347bf62b3507c87d28b95ef58d6a162 use existing oauth grant for public client (cherry picked from commit 592469464b74d3cd97d4c9ec0ee9dd392bb5b426)
* Fix the possible migration failure on 286 with postgres 16 (#31209) (#31218)Giteabot2024-06-031-1/+1
| | | | | | | | | Backport #31209 by @lunny Try to fix #31205 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commit 68e405cf0b00e475c089d8b94cc076d269ab9bb9)
* Fix branch order (#31174) (#31193)Giteabot2024-06-031-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> (cherry picked from commit c6176ee59f4a25607dcfbc00757121f705101101)
* tests(api): POST /repos/{owner}/{repo}/push_mirrors coverageEarl Warren2024-06-021-0/+1
| | | | (cherry picked from commit 166bb2861f91d2ac5d83906dd178d0cef3f1adbc)
* test(mock): DeletePushMirrors & AddPushMirrorRemoteEarl Warren2024-06-021-1/+3
| | | | | | make them into variables that can be mocked (cherry picked from commit 5747951cc7c3bce05b593447168cd6337965054b)
* test: check hook_task deletionoliverpool2024-05-241-0/+6
| | | | | | move test to integration to ensure Sqlite + MySQL testing (cherry picked from commit bb165fadf6cc12822394ee7bc4e0a47c4383ba83)
* badges: Relax the default workflow badge conditionsGergely Nagy2024-05-201-2/+5
| | | | | | | | | | | | | | | | | Previously, if no branch was explicitly specified for a workflow, it defaulted to the default branch of the repo. This worked fine for workflows that were triggered on push, but it prevented showing badges for workflows that only run on tags, or on schedule - since they do not run on a specific branch. Thus, relax the conditions, and if no branch is specified, just return the latest run of the given workflow. If one is specified, *then* restrict it to said branch. Fixes #3487. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit d6915f4d5f81805f3a9e2ba38ecf512c15cfd360)
* Merge pull request '[gitea] week 2024-20-v7.0 cherry pick (release/v1.22 -> ↵Earl Warren2024-05-167-69/+281
|\ | | | | | | | | | | | | v7.0/forgejo)' (#3772) from earl-warren/wcp/2024-20-v7.0 into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3772 Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
| * Fix various problems around projects board view (#30696)Lunny Xiao2024-05-146-67/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. - [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: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit a303c973e0264dab45a787c4afa200e183e0d953) Conflicts: routers/web/web.go e91733468ef726fc9365aa4820cdd5f2ddfdaa23 Add missing database transaction for new issue (#29490) was not cherry-picked services/issue/issue.go fe6792dff3 Enable/disable owner and repo projects independently (#28805) was not cherry-picked (cherry picked from commit 7d3ca90dfed142ce62c75fbe041382b5f4334c01) (cherry picked from commit 084bec89ed7ae0816fc2d8db6784ad22523d1fc4)
| * Get repo list with OrderBy alpha should respect owner too (#30784) (#30875)Giteabot2024-05-141-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> (cherry picked from commit cfe6779d4eb2f3869357768fe58863642f79c5a9)
* | fix: hook post-receive for sha256 reposoliverpool2024-05-151-1/+1
|/ | | | (cherry picked from commit 5e73c67d6744931c7cdb7df6a6d8f3f1ae913452)
* Teach activities.GetFeeds() how to avoid returning duplicatesGergely Nagy2024-05-091-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before explaining the fix itself, lets look at the `action` table, and how it is populated. Data is only ever inserted into it via `activities_model.NotifyWatchers`, which will: - Insert a row for each activity with `UserID` set to the acting user's ID - this is the original activity, and is always inserted if anything is to be inserted at all. - It will insert a copy of each activity with the `UserID` set to the repo's owner, if the owner is an Organization, and isn't the acting user. - It will insert a copy of each activity for every watcher of the repo, as long as the watcher in question has read permission to the repo unit the activity is about. This means that if a repository belongs to an organizations, for most activities, it will have at least two rows in the table. For repositories watched by people other than their owner, an additional row for each watcher. These are useful duplicates, because they record which activities are relevant for a particular user. However, for cases where we wish to see the activities that happen around a repository, without limiting the results to a particular user, we're *not* interested in the duplicates stored for the watchers and the org. We only need the originals. And this is what this change does: it introduces an additional option to `GetFeedsOptions`: `OnlyPerformedByActor`. When this option is set, `activities.GetFeeds()` will only return the original activities, where the user id and the acting user id are the same. As these are *always* inserted, we're not missing out on any activities. We're just getting rid of the duplicates. As this is an additional `AND` condition, it can never introduce items that would not have been included in the result set before, it can only reduce, not extend. These duplicates were only affecting call sites where `RequestedRepo` was set, but `RequestedUser` and `RequestedTeam` were not. Both of those call sites were updated to set `OnlyPerformedByActor`. As a result, repository RSS feeds, and the `/repos/{owner}/{repo}/activities/feeds` API end points no longer return dupes, only the original activities. Rather than hardcoding this behaviour into `GetFeeds()` itself, I chose to implement it as an explicit option, for the sake of clarity. Fixes Codeberg/Community#684, and addresses gitea#20986. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit 9cb2aa989a4c331f9085126e5a88b5095b45ae54)
* Fix no edit history after editing issue's title and content (#30814)yp053272024-05-071-59/+0
| | | | | | | | | | | | | | Fix #30807 reuse functions in services (cherry picked from commit a50026e2f30897904704895362da0fb12c7e5b26) Conflicts: models/issues/issue_update.go routers/api/v1/repo/issue.go trivial context conflict because of 'allow setting the update date on issues and comments' (cherry picked from commit 6a4bc0289db5d5d791864f45ed9bb47b6bc8d2fe)
* Merge pull request '[v1.22/gitea] week 2024-18 cherry pick v7.0 (take 2)' ↵v7.0.2Earl Warren2024-05-014-34/+83
|\ | | | | | | | | | | | | (#3580) from earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3580 Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
| * 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" /> (cherry picked from commit 99e89e57bc4d2b3a3cd6c3068f818a0c7e8cec28)
| * Get repo assignees and reviewers should ignore deactivated users (#30770) ↵65432024-05-012-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#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* (cherry picked from commit 022eac4ac8e59f861237cc1e02f7ef117eaf8e30) Conflicts: models/repo/user_repo_test.go because there is one less fixture user compared to Gitea
* | Fix git_model.FindBranchesByRepoAndBranchNameGergely Nagy2024-05-012-0/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a logged in user with no repositories visits their dashboard, it will display a search box that lists their own repositories. This is served by the `repo.SearchRepos` handler, which in turn calls `commitstatus_service.FindReposLastestCommitStatuses()` with an empty repo list. That, in turn, will call `git_model.FindBranchesByRepoAndBranchName()`, with an empty map. With no map, `FindBranchesByRepoAndBranchName()` ends up querying the entire `branch` table, because no conditions were set up. Armed with a gazillion repo & commit shas, we return to `FindReposLastestCommitStatuses`, and promptly call `git_model.GetLatestCommitStatusForPairs`, which constructs a monstrous query with so many placeholders that the database tells us to go somewhere else, and flips us off. At least on instances the size of Codeberg. On smaller instances, it will eventually return, and throw away all the data, and return an empty set, having performed all this for naught. We fix this by short-circuiting `FindBranchesByRepoAndBranchName`, and returning fast if our inputs are empty. A test case is included. Fixes #3521. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit 0d029ebe6d7ed609d7521f7e6b1c09486a4fef55)
* test: webhook fix branch filter testsoliverpool2024-04-301-1/+2
| | | | (cherry picked from commit 79380c209d78c258948f3b861be97bbf9c7d3974)
* Merge pull request '[v1.22/gitea] week 2024-18 cherry pick v7.0' (#3483) ↵Earl Warren2024-04-274-8/+6
|\ | | | | | | | | | | | | from earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3483 Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
| * Fix wrong table name (#30557) (#30651)Lunny Xiao2024-04-264-8/+6
| | | | | | | | | | | | | | | | | | | | | | Backport #30557 The table name should be `oauth2_application` but `o_auth2_application` Caused by https://github.com/go-gitea/gitea/pull/21316/files#diff-9610efbc608a41f1f2eaff5790423f0a187906f6ff0beb23a5e8d18366cc2ccfR38 (cherry picked from commit 5c12e794455fc2378d034addd9ee3581b55e6709)
* | test: LFS gc should not delete all metadata objectsoliverpool2024-04-261-1/+1
|/ | | | | | | and ComputeBlobHash should depend on the blob content (not only the length) (cherry picked from commit 3dfa5ba43a907959f279273032a4448cd7e40924)
* s/Gitea/Forgejo in various log messages and comments0ko2024-04-222-5/+5
| | | | (cherry picked from commit 469c214ec8af393bb65f847f2ba53f16d41fa87a)
* Fix package list performance (#30520) (#30616)Giteabot2024-04-211-11/+11
| | | | | | | | | | | | | Backport #30520 by @KN4CK3R 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: KN4CK3R <admin@oldschoolhack.me> (cherry picked from commit ea2ea8ef28b6a2207ec00bafaf42d428612d69eb)
* Improve "must-change-password" logic and document (#30472)wxiaoguang2024-04-211-2/+2
| | | | | | | | | | | | | | Unify the behaviors of "user create" and "user change-password". Co-authored-by: KN4CK3R <admin@oldschoolhack.me> (cherry picked from commit 4c6e2da088cf092a9790df5c84b7b338508fede7) Conflicts: - cmd/admin_user_create.go Resolved by favoring Gitea's version of the conflicting areas. - docs/content/administration/command-line.en-us.md Removed, Gitea specific. (cherry picked from commit b122c6ef8b9254120432aed373cbe075331132ac)
* Merge pull request '[backport] gitea#30406: Check the token's owner and ↵Earl Warren2024-04-191-0/+3
|\ | | | | | | | | | | | | | | repository when registering a runner' (#3262) from algernon/forgejo:backport/3257-to-7.0 into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3262 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org>
| * Check the token's owner and repository when registering a runner (#30406)Zettat1232024-04-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix #30378 (cherry picked from commit 0fe9f93eb4c94d55e43b18b9c3cc6d513a34c0b5) Conflicts: - models/organization/org.go - services/repository/delete.go - services/user/delete.go In all three cases, conflicts were resolved by manually adding the lines added by the Gitea patch, keeping the Forgejo code surrounding them.
* | Merge pull request '[v7.0/forgejo] [TEST] cancel all processes on ↵Earl Warren2024-04-191-2/+1
|\ \ | |/ |/| | | | | | | | | | | PrepareTestEnv' (#3130) from bp-v7.0/forgejo-8ffaa08-aba99ab into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3130 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
| * [TESTS] disable test failure on log.Error for now (part 2)Earl Warren2024-04-161-2/+1
| | | | | | | | | | Fixes: https://codeberg.org/forgejo/forgejo/issues/3153 (cherry picked from commit fd62033b98ea40db0285309892ba61ae49abb85d)
* | Merge pull request '[v1.22/gitea] week 16 cherry pick to v7.0' (#3235) from ↵Earl Warren2024-04-164-15/+12
|\ \ | |/ |/| | | | | | | | | earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3235 Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>
| * Avoid user does not exist error when detecting schedule actions when the ↵Giteabot2024-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit author is an external user (#30357) (#30409) Backport #30357 by @yp05327 ![image](https://github.com/go-gitea/gitea/assets/18380374/ddf6ee84-2242-49b9-b066-bd8429ba4d76) When repo is a mirror, and commit author is an external user, then `GetUserByEmail` will return error. reproduce/test: - mirror Gitea to your instance - disable action and enable it again, this will trigger `DetectAndHandleSchedules` ps: also follow #24706, it only fixed normal runs, not scheduled runs. Co-authored-by: yp05327 <576951401@qq.com> (cherry picked from commit 69cc79173ddbf7662c4d7246b6161b9351038d16)
| * Fix ambiguous id when fetch Actions tasks (#30382) (#30383)Giteabot2024-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30382 by @wolfogre Fix regression of #30331. ```txt time="2024-04-10T02:23:49Z" level=error msg="failed to fetch task" func="[fetchTask]" file="[poller.go:91]" error="unknown: rpc error: code = Internal desc = pick task: CreateTaskForRunner: Error 1052 (23000): Column 'id' in field list is ambiguous" ``` I have tested it in my local env, and it should work now. Co-authored-by: Jason Song <i@wolfogre.com> (cherry picked from commit 189cfc1be1015367ca20c655ab6a5fd9847c527f)
| * Avoid running action when action unit is disabled after workflows detected ↵Giteabot2024-04-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#30331) (#30338) Backport #30331 by @yp05327 Fix #30243 We only checking unit disabled when detecting workflows, but not in runner `FetchTask`. So if a workflow was detected when action unit is enabled, but disabled later, `FetchTask` will still return these detected actions. Global setting: repo.ENABLED and repository.`DISABLED_REPO_UNITS` will not effect this. Co-authored-by: yp05327 <576951401@qq.com> (cherry picked from commit 52bdeb4d45d44756e28dda7f3f899bb57eed1aad)
| * Clean up log messages (#30313)wxiaoguang2024-04-152-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `log.Xxx("%v")` is not ideal, this PR adds necessary context messages. Remove some unnecessary logs. Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit 83f83019ef3471b847a300f0821499b3896ec987) Conflicts: - modules/util/util.go Conflict resolved by picking `util.Iif` from 654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3 (cherry picked from commit 492d116b2a468991f44d6d37ec33f918ccbe4514) Conflicts: modules/util/util.go trivial context conflict as the commit is picked from https://codeberg.org/forgejo/forgejo/pulls/3212
* | Merge pull request '[v7.0/forgejo] fix(actions): call automerge service on ↵Earl Warren2024-04-152-0/+34
|\ \ | | | | | | | | | | | | | | | | | | successful commit state' (#3238) from bp-v7.0/forgejo-36f4732 into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3238 Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
| * | fix(actions): call automerge service on successful commit stateMichael Kriese2024-04-152-0/+34
| |/ | | | | | | | | | | - Backport of https://github.com/go-gitea/gitea/pull/30225 (cherry picked from commit 36f4732e6a89daa3ab7ae5fb5ede3a915b81caa2)
* / [PORT] gitea#30430: Fix rename branch 500 when the target branch is deleted ↵Gusted2024-04-151-6/+25
|/ | | | | | | | | | | | | | | but exist in database Fix https://github.com/go-gitea/gitea/issues/30428 --- Conflict resolution: trivial and move test to own subtest run directly after `Normal`. (cherrypicked commit 9466fec879f4f2c88c7c1e7a5cffba319282ab66) (cherry picked from commit db39b8f4a73415173dccff4d2c4a44d867e4c106)
* Do not update PRs based on events that happened before they existedEarl Warren2024-04-1210-2/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Split TestPullRequest out of AddTestPullRequestTask * A Created field is added to the Issue table * The Created field is set to the time (with nano resolution) on creation * Record the nano time repo_module.PushUpdateOptions is created by the hook * The decision to update a pull request created before a commit was pushed is based on the time (with nano resolution) the git hook was run and the Created field It ensures the following happens: * commit C is pushed * the git hook queues AddTestPullRequestTask for processing and returns with success * TestPullRequest is not called yet * a pull request P with commit C as the head is created * TestPullRequest runs and ignores P because it was created after the commit was received When the "created" column is NULL, no verification is done, pull requests that were created before the column was created in the database cannot be newer than the latest call to a git hook. Fixes: https://codeberg.org/forgejo/forgejo/issues/2009 (cherry picked from commit 998a431747a15cc95f7056a2029b736551eb037b) Conflicts: models/forgejo_migrations/migrate.go see https://codeberg.org/forgejo/forgejo/pulls/3165#issuecomment-1755941 services/pull/pull.go trivial conflicts
* Merge pull request '[v1.22/gitea] week 15 cherry pick to v7.0' (#3113) from ↵Earl Warren2024-04-104-7/+27
|\ | | | | | | | | | | | | earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3113 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
| * Fix missing 0 prefix of GPG key id (#30245)KN4CK3R2024-04-083-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #30235 If the key id "front" byte has a single digit, `%X` is missing the 0 prefix. ` 38D1A3EADDBEA9C` instead of `038D1A3EADDBEA9C` When using the `IssuerFingerprint` slice `%X` is enough but I changed it to `%016X` too to be consistent. (cherry picked from commit eb505b128c7b9b2459f2a5d20b5740017125178b) Conflicts: - models/asymkey/gpg_key_commit_verification.go Ported the change to models/asymkey/gpg_key_object_verification.go (cherry picked from commit 63904e2f973ebb1bd07a393fd55b05e4ba5242e5)
| * Fix GPG subkey verify (#30193) (#30203)Giteabot2024-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | Backport #30193 by @KN4CK3R Fixes #30189 Can't verify subkeys if they are not loaded. Co-authored-by: KN4CK3R <admin@oldschoolhack.me> (cherry picked from commit e581efe238d1f735787b5dbdfcce9a1d73384ef3)
* | webhook: add admin-hooks testsoliverpool2024-04-091-9/+11
|/ | | | (cherry picked from commit 9a94019db4f5604a1923baa9b874a22adc4e7c5e)
* Merge pull request '[v7.0/forgejo] Sort `BuiltinApplicationsClientIDs()` in ↵Gusted2024-04-061-1/+4
|\ | | | | | | | | | | | | | | test' (#3079) from bp-v7.0/forgejo-eea2590 into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3079 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
| * Sort `BuiltinApplicationsClientIDs()` in testGusted2024-04-061-1/+4
| | | | | | | | | | | | - Ref https://codeberg.org/forgejo/forgejo/pulls/3069#issuecomment-1736290 (cherry picked from commit eea259055e0602419b2c7f6cc44ffa1b4379f847)
* | [v7.0/forgejo] Add optional pronoun field in user settings (#3076)forgejo-backport-action2024-04-063-0/+20
|/ | | | | | | | | | | | | | | | | | | **Backport:** https://codeberg.org/forgejo/forgejo/pulls/1518 An attempt at adding an optional pronoun field for user profiles, as suggested here 3 years ago: https://github.com/go-gitea/gitea/issues/13990 ![A Forgejo profile showing pronouns to the right of the user's username](/attachments/2e5ff300-d333-46db-9074-f030f199843c) I made this for [my own instance](https://git.gay/h) and didn't initially think I'd make a PR because of the previous closed issue, but I thought I'd ask the Forgejo matrix chat to see if there was any support and there was! I'm told I should make a database migration, some help as to how to do that would be appreciated. Co-authored-by: hazycora <hazysu@riseup.net> Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3076 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
* Merge pull request '[v7.0/forgejo] [BUG] Don't remove builtin OAuth2 ↵Gusted2024-04-063-0/+86
|\ | | | | | | | | | | | | applications' (#3069) from bp-v7.0/forgejo-6af8f3a into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3069 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
| * [BUG] Don't remove builtin OAuth2 applicationsGusted2024-04-063-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When the database consistency is being run it would check for any OAuth2 applications that don't have an existing user. However there are few special OAuth2 applications that don't have an user set, because they are global applications. - This was not taken into account by the database consistency checker and were removed if the database consistency check was being run with autofix enabled. - Take into account to ignore these global OAuth2 applications when running the database consistency check. - Add unit tests. - Ref: https://codeberg.org/Codeberg/Community/issues/1530 (cherry picked from commit 6af8f3a3f2af058a0974b55371533728771bb691)
* | Merge pull request '[v7.0/forgejo] Refactor LFS GC functions' (#3072) from ↵Gusted2024-04-063-32/+123
|\ \ | | | | | | | | | | | | | | | | | | bp-v7.0/forgejo-7ffa7f5 into v7.0/forgejo Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3072 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
| * | Refactor LFS GC functionsGusted2024-04-063-32/+123
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove options that currently aren't set on `GarbageCollectLFSMetaObjectsOptions` and `IterateLFSMetaObjectsForRepoOptions`. - Simplify `IterateRepositoryIDsWithLFSMetaObjects` and `IterateLFSMetaObjectsForRepo`. - `IterateLFSMetaObjectsForRepo` was previously able to get in a loop (`gc-lfs` doctor check was able to reproduce this) because the code expected that the records would be updated to not match the SQL query, but that wasn't the case. Simply enforce that only records higher than the latest `id` from the previous iteration are allowed. - For `gc-lfs` doctor check this was because `UpdatedLessRecentlyThan` option was not set, which caused that records just marked as active in the iteration weren't being filtered. - Add unit tests - Most likely a regression from 2cc3a6381cab34113fd2dc2c24ef0efc22c4336d. - The bug with `gc-lfs` was found on Codeberg. (cherry picked from commit 7ffa7f5bcef12a0cc05aff660cb5217dc7e4c886)
* / [TEST] webhook creation payload refoliverpool2024-04-061-1/+1
|/ | | | (cherry picked from commit 9d2919248bd2cc8025c74aa15d0e37147e5ecf9d)
* [GITEA] Apply changes to archived labels0ko2024-04-031-6/+6
| | | | | | | | | | | | | | | | | This is a squashed result of conflict resolution for the following commits from Gitea: - https://github.com/go-gitea/gitea/commit/36de5b299bb3e6e6cf28062c832ab8165e83f91a - https://github.com/go-gitea/gitea/commit/9a93b1816e0bc65101e7ad7ca66786fb38a8e628 - https://github.com/go-gitea/gitea/commit/712e19fa6fbf2f1a5b0a471782d38a7d91e538ae - https://github.com/go-gitea/gitea/commit/83850cc4799285d766d0fb5751fff10a6e4d3353 It is lacking CSS rule for archived labels, though. Changes in this commit are authored by: - 6543 - delvh - silverwind (cherry picked from commit 4b09dd11ec77fd5758d307aac29202ae23cdc619)