refactor(gitops/sources): split source get/list handler [BE-13207] (#3203)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Chaim Lev-Ari
2026-07-21 17:11:20 +03:00
committed by GitHub
parent d09b50b95a
commit ae8e09f777
37 changed files with 984 additions and 898 deletions
+70 -51
View File
@@ -3208,8 +3208,8 @@ paths:
- gitops
get:
description: >-
Returns a single GitOps source with its connection settings and linked
workflows.
Returns a single GitOps source with its connection settings and access
rules.
**Access policy**: authenticated
operationId: GitOpsSourceGet
@@ -3367,6 +3367,44 @@ paths:
summary: Test the connection of a stored source
tags:
- gitops
"/gitops/sources/{id}/workflows":
get:
description: >-
Returns the workflows (stacks or edge stacks) currently deployed from
this source.
**Access policy**: authenticated
operationId: GitOpsSourceWorkflowsList
parameters:
- description: Source identifier
in: path
name: id
required: true
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
items:
$ref: "#/components/schemas/sources.Workflow"
type: array
"400":
description: Invalid request
"403":
description: Access denied
"404":
description: Source not found
"500":
description: Server error
security:
- ApiKeyAuth: []
- jwt: []
summary: List the workflows using a GitOps source
tags:
- gitops
/gitops/sources/git:
post:
description: |-
@@ -16647,13 +16685,6 @@ components:
example: 5m
type: string
type: object
sources.AutoUpdateInfo:
properties:
fetchInterval:
type: string
mechanism:
type: string
type: object
sources.ConnectionTestResult:
properties:
error:
@@ -16777,12 +16808,8 @@ components:
properties:
access:
$ref: "#/components/schemas/sources.SourceAccess"
autoUpdate:
$ref: "#/components/schemas/sources.AutoUpdateInfo"
connection:
$ref: "#/components/schemas/sources.connectionInfo"
environments:
type: integer
error:
type: string
id:
@@ -16800,12 +16827,6 @@ components:
$ref: "#/components/schemas/sources.SourceType"
url:
type: string
usedBy:
type: integer
workflows:
items:
$ref: "#/components/schemas/workflows.SourceWorkflow"
type: array
required:
- connection
- id
@@ -16834,6 +16855,36 @@ components:
- SourceStatusUnknown
- SourceStatusHealthy
- SourceStatusError
sources.Workflow:
properties:
creationDate:
type: integer
gitConfig:
$ref: "#/components/schemas/gittypes.RepoConfig"
id:
type: integer
lastSyncDate:
type: integer
name:
type: string
platform:
$ref: "#/components/schemas/workflows.DeploymentPlatform"
sourceId:
type: integer
status:
$ref: "#/components/schemas/workflows.WorkflowStatusObject"
target:
$ref: "#/components/schemas/workflows.Target"
type:
$ref: "#/components/schemas/workflows.Type"
required:
- id
- name
- platform
- status
- target
- type
type: object
sources.connectionInfo:
properties:
authentication:
@@ -21477,38 +21528,6 @@ components:
- DeploymentPlatformDockerStandalone
- DeploymentPlatformDockerSwarm
- DeploymentPlatformKubernetes
workflows.SourceWorkflow:
properties:
autoUpdate:
$ref: "#/components/schemas/portainer.AutoUpdateSettings"
creationDate:
type: integer
gitConfig:
$ref: "#/components/schemas/gittypes.RepoConfig"
id:
type: integer
lastSyncDate:
type: integer
name:
type: string
platform:
$ref: "#/components/schemas/workflows.DeploymentPlatform"
sourceId:
type: integer
status:
$ref: "#/components/schemas/workflows.WorkflowStatusObject"
target:
$ref: "#/components/schemas/workflows.Target"
type:
$ref: "#/components/schemas/workflows.Type"
required:
- id
- name
- platform
- status
- target
- type
type: object
workflows.Status:
enum:
- healthy
+66 -50
View File
@@ -5651,13 +5651,6 @@ definitions:
example: 5m
type: string
type: object
sources.AutoUpdateInfo:
properties:
fetchInterval:
type: string
mechanism:
type: string
type: object
sources.ConnectionTestResult:
properties:
error:
@@ -5781,12 +5774,8 @@ definitions:
properties:
access:
$ref: '#/definitions/sources.SourceAccess'
autoUpdate:
$ref: '#/definitions/sources.AutoUpdateInfo'
connection:
$ref: '#/definitions/sources.connectionInfo'
environments:
type: integer
error:
type: string
id:
@@ -5804,12 +5793,6 @@ definitions:
$ref: '#/definitions/sources.SourceType'
url:
type: string
usedBy:
type: integer
workflows:
items:
$ref: '#/definitions/workflows.SourceWorkflow'
type: array
required:
- connection
- id
@@ -5838,6 +5821,36 @@ definitions:
- SourceStatusUnknown
- SourceStatusHealthy
- SourceStatusError
sources.Workflow:
properties:
creationDate:
type: integer
gitConfig:
$ref: '#/definitions/gittypes.RepoConfig'
id:
type: integer
lastSyncDate:
type: integer
name:
type: string
platform:
$ref: '#/definitions/workflows.DeploymentPlatform'
sourceId:
type: integer
status:
$ref: '#/definitions/workflows.WorkflowStatusObject'
target:
$ref: '#/definitions/workflows.Target'
type:
$ref: '#/definitions/workflows.Type'
required:
- id
- name
- platform
- status
- target
- type
type: object
sources.connectionInfo:
properties:
authentication:
@@ -9658,38 +9671,6 @@ definitions:
- DeploymentPlatformDockerStandalone
- DeploymentPlatformDockerSwarm
- DeploymentPlatformKubernetes
workflows.SourceWorkflow:
properties:
autoUpdate:
$ref: '#/definitions/portainer.AutoUpdateSettings'
creationDate:
type: integer
gitConfig:
$ref: '#/definitions/gittypes.RepoConfig'
id:
type: integer
lastSyncDate:
type: integer
name:
type: string
platform:
$ref: '#/definitions/workflows.DeploymentPlatform'
sourceId:
type: integer
status:
$ref: '#/definitions/workflows.WorkflowStatusObject'
target:
$ref: '#/definitions/workflows.Target'
type:
$ref: '#/definitions/workflows.Type'
required:
- id
- name
- platform
- status
- target
- type
type: object
workflows.Status:
enum:
- healthy
@@ -12850,7 +12831,7 @@ paths:
- gitops
get:
description: |-
Returns a single GitOps source with its connection settings and linked workflows.
Returns a single GitOps source with its connection settings and access rules.
**Access policy**: authenticated
operationId: GitOpsSourceGet
parameters:
@@ -13004,6 +12985,41 @@ paths:
summary: Test the connection of a stored source
tags:
- gitops
/gitops/sources/{id}/workflows:
get:
description: |-
Returns the workflows (stacks or edge stacks) currently deployed from this source.
**Access policy**: authenticated
operationId: GitOpsSourceWorkflowsList
parameters:
- description: Source identifier
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/sources.Workflow'
type: array
"400":
description: Invalid request
"403":
description: Access denied
"404":
description: Source not found
"500":
description: Server error
security:
- ApiKeyAuth: []
- jwt: []
summary: List the workflows using a GitOps source
tags:
- gitops
/gitops/sources/git:
post:
consumes: