Compare commits

...

2 Commits

Author SHA1 Message Date
wxiaoguang
81ee93e5bc Fix repo settings and protocol log problems (#35012) (#35013)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
release-nightly / nightly-docker-rootless (push) Has been cancelled
Backport #35012
2025-07-09 17:20:15 +00:00
ChristopherHX
053f9186bc Fix the response format for actions/workflows. (#35009) (#35016)
Backport #35009

This PR fixes the response format for the OpenAPI Spec of
`ActionsListRepositoryWorkflows`.
It was specified in the OpenAPI spec as returning a `[]*ActionWorkflow`,
but it actually should return a `api.ActionWorkflowResponse`.

The test already expects an `api.ActionWorkflowResponse` like expected.

Co-authored-by: Scion <Filiecs2@gmail.com>
2025-07-09 18:18:40 +02:00
4 changed files with 32 additions and 12 deletions

View File

@@ -275,7 +275,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
HTTPAddr = filepath.Join(AppWorkPath, HTTPAddr)
}
default:
log.Fatal("Invalid PROTOCOL %q", Protocol)
log.Fatal("Invalid PROTOCOL %q", protocolCfg)
}
UseProxyProtocol = sec.Key("USE_PROXY_PROTOCOL").MustBool(false)
ProxyProtocolTLSBridging = sec.Key("PROXY_PROTOCOL_TLS_BRIDGING").MustBool(false)

View File

@@ -44,5 +44,5 @@ type swaggerResponseActionWorkflow struct {
// swagger:response ActionWorkflowList
type swaggerResponseActionWorkflowList struct {
// in:body
Body []api.ActionWorkflow `json:"body"`
Body api.ActionWorkflowResponse `json:"body"`
}

View File

@@ -20327,6 +20327,25 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"ActionWorkflowResponse": {
"description": "ActionWorkflowResponse returns a ActionWorkflow",
"type": "object",
"properties": {
"total_count": {
"type": "integer",
"format": "int64",
"x-go-name": "TotalCount"
},
"workflows": {
"type": "array",
"items": {
"$ref": "#/definitions/ActionWorkflow"
},
"x-go-name": "Workflows"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"ActionWorkflowRun": {
"description": "ActionWorkflowRun represents a WorkflowRun",
"type": "object",
@@ -27464,10 +27483,7 @@
"ActionWorkflowList": {
"description": "ActionWorkflowList",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ActionWorkflow"
}
"$ref": "#/definitions/ActionWorkflowResponse"
}
},
"ActivityFeedsList": {

View File

@@ -1,6 +1,6 @@
import {minimatch} from 'minimatch';
import {createMonaco} from './codeeditor.ts';
import {onInputDebounce, queryElems, toggleClass, toggleElem} from '../utils/dom.ts';
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {initRepoSettingsBranchesDrag} from './repo-settings-branches.ts';
import {fomanticQuery} from '../modules/fomantic/base.ts';
@@ -124,14 +124,18 @@ function initRepoSettingsOptions() {
const pageContent = document.querySelector('.page-content.repository.settings.options');
if (!pageContent) return;
// Enable or select internal/external wiki system and issue tracker.
// toggle related panels for the checkbox/radio inputs, the "selector" may not exist
const toggleTargetContextPanel = (selector: string, enabled: boolean) => {
if (!selector) return;
queryElems(document, selector, (el) => el.classList.toggle('disabled', !enabled));
};
queryElems<HTMLInputElement>(pageContent, '.enable-system', (el) => el.addEventListener('change', () => {
toggleClass(el.getAttribute('data-target'), 'disabled', !el.checked);
toggleClass(el.getAttribute('data-context'), 'disabled', el.checked);
toggleTargetContextPanel(el.getAttribute('data-target'), el.checked);
toggleTargetContextPanel(el.getAttribute('data-context'), !el.checked);
}));
queryElems<HTMLInputElement>(pageContent, '.enable-system-radio', (el) => el.addEventListener('change', () => {
toggleClass(el.getAttribute('data-target'), 'disabled', el.value === 'false');
toggleClass(el.getAttribute('data-context'), 'disabled', el.value === 'true');
toggleTargetContextPanel(el.getAttribute('data-target'), el.value === 'true');
toggleTargetContextPanel(el.getAttribute('data-context'), el.value === 'false');
}));
queryElems<HTMLInputElement>(pageContent, '.js-tracker-issue-style', (el) => el.addEventListener('change', () => {