Skip to content

Commit 8d6b3c3

Browse files
Merge branch 'main' into feat-32257-add-comments-unchanged-lines-and-show
2 parents 51a70e3 + 5bc030e commit 8d6b3c3

File tree

89 files changed

+1433
-1082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1433
-1082
lines changed

.eslintrc.yaml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ parserOptions:
1616
parser: "@typescript-eslint/parser" # for vue plugin - https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
1717

1818
settings:
19-
import/extensions: [".js", ".ts"]
20-
import/parsers:
19+
import-x/extensions: [".js", ".ts"]
20+
import-x/parsers:
2121
"@typescript-eslint/parser": [".js", ".ts"]
22-
import/resolver:
22+
import-x/resolver:
2323
typescript: true
2424

2525
plugins:
@@ -28,7 +28,7 @@ plugins:
2828
- "@typescript-eslint/eslint-plugin"
2929
- eslint-plugin-array-func
3030
- eslint-plugin-github
31-
- eslint-plugin-i
31+
- eslint-plugin-import-x
3232
- eslint-plugin-no-jquery
3333
- eslint-plugin-no-use-extend-native
3434
- eslint-plugin-regexp
@@ -58,15 +58,15 @@ overrides:
5858
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
5959
- files: ["*.config.*"]
6060
rules:
61-
i/no-unused-modules: [0]
61+
import-x/no-unused-modules: [0]
6262
- files: ["**/*.d.ts"]
6363
rules:
64-
i/no-unused-modules: [0]
64+
import-x/no-unused-modules: [0]
6565
"@typescript-eslint/consistent-type-definitions": [0]
6666
"@typescript-eslint/consistent-type-imports": [0]
6767
- files: ["web_src/js/types.ts"]
6868
rules:
69-
i/no-unused-modules: [0]
69+
import-x/no-unused-modules: [0]
7070
- files: ["**/*.test.*", "web_src/js/test/setup.ts"]
7171
env:
7272
vitest-globals/env: true
@@ -394,49 +394,49 @@ rules:
394394
id-blacklist: [0]
395395
id-length: [0]
396396
id-match: [0]
397-
i/consistent-type-specifier-style: [0]
398-
i/default: [0]
399-
i/dynamic-import-chunkname: [0]
400-
i/export: [2]
401-
i/exports-last: [0]
402-
i/extensions: [2, always, {ignorePackages: true}]
403-
i/first: [2]
404-
i/group-exports: [0]
405-
i/max-dependencies: [0]
406-
i/named: [2]
407-
i/namespace: [0]
408-
i/newline-after-import: [0]
409-
i/no-absolute-path: [0]
410-
i/no-amd: [2]
411-
i/no-anonymous-default-export: [0]
412-
i/no-commonjs: [2]
413-
i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
414-
i/no-default-export: [0]
415-
i/no-deprecated: [0]
416-
i/no-dynamic-require: [0]
417-
i/no-empty-named-blocks: [2]
418-
i/no-extraneous-dependencies: [2]
419-
i/no-import-module-exports: [0]
420-
i/no-internal-modules: [0]
421-
i/no-mutable-exports: [0]
422-
i/no-named-as-default-member: [0]
423-
i/no-named-as-default: [0]
424-
i/no-named-default: [0]
425-
i/no-named-export: [0]
426-
i/no-namespace: [0]
427-
i/no-nodejs-modules: [0]
428-
i/no-relative-packages: [0]
429-
i/no-relative-parent-imports: [0]
430-
i/no-restricted-paths: [0]
431-
i/no-self-import: [2]
432-
i/no-unassigned-import: [0]
433-
i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
434-
i/no-unused-modules: [2, {unusedExports: true}]
435-
i/no-useless-path-segments: [2, {commonjs: true}]
436-
i/no-webpack-loader-syntax: [2]
437-
i/order: [0]
438-
i/prefer-default-export: [0]
439-
i/unambiguous: [0]
397+
import-x/consistent-type-specifier-style: [0]
398+
import-x/default: [0]
399+
import-x/dynamic-import-chunkname: [0]
400+
import-x/export: [2]
401+
import-x/exports-last: [0]
402+
import-x/extensions: [2, always, {ignorePackages: true}]
403+
import-x/first: [2]
404+
import-x/group-exports: [0]
405+
import-x/max-dependencies: [0]
406+
import-x/named: [2]
407+
import-x/namespace: [0]
408+
import-x/newline-after-import: [0]
409+
import-x/no-absolute-path: [0]
410+
import-x/no-amd: [2]
411+
import-x/no-anonymous-default-export: [0]
412+
import-x/no-commonjs: [2]
413+
import-x/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
414+
import-x/no-default-export: [0]
415+
import-x/no-deprecated: [0]
416+
import-x/no-dynamic-require: [0]
417+
import-x/no-empty-named-blocks: [2]
418+
import-x/no-extraneous-dependencies: [2]
419+
import-x/no-import-module-exports: [0]
420+
import-x/no-internal-modules: [0]
421+
import-x/no-mutable-exports: [0]
422+
import-x/no-named-as-default-member: [0]
423+
import-x/no-named-as-default: [0]
424+
import-x/no-named-default: [0]
425+
import-x/no-named-export: [0]
426+
import-x/no-namespace: [0]
427+
import-x/no-nodejs-modules: [0]
428+
import-x/no-relative-packages: [0]
429+
import-x/no-relative-parent-imports: [0]
430+
import-x/no-restricted-paths: [0]
431+
import-x/no-self-import: [2]
432+
import-x/no-unassigned-import: [0]
433+
import-x/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
434+
import-x/no-unused-modules: [2, {unusedExports: true}]
435+
import-x/no-useless-path-segments: [2, {commonjs: true}]
436+
import-x/no-webpack-loader-syntax: [2]
437+
import-x/order: [0]
438+
import-x/prefer-default-export: [0]
439+
import-x/unambiguous: [0]
440440
init-declarations: [0]
441441
line-comment-position: [0]
442442
logical-assignment-operators: [0]

