mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 00:00:55 -04:00
Compare commits
6 Commits
fb5ae2ab94
...
71f091ef97
Author | SHA1 | Date | |
---|---|---|---|
|
71f091ef97 | ||
|
9a64a24f29 | ||
|
d8513fc312 | ||
|
8c969cdf9c | ||
|
4c9f7d0710 | ||
|
a1ee172fb0 |
1
.github/actionlint.yaml
vendored
1
.github/actionlint.yaml
vendored
@ -2,3 +2,4 @@ self-hosted-runner:
|
|||||||
labels:
|
labels:
|
||||||
- actuated-4cpu-8gb
|
- actuated-4cpu-8gb
|
||||||
- actuated-4cpu-16gb
|
- actuated-4cpu-16gb
|
||||||
|
- nscloud
|
||||||
|
36
.github/workflows/disk-clean.yml
vendored
Normal file
36
.github/workflows/disk-clean.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: disk-clean
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
triage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# FIXME: https://github.com/jlumbroso/free-disk-space/issues/17
|
||||||
|
- name: same as 'large-packages' but without 'google-cloud-sdk'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get remove -y '^dotnet-.*'
|
||||||
|
sudo apt-get remove -y '^llvm-.*'
|
||||||
|
sudo apt-get remove -y 'php.*'
|
||||||
|
sudo apt-get remove -y '^mongodb-.*'
|
||||||
|
sudo apt-get remove -y '^mysql-.*'
|
||||||
|
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
|
||||||
|
sudo apt-get autoremove -y
|
||||||
|
sudo apt-get clean
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
# this might remove tools that are actually needed,
|
||||||
|
# if set to "true" but frees about 6 GB
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
# all of these default to true, but feel free to set to
|
||||||
|
# "false" if necessary for your workflow
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: false
|
||||||
|
docker-images: false
|
||||||
|
swap-storage: true
|
22
.github/workflows/release-nightly.yml
vendored
22
.github/workflows/release-nightly.yml
vendored
@ -10,7 +10,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nightly-binary:
|
nightly-binary:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: nscloud
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
@ -46,17 +46,17 @@ jobs:
|
|||||||
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
|
||||||
echo "Cleaned name is ${REF_NAME}"
|
echo "Cleaned name is ${REF_NAME}"
|
||||||
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: configure aws
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
- name: upload binaries to s3
|
- name: upload binaries to s3
|
||||||
uses: jakejarvis/s3-sync-action@master
|
run: |
|
||||||
env:
|
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
|
||||||
SOURCE_DIR: dist/release
|
|
||||||
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
|
|
||||||
nightly-docker-rootful:
|
nightly-docker-rootful:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
@ -93,7 +93,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
||||||
nightly-docker-rootless:
|
nightly-docker-rootless:
|
||||||
runs-on: actuated-4cpu-16gb
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||||
|
@ -149,8 +149,9 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
key := section.Key(keyName)
|
key := ConfigSectionKey(section, keyName)
|
||||||
if key == nil {
|
if key == nil {
|
||||||
|
changed = true
|
||||||
key, err = section.NewKey(keyName, keyValue)
|
key, err = section.NewKey(keyName, keyValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Error creating key: %s in section: %s with value: %s : %v", keyName, sectionName, keyValue, err)
|
log.Error("Error creating key: %s in section: %s with value: %s : %v", keyName, sectionName, keyValue, err)
|
||||||
|
@ -115,3 +115,29 @@ key = old
|
|||||||
EnvironmentToConfig(cfg, []string{"GITEA__sec__key__FILE=" + tmpFile})
|
EnvironmentToConfig(cfg, []string{"GITEA__sec__key__FILE=" + tmpFile})
|
||||||
assert.Equal(t, "value-from-file\n", cfg.Section("sec").Key("key").String())
|
assert.Equal(t, "value-from-file\n", cfg.Section("sec").Key("key").String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestEnvironmentToConfigSubSecKey(t *testing.T) {
|
||||||
|
// the INI package has a quirk: by default, the keys are inherited.
|
||||||
|
// when maintaining the keys, the newly added sub key should not be affected by the parent key.
|
||||||
|
cfg, err := NewConfigProviderFromData(`
|
||||||
|
[sec]
|
||||||
|
key = some
|
||||||
|
`)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
changed := EnvironmentToConfig(cfg, []string{"GITEA__sec_0X2E_sub__key=some"})
|
||||||
|
assert.True(t, changed)
|
||||||
|
|
||||||
|
tmpFile := t.TempDir() + "/test-sub-sec-key.ini"
|
||||||
|
defer os.Remove(tmpFile)
|
||||||
|
err = cfg.SaveTo(tmpFile)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
bs, err := os.ReadFile(tmpFile)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, `[sec]
|
||||||
|
key = some
|
||||||
|
|
||||||
|
[sec.sub]
|
||||||
|
key = some
|
||||||
|
`, string(bs))
|
||||||
|
}
|
||||||
|
@ -36,6 +36,14 @@ func GetNote(ctx *context.APIContext) {
|
|||||||
// description: a git ref or commit sha
|
// description: a git ref or commit sha
|
||||||
// type: string
|
// type: string
|
||||||
// required: true
|
// required: true
|
||||||
|
// - name: verification
|
||||||
|
// in: query
|
||||||
|
// description: include verification for every commit (disable for speedup, default 'true')
|
||||||
|
// type: boolean
|
||||||
|
// - name: files
|
||||||
|
// in: query
|
||||||
|
// description: include a list of affected files for every commit (disable for speedup, default 'true')
|
||||||
|
// type: boolean
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Note"
|
// "$ref": "#/responses/Note"
|
||||||
@ -78,7 +86,15 @@ func getNote(ctx *context.APIContext, identifier string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmt, err := convert.ToCommit(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, note.Commit, nil, convert.ToCommitOptions{Stat: true})
|
verification := ctx.FormString("verification") == "" || ctx.FormBool("verification")
|
||||||
|
files := ctx.FormString("files") == "" || ctx.FormBool("files")
|
||||||
|
|
||||||
|
cmt, err := convert.ToCommit(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, note.Commit, nil,
|
||||||
|
convert.ToCommitOptions{
|
||||||
|
Stat: true,
|
||||||
|
Verification: verification,
|
||||||
|
Files: files,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "ToCommit", err)
|
ctx.Error(http.StatusInternalServerError, "ToCommit", err)
|
||||||
return
|
return
|
||||||
|
@ -1269,6 +1269,14 @@ func GetPullRequestCommits(ctx *context.APIContext) {
|
|||||||
// in: query
|
// in: query
|
||||||
// description: page size of results
|
// description: page size of results
|
||||||
// type: integer
|
// type: integer
|
||||||
|
// - name: verification
|
||||||
|
// in: query
|
||||||
|
// description: include verification for every commit (disable for speedup, default 'true')
|
||||||
|
// type: boolean
|
||||||
|
// - name: files
|
||||||
|
// in: query
|
||||||
|
// description: include a list of affected files for every commit (disable for speedup, default 'true')
|
||||||
|
// type: boolean
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/CommitList"
|
// "$ref": "#/responses/CommitList"
|
||||||
@ -1322,9 +1330,17 @@ func GetPullRequestCommits(ctx *context.APIContext) {
|
|||||||
end = totalNumberOfCommits
|
end = totalNumberOfCommits
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verification := ctx.FormString("verification") == "" || ctx.FormBool("verification")
|
||||||
|
files := ctx.FormString("files") == "" || ctx.FormBool("files")
|
||||||
|
|
||||||
apiCommits := make([]*api.Commit, 0, end-start)
|
apiCommits := make([]*api.Commit, 0, end-start)
|
||||||
for i := start; i < end; i++ {
|
for i := start; i < end; i++ {
|
||||||
apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache, convert.ToCommitOptions{Stat: true})
|
apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache,
|
||||||
|
convert.ToCommitOptions{
|
||||||
|
Stat: true,
|
||||||
|
Verification: verification,
|
||||||
|
Files: files,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("toCommit", err)
|
ctx.ServerError("toCommit", err)
|
||||||
return
|
return
|
||||||
|
@ -428,15 +428,15 @@
|
|||||||
<div class="ui relaxed divided list">
|
<div class="ui relaxed divided list">
|
||||||
{{range .BlockingDependencies}}
|
{{range .BlockingDependencies}}
|
||||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
||||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
<div class="item-left gt-df gt-jc gt-fc gt-f1 gt-ellipsis">
|
||||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||||
</a>
|
</a>
|
||||||
<div class="text small">
|
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-right gt-df gt-ac">
|
<div class="item-right gt-df gt-ac gt-m-2">
|
||||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||||
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||||
{{svg "octicon-trash" 16}}
|
{{svg "octicon-trash" 16}}
|
||||||
@ -446,7 +446,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .BlockingDependenciesNotPermitted}}
|
{{if .BlockingDependenciesNotPermitted}}
|
||||||
<div class="item gt-df gt-ac gt-sb">
|
<div class="item gt-df gt-ac gt-sb gt-ellipsis">
|
||||||
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
@ -460,15 +460,15 @@
|
|||||||
<div class="ui relaxed divided list">
|
<div class="ui relaxed divided list">
|
||||||
{{range .BlockedByDependencies}}
|
{{range .BlockedByDependencies}}
|
||||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
||||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
<div class="item-left gt-df gt-jc gt-fc gt-f1 gt-ellipsis">
|
||||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||||
</a>
|
</a>
|
||||||
<div class="text small">
|
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-right gt-df gt-ac">
|
<div class="item-right gt-df gt-ac gt-m-2">
|
||||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||||
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||||
{{svg "octicon-trash" 16}}
|
{{svg "octicon-trash" 16}}
|
||||||
@ -480,18 +480,18 @@
|
|||||||
{{if $.CanCreateIssueDependencies}}
|
{{if $.CanCreateIssueDependencies}}
|
||||||
{{range .BlockedByDependenciesNotPermitted}}
|
{{range .BlockedByDependenciesNotPermitted}}
|
||||||
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
|
||||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
<div class="item-left gt-df gt-jc gt-fc gt-f1 gt-ellipsis">
|
||||||
<div>
|
<div class="gt-ellipsis">
|
||||||
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
|
<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
|
||||||
<span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
<span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text small">
|
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-right gt-df gt-ac">
|
<div class="item-right gt-df gt-ac gt-m-2">
|
||||||
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||||
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
|
||||||
{{svg "octicon-trash" 16}}
|
{{svg "octicon-trash" 16}}
|
||||||
@ -501,7 +501,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if .BlockedByDependenciesNotPermitted}}
|
{{else if .BlockedByDependenciesNotPermitted}}
|
||||||
<div class="item gt-df gt-ac gt-sb">
|
<div class="item gt-df gt-ac gt-sb gt-ellipsis">
|
||||||
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
24
templates/swagger/v1_json.tmpl
generated
24
templates/swagger/v1_json.tmpl
generated
@ -5212,6 +5212,18 @@
|
|||||||
"name": "sha",
|
"name": "sha",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "include verification for every commit (disable for speedup, default 'true')",
|
||||||
|
"name": "verification",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "include a list of affected files for every commit (disable for speedup, default 'true')",
|
||||||
|
"name": "files",
|
||||||
|
"in": "query"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@ -10458,6 +10470,18 @@
|
|||||||
"description": "page size of results",
|
"description": "page size of results",
|
||||||
"name": "limit",
|
"name": "limit",
|
||||||
"in": "query"
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "include verification for every commit (disable for speedup, default 'true')",
|
||||||
|
"name": "verification",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "include a list of affected files for every commit (disable for speedup, default 'true')",
|
||||||
|
"name": "files",
|
||||||
|
"in": "query"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -35,6 +35,11 @@ func TestAPIPullCommits(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, "5f22f7d0d95d614d25a5b68592adb345a4b5c7fd", commits[0].SHA)
|
assert.Equal(t, "5f22f7d0d95d614d25a5b68592adb345a4b5c7fd", commits[0].SHA)
|
||||||
assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", commits[1].SHA)
|
assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", commits[1].SHA)
|
||||||
|
|
||||||
|
assert.NotEmpty(t, commits[0].Files)
|
||||||
|
assert.NotEmpty(t, commits[1].Files)
|
||||||
|
assert.NotNil(t, commits[0].RepoCommit.Verification)
|
||||||
|
assert.NotNil(t, commits[1].RepoCommit.Verification)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO add tests for already merged PR and closed PR
|
// TODO add tests for already merged PR and closed PR
|
||||||
|
@ -37,5 +37,7 @@ func TestAPIReposGitNotes(t *testing.T) {
|
|||||||
var apiData api.Note
|
var apiData api.Note
|
||||||
DecodeJSON(t, resp, &apiData)
|
DecodeJSON(t, resp, &apiData)
|
||||||
assert.Equal(t, "This is a test note\n", apiData.Message)
|
assert.Equal(t, "This is a test note\n", apiData.Message)
|
||||||
|
assert.NotEmpty(t, apiData.Commit.Files)
|
||||||
|
assert.NotNil(t, apiData.Commit.RepoCommit.Verification)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -95,23 +95,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.repository .issue-content-right .ui.list .title {
|
.repository .issue-content-right .ui.list .title {
|
||||||
max-width: 200px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.repository .issue-content-right .ui.list .title {
|
|
||||||
max-width: 150px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1000px) {
|
|
||||||
.repository .issue-content-right .ui.list .title {
|
|
||||||
max-width: 100px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.repository .issue-content-right #deadlineForm input {
|
.repository .issue-content-right #deadlineForm input {
|
||||||
width: 12.8rem;
|
width: 12.8rem;
|
||||||
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
||||||
|
@ -57,6 +57,15 @@ function updateSelectionLabel($label) {
|
|||||||
function delegateOne($dropdown) {
|
function delegateOne($dropdown) {
|
||||||
const dropdownCall = fomanticDropdownFn.bind($dropdown);
|
const dropdownCall = fomanticDropdownFn.bind($dropdown);
|
||||||
|
|
||||||
|
// If there is a "search input" in the "menu", Fomantic will only "focus the input" but not "toggle the menu" when the "dropdown icon" is clicked.
|
||||||
|
// Actually, Fomantic UI doesn't support such layout/usage. It needs to patch the "focusSearch" / "blurSearch" functions to make sure it toggles the menu.
|
||||||
|
const oldFocusSearch = dropdownCall('internal', 'focusSearch');
|
||||||
|
const oldBlurSearch = dropdownCall('internal', 'blurSearch');
|
||||||
|
// * If the "dropdown icon" is clicked, Fomantic calls "focusSearch", so show the menu
|
||||||
|
dropdownCall('internal', 'focusSearch', function () { dropdownCall('show'); oldFocusSearch.call(this) });
|
||||||
|
// * If the "dropdown icon" is clicked again when the menu is visible, Fomantic calls "blurSearch", so hide the menu
|
||||||
|
dropdownCall('internal', 'blurSearch', function () { oldBlurSearch.call(this); dropdownCall('hide') });
|
||||||
|
|
||||||
// the "template" functions are used for dynamic creation (eg: AJAX)
|
// the "template" functions are used for dynamic creation (eg: AJAX)
|
||||||
const dropdownTemplates = {...dropdownCall('setting', 'templates'), t: performance.now()};
|
const dropdownTemplates = {...dropdownCall('setting', 'templates'), t: performance.now()};
|
||||||
const dropdownTemplatesMenuOld = dropdownTemplates.menu;
|
const dropdownTemplatesMenuOld = dropdownTemplates.menu;
|
||||||
|
@ -16,9 +16,6 @@ export function initGiteaFomantic() {
|
|||||||
$.fn.dropdown.settings.fullTextSearch = 'exact';
|
$.fn.dropdown.settings.fullTextSearch = 'exact';
|
||||||
// Do not use "cursor: pointer" for dropdown labels
|
// Do not use "cursor: pointer" for dropdown labels
|
||||||
$.fn.dropdown.settings.className.label += ' gt-cursor-default';
|
$.fn.dropdown.settings.className.label += ' gt-cursor-default';
|
||||||
// The default selector has a bug: if there is a "search input" in the "menu", Fomantic will only "focus the input" but not "toggle the menu" when the "dropdown icon" is clicked.
|
|
||||||
// Actually, the "search input in menu" shouldn't be considered as the dropdown's input
|
|
||||||
$.fn.dropdown.settings.selector.search = '> input.search, :not(.menu) > .search > input, :not(.menu) input.search';
|
|
||||||
// Always use Gitea's SVG icons
|
// Always use Gitea's SVG icons
|
||||||
$.fn.dropdown.settings.templates.label = function(_value, text, preserveHTML, className) {
|
$.fn.dropdown.settings.templates.label = function(_value, text, preserveHTML, className) {
|
||||||
const escape = $.fn.dropdown.settings.templates.escape;
|
const escape = $.fn.dropdown.settings.templates.escape;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user