aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration
Commit message (Collapse)AuthorAgeFilesLines
* Fix get / delete runner to use consistent http 404 and 500 status (#34480)ChristopherHX2 days1-0/+8
| | | | * previously deleting an already deleted runner returned http 500 * previously any database error for the get endpoint was http 404 and never 500
* Add endpoint deleting workflow run (#34337)NorthRealm5 days2-0/+279
| | | | | | | | | | | Add endpoint deleting workflow run Resolves #26219 /claim #26219 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix remove org user failure on mssql (#34449)ChristopherHX5 days1-8/+34
| | | | | | | | | | | * mssql does not support fetching 0 repositories * remove paging by NumRepos that might be 0 * extend admin api test to purge user 2 Fixes #34448 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix repo broken check (#34444)wxiaoguang5 days1-16/+24
| | | Fix #34424
* Add a webhook push test for dev branch (#34421)Lunny Xiao7 days1-3/+47
|
* Fix bug webhook milestone is not right. (#34419)Lunny Xiao7 days2-0/+81
| | | | | | | Fix #34400 --------- Co-authored-by: silverwind <me@silverwind.io>
* When updating comment, if the content is the same, just return and not ↵Lunny Xiao7 days1-12/+61
| | | | | update the databse (#34422) Fix #34318
* Fix GetUsersByEmails (#34423)wxiaoguang8 days1-27/+9
| | | Fix #34418, fix #34353
* Fix a bug when uploading file via lfs ssh command (#34408)Lunny Xiao9 days1-1/+39
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix incorrect divergence cache after switching default branch (#34370)GWDx10 days1-0/+97
| | | | | | | | | | Issue: After switching the default branch, other branches are still compared against the old default branch due to outdated divergence cache. Change: Clear the divergence cache in SetRepoDefaultBranch to ensure correct comparisons against the new default branch. Fixes #34369
* Use lfs label for lfs file rather than a long description (#34363)Lunny Xiao14 days1-3/+3
| | | | | | | | | | | Before ![image](https://github.com/user-attachments/assets/ed6c9221-5a6a-4717-8178-e5528fd180bf) After ![image](https://github.com/user-attachments/assets/baa94350-ead4-46bf-b4b7-1bfd3aa5dcac)
* Fix bug when API get pull changed files for deleted head repository (#34333)Lunny Xiao14 days1-0/+98
|
* Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187)wxiaoguang2025-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Fix #880 Design: 1. A global setting `security.TWO_FACTOR_AUTH`. * To support org-level config, we need to introduce a better "owner setting" system first (in the future) 2. A user without 2FA can login and may explore, but can NOT read or write to any repositories via API/web. 3. Keep things as simple as possible. * This option only aggressively suggest users to enable their 2FA at the moment, it does NOT guarantee that users must have 2FA before all other operations, it should be good enough for real world use cases. * Some details and tests could be improved in the future since this change only adds a check and seems won't affect too much. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* actions artifacts api list/download check status upload confirmed (#34273)ChristopherHX2025-04-281-0/+20
| | | | | | | | | | | * fixes a fixture status to upload confirmed * add another fixture as noise to break tests as soon they are exposed to api * v4 delete test added check that artifact is no longer visible in internal api with status pending delete * removal of http 404 on empty list: actions/upload-artifact@v4 now backoff on http 404 of ListArtifacts endpoint * fixes artifacts with pending delete etc. are able to be found and downloaded if the storage is not freed
* Explicitly not update indexes when sync database schemas (#34281)Lunny Xiao2025-04-261-5/+4
| | | | | | | Fix #34275 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Option to delay conflict checking of old pull requests until page view (#27779)Brecht Van Lommel2025-04-241-0/+76
| | | | | | | | | | | | | | | | | | | | | | `[repository.pull-request] DELAY_CHECK_FOR_INACTIVE_DAYS` is a new setting to delay the mergeable check for pull requests that have been inactive for the specified number of days. This avoids potentially long delays for big repositories with many pull requests. and reduces system load overall when there are many repositories or pull requests. When viewing the PR, checking will start immediately and the PR merge box will automatically reload when complete. Accessing the PR through the API will also start checking immediately. The default value of `7` provides a balance between system load, and keeping behavior similar to what it was before both for users and API access. With `0` all conflict checking will be delayed, while `-1` always checks immediately to restore the previous behavior. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix panic when comment is nil (#34257)Lunny Xiao2025-04-241-21/+3
| | | Fix #34254
* Add API endpoint to request contents of multiple files simultaniously (#34139)Denys Konovalov2025-04-224-10/+165
| | | | | | | | | | | | | | | | Adds an API POST endpoint under `/repos/{owner}/{repo}/file-contents` which receives a list of paths and returns a list of the contents of these files. This API endpoint will be helpful for applications like headless CMS (reference: https://github.com/sveltia/sveltia-cms/issues/198) which need to retrieve a large number of files by reducing the amount of needed API calls. Close #33495 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add API routes to lock and unlock issues (#34165)YaFou2025-04-211-0/+74
| | | | | | | | | | | | | | | This pull request adds a GitHub-compatible API endpoint to lock and unlock an issue. The following routes exist now: - `PUT /api/v1/repos/{owner}/{repo}/issues/{id}/lock` to lock an issue - `DELETE /api/v1/repos/{owner}/{repo}/issues/{id}/lock` to unlock an issue Fixes #33677 Fixes #20012 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Actions Runner rest api (#33873)ChristopherHX2025-04-181-0/+332
| | | | | | | | | | | | | | | | | | | | | | | | | Implements runner apis based on https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization - Add Post endpoints for registration-token, google/go-github revealed this as problem - We should deprecate Get Endpoints, leaving them for compatibility - Get endpoint of admin has api path /admin/runners/registration-token that feels wrong, /admin/actions/runners/registration-token seems more consistent with user/org/repo api - Get Runner Api - List Runner Api - Delete Runner Api - Tests admin / user / org / repo level endpoints Related to #33750 (implements point 1 and 2) Via needs discovered in #32461, this runner api is needed to allow cleanup of runners that are deallocated without user interaction. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Swift files can be passed either as file or as form value (#34068)Wolfgang Reithmeier2025-04-181-4/+94
| | | | | | | Fix #33990 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix bug when migrating repository (#34182)Lunny Xiao2025-04-144-4/+4
| | | This PR fixed a bug which is a regression from #31035
* Add package version api endpoints (#34173)KN4CK3R2025-04-131-48/+79
| | | | | | | | | Fixes #33544 Adds two new api endpoints to list a versions of a package and to get the latest version of a package by API. ⚠️ BREAKING ⚠️ the `size` field for this endpoint changes from `Size` to `size`.
* Allow admins and org owners to change org member public status (#28294)Tomeamis2025-04-132-128/+152
| | | | | | | | | | | | | | Allows admins and org owners to change org member public status. Before, this would return `Error 403: Cannot publicize another member` despite the fact that the same user could make the same change through the GUI. Fixes #28372 --------- Co-authored-by: Tomáš Ženčák <zencak@ica.cz> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Uniform all temporary directories and allow customizing temp path (#32352)Lunny Xiao2025-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR uniform all temporary directory usage so that it will be easier to manage. Relate to #31792 - [x] Added a new setting to allow users to configure the global temporary directory. - [x] Move all temporary files and directories to be placed under os.Temp()/gitea. - [x] `setting.Repository.Local.LocalCopyPath` now will be `setting.TempPath/local-repo` and the customized path is removed. ```diff -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;[repository.local] -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; -;; Path for local repository copy. Defaults to TEMP_PATH + `local-repo`, this is deprecated and cannot be changed -;LOCAL_COPY_PATH = local-repo ``` - [x] `setting.Repository.Upload.TempPath` now will be `settting.TempPath/uploads` and the customized path is removed. ```diff ;[repository.upload] -;; -;; Path for uploads. Defaults to TEMP_PATH + `uploads` -;TEMP_PATH = uploads ``` - [x] `setting.Packages.ChunkedUploadPath` now will be `settting.TempPath/package-upload` and the customized path is removed. ```diff ;[packages] -;; -;; Path for chunked uploads. Defaults it's `package-upload` under `TEMP_PATH` unless it's an absolute path. -;CHUNKED_UPLOAD_PATH = package-upload ``` - [x] `setting.SSH.KeyTestPath` now will be `settting.TempPath/ssh_key_test` and the customized path is removed. ```diff [server] -;; -;; Directory to create temporary files in when testing public keys using ssh-keygen, -;; default is the system temporary directory. -;SSH_KEY_TEST_PATH = ``` TODO: - [ ] setting.PprofDataPath haven't been changed because it may need to be kept until somebody read it but temp path may be clean up any time. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Rework create/fork/adopt/generate repository to make sure resources will be ↵Lunny Xiao2025-04-071-0/+51
| | | | | | | | | | | | | | | | | | | cleanup once failed (#31035) Fix #28144 To make the resources will be cleanup once failed. All repository operations now follow a consistent pattern: - 1. Create a database record for the repository with the status being_migrated. - 2. Register a deferred cleanup function to delete the repository and its related data if the operation fails. - 3. Perform the actual Git and database operations step by step. - 4. Upon successful completion, update the repository’s status to ready. The adopt operation is a special case — if it fails, the repository on disk should not be deleted.
* Fix team permission (#34128)wxiaoguang2025-04-082-10/+10
| | | | The `team.access_mode` should be either `none` or `admin/owner`. For non-admin team, the real permissions are provided by `team_unit`.
* Get changed files based on merge base when checking `pull_request` actions ↵Zettat1232025-04-031-0/+80
| | | | | trigger (#34106) Fix #33941
* Add `last_committer_date` and `last_author_date` for file contents API (#32921)Lunny Xiao2025-04-026-152/+210
| | | | | | | | Fix #32886 Add `last_committer_date` and `last_author_date` in the content API which is not implemented by Github API v3 at the moment. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor Branch struct in package modules/git (#33980)Lunny Xiao2025-04-022-3/+4
| | | | The `Branch` struct in `modules/git` package is unnecessary. We can just use a `string` to represent a branch
* Support creating relative link to raw path in markdown (#34105)wxiaoguang2025-04-031-0/+1
| | | Fix #34104
* Do not show 500 error when default branch doesn't exist (#34096)wxiaoguang2025-04-011-0/+11
| | | Fix #34090
* Enable addtional linters (#34085)TheFox0x72025-04-0161-250/+248
| | | | | | | | enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [Fix] Resolve the problem of commit_statuses not being loaded at the top - ↵Kerwin Bryant2025-03-311-2/+2
| | | | | right when switching files from the file tree (#34079) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enable testifylint rules (#34075)TheFox0x72025-03-3186-605/+570
| | | | enable testifylint rules disabled in: https://github.com/go-gitea/gitea/pull/34054
* Add a config option to block "expensive" pages for anonymous users (#34024)wxiaoguang2025-03-305-8/+35
| | | | | | | | | | | Fix #33966 ``` ;; User must sign in to view anything. ;; It could be set to "expensive" to block anonymous users accessing some pages which consume a lot of resources, ;; for example: block anonymous AI crawlers from accessing repo code pages. ;; The "expensive" mode is experimental and subject to change. ;REQUIRE_SIGNIN_VIEW = false ```
* Add anonymous access support for private/unlisted repositories (#34051)wxiaoguang2025-03-291-85/+136
| | | | | | | | | | | Follow #33127 Fix #8649, fix #639 This is a complete solution. A repo unit could be set to: * Anonymous read (non-signed-in user) * Everyone read (signed-in user) * Everyone write (wiki-only)
* Fix bug on downloading job logs (#34041)Lunny Xiao2025-03-271-69/+116
| | | Fix #34038
* Fix git client accessing renamed repo (#34034)wxiaoguang2025-03-281-1/+24
| | | | | | | | Fix #28460 The `reqGitSignIn` is just copied-pasted code (from githtttp.go) and causes the regression bug. Co-authored-by: Giteabot <teabot@gitea.io>
* fix org repo creation being limited by user limits (#34030)TheFox0x72025-03-271-4/+4
| | | | | | | | | | | fixes an issue where user is unable to create new repository in organization via UI if repository limits are in place and user has exhausted them for their own namespace. closes: https://github.com/go-gitea/gitea/issues/15504 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Download actions job logs from API (#33858)Lunny Xiao2025-03-261-0/+23
| | | | | | | | | | | | | | Related to #33709, #31416 It's similar with https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run--code-samples. This use `job_id` as path parameter which is consistent with Github's APIs. --------- Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix some migration and repo name problems (#33986)wxiaoguang2025-03-241-9/+21
| | | | | | 1. Ignore empty inputs in `UnmarshalHandleDoubleEncode` 2. Ignore non-existing `stateEvent.User` in gitlab migration 3. Enable `release` and `wiki` units when they are selected in migration 4. Sanitize repo name for migration and new repo
* Use filepath.Join instead of path.Join for file system file operations (#33978)Lunny Xiao2025-03-242-6/+5
|
* Auto expand "New PR" form (#33971)wxiaoguang2025-03-241-19/+34
| | | Follow GitHub's behavior: use `?expand=1` to expand the "New PR" form
* Improve oauth2 error handling (#33969)wxiaoguang2025-03-221-1/+1
| | | | Show the callback error to end users, it should be safe. Fix #33967
* Added Description Field for Secrets and Variables (#33526)John Smith2025-03-172-4/+31
| | | | | | | Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Give organisation members access to organisation feeds (#33508)Job2025-03-153-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | Currently the organisation feed only includes items for public repositories (for non-administrators). This pull requests adds notifications from private repositories to the organisation-feed (for accounts that have access to the organisation). Feed-items only get shown for repositories where the users team(s) should have access to, this filtering seems to get done by some existing code. Needs some tests, but am unsure where/how to add them. Before: ![image](https://github.com/user-attachments/assets/8b63f430-227a-4b19-ad1a-f6f5175de301) After: ![image](https://github.com/user-attachments/assets/b439ce0e-4946-421c-a399-421806c7a6d8) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Feature: Ephemeral action runners (#33570)ChristopherHX2025-03-144-12/+165
| | | | | | | | * This includes a runner mock test for hardend PickTask behavior like described in my proposal * Runner register ephemeral flag introduced in https://gitea.com/gitea/act_runner/pulls/649 Closes #32461
* Improve repo commit view (#33877)wxiaoguang2025-03-148-42/+90
| | | | | | | | | | | | | | | | | Fix #24623 Major changes: 1. Redirect `/owner/repo/blob/*` requests to `/owner/repo/src/commit/*` (like GitHub) 2. Add a "view file diff" link (see screenshot below) 3. Refactor "AssertHTMLElement" to generic, now we can accurately assert existence or number. 4. Add more tests --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: delvh <dev.lh@web.de>
* Pull request updates will also trigger code owners review requests (#33744)Lunny Xiao2025-03-131-3/+39
| | | | | | | | | | Fix #33490 It will only read the changed file on the pushed commits but not all the files of this PR. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>