.github/actionlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ self-hosted-runner:
33
- actuated-4cpu-8gb
44
- actuated-4cpu-16gb
55
- nscloud
6+
- namespace-profile-gitea-release-docker
7+
- namespace-profile-gitea-release-binary

.github/workflows/release-nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
nightly-binary:
13-
runs-on: nscloud
13+
runs-on: namespace-profile-gitea-release-binary
1414
steps:
1515
- uses: actions/checkout@v4
1616
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -58,7 +58,7 @@ jobs:
5858
run: |
5959
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
6060
nightly-docker-rootful:
61-
runs-on: ubuntu-latest
61+
runs-on: namespace-profile-gitea-release-docker
6262
steps:
6363
- uses: actions/checkout@v4
6464
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -95,7 +95,7 @@ jobs:
9595
push: true
9696
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
9797
nightly-docker-rootless:
98-
runs-on: ubuntu-latest
98+
runs-on: namespace-profile-gitea-release-docker
9999
steps:
100100
- uses: actions/checkout@v4
101101
# fetch all commits instead of only the last as some branches are long lived and could have many between versions

.github/workflows/release-tag-rc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
binary:
14-
runs-on: nscloud
14+
runs-on: namespace-profile-gitea-release-binary
1515
steps:
1616
- uses: actions/checkout@v4
1717
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -68,7 +68,7 @@ jobs:
6868
env:
6969
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
7070
docker-rootful:
71-
runs-on: ubuntu-latest
71+
runs-on: namespace-profile-gitea-release-docker
7272
steps:
7373
- uses: actions/checkout@v4
7474
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -99,7 +99,7 @@ jobs:
9999
tags: ${{ steps.meta.outputs.tags }}
100100
labels: ${{ steps.meta.outputs.labels }}
101101
docker-rootless:
102-
runs-on: ubuntu-latest
102+
runs-on: namespace-profile-gitea-release-docker
103103
steps:
104104
- uses: actions/checkout@v4
105105
# fetch all commits instead of only the last as some branches are long lived and could have many between versions

.github/workflows/release-tag-version.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
jobs:
1515
binary:
16-
runs-on: nscloud
16+
runs-on: namespace-profile-gitea-release-binary
1717
steps:
1818
- uses: actions/checkout@v4
1919
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -70,7 +70,7 @@ jobs:
7070
env:
7171
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
7272
docker-rootful:
73-
runs-on: ubuntu-latest
73+
runs-on: namespace-profile-gitea-release-docker
7474
steps:
7575
- uses: actions/checkout@v4
7676
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
@@ -105,7 +105,7 @@ jobs:
105105
tags: ${{ steps.meta.outputs.tags }}
106106
labels: ${{ steps.meta.outputs.labels }}
107107
docker-rootless:
108-
runs-on: ubuntu-latest
108+
runs-on: namespace-profile-gitea-release-docker
109109
steps:
110110
- uses: actions/checkout@v4
111111
# fetch all commits instead of only the last as some branches are long lived and could have many between versions

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/ethantkoenig/rupture v1.0.1
4949
github.com/felixge/fgprof v0.9.5
5050
github.com/fsnotify/fsnotify v1.7.0
51-
github.com/gliderlabs/ssh v0.3.7
51+
github.com/gliderlabs/ssh v0.3.8
5252
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c
5353
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
5454
github.com/go-chi/chi/v5 v5.1.0
@@ -121,13 +121,13 @@ require (
121121
github.com/yuin/goldmark v1.7.8
122122
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
123123
github.com/yuin/goldmark-meta v1.1.0
124-
golang.org/x/crypto v0.28.0
124+
golang.org/x/crypto v0.31.0
125125
golang.org/x/image v0.21.0
126126
golang.org/x/net v0.30.0
127127
golang.org/x/oauth2 v0.23.0
128-
golang.org/x/sync v0.8.0
129-
golang.org/x/sys v0.26.0
130-
golang.org/x/text v0.19.0
128+
golang.org/x/sync v0.10.0
129+
golang.org/x/sys v0.28.0
130+
golang.org/x/text v0.21.0
131131
golang.org/x/tools v0.26.0
132132
google.golang.org/grpc v1.67.1
133133
google.golang.org/protobuf v1.35.1

go.sum

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv
293293
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
294294
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1 h1:mtDjlmloH7ytdblogrMz1/8Hqua1y8B4ID+bh3rvod0=
295295
github.com/git-lfs/pktline v0.0.0-20230103162542-ca444d533ef1/go.mod h1:fenKRzpXDjNpsIBhuhUzvjCKlDjKam0boRAenTE0Q6A=
296-
github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE=
297-
github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
296+
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
297+
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
298298
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
299299
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
300300
github.com/go-ap/activitypub v0.0.0-20240910141749-b4b8c8aa484c h1:82lzmsy5Nr6JA6HcLRVxGfbdSoWfW45C6jnY3zFS7Ks=
@@ -893,8 +893,9 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
893893
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
894894
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
895895
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
896-
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
897896
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
897+
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
898+
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
898899
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
899900
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
900901
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
@@ -946,8 +947,9 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
946947
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
947948
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
948949
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
949-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
950950
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
951+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
952+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
951953
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
952954
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
953955
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -982,8 +984,9 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
982984
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
983985
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
984986
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
985-
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
986987
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
988+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
989+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
987990
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
988991
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
989992
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -996,8 +999,9 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
996999
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
9971000
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
9981001
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
999-
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
10001002
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
1003+
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
1004+
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
10011005
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
10021006
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
10031007
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -1009,8 +1013,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
10091013
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
10101014
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
10111015
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
1012-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
10131016
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
1017+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
1018+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
10141019
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
10151020
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
10161021
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

models/actions/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type ActionRun struct {
3737
TriggerUser *user_model.User `xorm:"-"`
3838
ScheduleID int64
3939
Ref string `xorm:"index"` // the commit/tag/… that caused the run
40+
IsRefDeleted bool `xorm:"-"`
4041
CommitSHA string
4142
IsForkPullRequest bool // If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
4243
NeedApproval bool // may need approval if it's a fork pull request

models/db/context_committer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package db // it's not db_test, because this file is for testing the private type halfCommitter
55

66
import (
7-
"fmt"
7+
"errors"
88
"testing"
99

1010
"github.com/stretchr/testify/assert"
@@ -80,7 +80,7 @@ func Test_halfCommitter(t *testing.T) {
8080
testWithCommitter(mockCommitter, func(committer Committer) error {
8181
defer committer.Close()
8282
if true {
83-
return fmt.Errorf("error")
83+
return errors.New("error")
8484
}
8585
return committer.Commit()
8686
})
@@ -94,7 +94,7 @@ func Test_halfCommitter(t *testing.T) {
9494
testWithCommitter(mockCommitter, func(committer Committer) error {
9595
committer.Close()
9696
committer.Commit()
97-
return fmt.Errorf("error")
97+
return errors.New("error")
9898
})
9999

100100
mockCommitter.Assert(t)

models/git/branch.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
repo_model "code.gitea.io/gitea/models/repo"
1313
"code.gitea.io/gitea/models/unit"
1414
user_model "code.gitea.io/gitea/models/user"
15+
"code.gitea.io/gitea/modules/container"
1516
"code.gitea.io/gitea/modules/git"
1617
"code.gitea.io/gitea/modules/log"
1718
"code.gitea.io/gitea/modules/optional"
@@ -169,9 +170,22 @@ func GetBranch(ctx context.Context, repoID int64, branchName string) (*Branch, e
169170
return &branch, nil
170171
}
171172

172-
func GetBranches(ctx context.Context, repoID int64, branchNames []string) ([]*Branch, error) {
173+
func GetBranches(ctx context.Context, repoID int64, branchNames []string, includeDeleted bool) ([]*Branch, error) {
173174
branches := make([]*Branch, 0, len(branchNames))
174-
return branches, db.GetEngine(ctx).Where("repo_id=?", repoID).In("name", branchNames).Find(&branches)
175+
176+
sess := db.GetEngine(ctx).Where("repo_id=?", repoID).In("name", branchNames)
177+
if !includeDeleted {
178+
sess.And("is_deleted=?", false)
179+
}
180+
return branches, sess.Find(&branches)
181+
}
182+
183+
func BranchesToNamesSet(branches []*Branch) container.Set[string] {
184+
names := make(container.Set[string], len(branches))
185+
for _, branch := range branches {
186+
names.Add(branch.Name)
187+
}
188+
return names
175189
}
176190

177191
func AddBranches(ctx context.Context, branches []*Branch) error {

0 commit comments

Comments
 (0)