mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 00:00:55 -04:00
Compare commits
No commits in common. "71f091ef9749b5ea166c8398ccf546de467d00c7" and "fb5ae2ab94948eea39b39597eb7a3bcb9f4307e1" have entirely different histories.
71f091ef97
...
fb5ae2ab94
1
.github/actionlint.yaml
vendored
1
.github/actionlint.yaml
vendored
@ -2,4 +2,3 @@ self-hosted-runner:
|
||||
labels:
|
||||
- actuated-4cpu-8gb
|
||||
- actuated-4cpu-16gb
|
||||
- nscloud
|
||||
|
36
.github/workflows/disk-clean.yml
vendored
36
.github/workflows/disk-clean.yml
vendored
@ -1,36 +0,0 @@
|
||||
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:
|
||||
nightly-binary:
|
||||
runs-on: nscloud
|
||||
runs-on: actuated-4cpu-16gb
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# 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//')
|
||||
echo "Cleaned name is ${REF_NAME}"
|
||||
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
|
||||
run: |
|
||||
aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
env:
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: actuated-4cpu-16gb
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# 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
|
||||
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
|
||||
nightly-docker-rootless:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: actuated-4cpu-16gb
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
|
||||
|
@ -149,9 +149,8 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
key := ConfigSectionKey(section, keyName)
|
||||
key := section.Key(keyName)
|
||||
if key == nil {
|
||||
changed = true
|
||||
key, err = section.NewKey(keyName, keyValue)
|
||||
if err != nil {
|
||||
log.Error("Error creating key: %s in section: %s with value: %s : %v", keyName, sectionName, keyValue, err)
|
||||
|
@ -115,29 +115,3 @@ key = old
|
||||
EnvironmentToConfig(cfg, []string{"GITEA__sec__key__FILE=" + tmpFile})
|
||||
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,14 +36,6 @@ func GetNote(ctx *context.APIContext) {
|
||||
// description: a git ref or commit sha
|
||||
// type: string
|
||||
// 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:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Note"
|
||||
@ -86,15 +78,7 @@ func getNote(ctx *context.APIContext, identifier string) {
|
||||
return
|
||||
}
|
||||
|
||||
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,
|
||||
})
|
||||
cmt, err := convert.ToCommit(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, note.Commit, nil, convert.ToCommitOptions{Stat: true})
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "ToCommit", err)
|
||||
return
|
||||
|
@ -1269,14 +1269,6 @@ func GetPullRequestCommits(ctx *context.APIContext) {
|
||||
// in: query
|
||||
// description: page size of results
|
||||
// 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:
|
||||
// "200":
|
||||
// "$ref": "#/responses/CommitList"
|
||||
@ -1330,17 +1322,9 @@ func GetPullRequestCommits(ctx *context.APIContext) {
|
||||
end = totalNumberOfCommits
|
||||
}
|
||||
|
||||
verification := ctx.FormString("verification") == "" || ctx.FormBool("verification")
|
||||
files := ctx.FormString("files") == "" || ctx.FormBool("files")
|
||||
|
||||
apiCommits := make([]*api.Commit, 0, end-start)
|
||||
for i := start; i < end; i++ {
|
||||
apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache,
|
||||
convert.ToCommitOptions{
|
||||
Stat: true,
|
||||
Verification: verification,
|
||||
Files: files,
|
||||
})
|
||||
apiCommit, err := convert.ToCommit(ctx, ctx.Repo.Repository, baseGitRepo, commits[i], userCache, convert.ToCommitOptions{Stat: true})
|
||||
if err != nil {
|
||||
ctx.ServerError("toCommit", err)
|
||||
return
|
||||
|
@ -428,15 +428,15 @@
|
||||
<div class="ui relaxed divided list">
|
||||
{{range .BlockingDependencies}}
|
||||
<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 gt-ellipsis">
|
||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||
</a>
|
||||
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
<div class="text small">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right gt-df gt-ac gt-m-2">
|
||||
<div class="item-right gt-df gt-ac">
|
||||
{{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"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
@ -446,7 +446,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .BlockingDependenciesNotPermitted}}
|
||||
<div class="item gt-df gt-ac gt-sb gt-ellipsis">
|
||||
<div class="item gt-df gt-ac gt-sb">
|
||||
<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
@ -460,15 +460,15 @@
|
||||
<div class="ui relaxed divided list">
|
||||
{{range .BlockedByDependencies}}
|
||||
<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 gt-ellipsis">
|
||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
||||
<a class="title muted" href="{{.Issue.Link}}" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||
</a>
|
||||
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
<div class="text small">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right gt-df gt-ac gt-m-2">
|
||||
<div class="item-right gt-df gt-ac">
|
||||
{{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"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
@ -480,18 +480,18 @@
|
||||
{{if $.CanCreateIssueDependencies}}
|
||||
{{range .BlockedByDependenciesNotPermitted}}
|
||||
<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 gt-ellipsis">
|
||||
<div class="gt-ellipsis">
|
||||
<div class="item-left gt-df gt-jc gt-fc gt-f1">
|
||||
<div>
|
||||
<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}}">
|
||||
#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text small gt-ellipsis" data-tooltip-content="{{.Repository.OwnerName}}/{{.Repository.Name}}">
|
||||
<div class="text small">
|
||||
{{.Repository.OwnerName}}/{{.Repository.Name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-right gt-df gt-ac gt-m-2">
|
||||
<div class="item-right gt-df gt-ac">
|
||||
{{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"}}">
|
||||
{{svg "octicon-trash" 16}}
|
||||
@ -501,7 +501,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{else if .BlockedByDependenciesNotPermitted}}
|
||||
<div class="item gt-df gt-ac gt-sb gt-ellipsis">
|
||||
<div class="item gt-df gt-ac gt-sb">
|
||||
<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
|
||||
</div>
|
||||
{{end}}
|
||||
|
24
templates/swagger/v1_json.tmpl
generated
24
templates/swagger/v1_json.tmpl
generated
@ -5212,18 +5212,6 @@
|
||||
"name": "sha",
|
||||
"in": "path",
|
||||
"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": {
|
||||
@ -10470,18 +10458,6 @@
|
||||
"description": "page size of results",
|
||||
"name": "limit",
|
||||
"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": {
|
||||
|
@ -35,11 +35,6 @@ func TestAPIPullCommits(t *testing.T) {
|
||||
|
||||
assert.Equal(t, "5f22f7d0d95d614d25a5b68592adb345a4b5c7fd", commits[0].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
|
||||
|
@ -37,7 +37,5 @@ func TestAPIReposGitNotes(t *testing.T) {
|
||||
var apiData api.Note
|
||||
DecodeJSON(t, resp, &apiData)
|
||||
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,10 +95,23 @@
|
||||
}
|
||||
|
||||
.repository .issue-content-right .ui.list .title {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
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 {
|
||||
width: 12.8rem;
|
||||
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
||||
|
@ -57,15 +57,6 @@ function updateSelectionLabel($label) {
|
||||
function delegateOne($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)
|
||||
const dropdownTemplates = {...dropdownCall('setting', 'templates'), t: performance.now()};
|
||||
const dropdownTemplatesMenuOld = dropdownTemplates.menu;
|
||||
|
@ -16,6 +16,9 @@ export function initGiteaFomantic() {
|
||||
$.fn.dropdown.settings.fullTextSearch = 'exact';
|
||||
// Do not use "cursor: pointer" for dropdown labels
|
||||
$.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
|
||||
$.fn.dropdown.settings.templates.label = function(_value, text, preserveHTML, className) {
|
||||
const escape = $.fn.dropdown.settings.templates.escape;
|
||||
|
Loading…
x
Reference in New Issue
Block a user