Skip to content

Commit

Permalink
RELTEC-11852: added "mergeConfig" as optional configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mplushnikov committed Jun 14, 2024
1 parent 4b6c15f commit 0dacc7a
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 9 deletions.
12 changes: 11 additions & 1 deletion api/generated_apimodel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 50 additions & 8 deletions api/openapi-v3-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2651,11 +2651,10 @@
}
],
"example": {
"url": "/swagger-ui/index.html",
"title": "SwaggerUI",
"description": "Displays the frontend for the API."
}

"url": "/swagger-ui/index.html",
"title": "SwaggerUI",
"description": "Displays the frontend for the API."
}
},
"Link": {
"type": "object",
Expand All @@ -2669,9 +2668,9 @@
},
"description": "A link ",
"example": {
"url": "/swagger-ui/index.html",
"title": "SwaggerUI"
}
"url": "/swagger-ui/index.html",
"title": "SwaggerUI"
}
},
"RepositoryDto": {
"required": [
Expand Down Expand Up @@ -2944,6 +2943,20 @@
"$ref": "#/components/schemas/RepositoryConfigurationAccessKeyDto"
}
},
"mergeConfig": {
"type": "object",
"properties": {
"defaultStrategy": {
"$ref": "#/components/schemas/MergeStrategy"
},
"strategies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MergeStrategy"
}
}
}
},
"commitMessageType": {
"type": "string",
"description": "Adds a corresponding commit message regex.",
Expand Down Expand Up @@ -3028,6 +3041,35 @@
}
}
},
"MergeStrategy": {
"type": "object",
"required": ["id"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"enum": [
"no-ff",
"ff",
"ff-only",
"squash",
"squash-ff-only",
"rebase-no-ff",
"rebase-ff-only"
],
"example": [
"no-ff",
"ff",
"ff-only",
"squash",
"squash-ff-only",
"rebase-no-ff",
"rebase-ff-only"
]
}
},
"title": "Strategy"
},
"RepositoryConfigurationAccessKeyDto": {
"properties": {
"key": {
Expand Down
10 changes: 10 additions & 0 deletions test/mock/metadatamock/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,19 @@ configuration:
accessKeys:
- key: DEPLOYMENT
permission: REPO_READ
- data: 'ssh-key abcdefgh.....'
permission: REPO_WRITE
webhooks:
pipelineTrigger: true
commitMessageType: DEFAULT
mergeConfig:
defaultStrategy:
id: "no-ff"
strategies:
- id: "no-ff"
- id: "ff"
- id: "ff-only"
- id: "squash"
requireIssue: true
approvers:
testing:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{
"key": "DEPLOYMENT",
"permission": "REPO_READ"
},
{
"data": "ssh-key abcdefgh.....",
"permission": "REPO_WRITE"
}
],
"approvers": {
Expand All @@ -15,6 +19,25 @@
]
},
"commitMessageType": "DEFAULT",
"mergeConfig": {
"defaultStrategy": {
"id": "no-ff"
},
"strategies": [
{
"id": "no-ff"
},
{
"id": "ff"
},
{
"id": "ff-only"
},
{
"id": "squash"
}
]
},
"requireIssue": true,
"webhooks": {
"pipelineTrigger": true
Expand Down
23 changes: 23 additions & 0 deletions test/resources/acceptance-expected/repositories.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
{
"key": "DEPLOYMENT",
"permission": "REPO_READ"
},
{
"data": "ssh-key abcdefgh.....",
"permission": "REPO_WRITE"
}
],
"approvers": {
Expand All @@ -42,6 +46,25 @@
]
},
"commitMessageType": "DEFAULT",
"mergeConfig": {
"defaultStrategy": {
"id": "no-ff"
},
"strategies": [
{
"id": "no-ff"
},
{
"id": "ff"
},
{
"id": "ff-only"
},
{
"id": "squash"
}
]
},
"requireIssue": true,
"webhooks": {
"pipelineTrigger": true
Expand Down
23 changes: 23 additions & 0 deletions test/resources/acceptance-expected/repository.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{
"key": "DEPLOYMENT",
"permission": "REPO_READ"
},
{
"data": "ssh-key abcdefgh.....",
"permission": "REPO_WRITE"
}
],
"approvers": {
Expand All @@ -13,6 +17,25 @@
]
},
"commitMessageType": "DEFAULT",
"mergeConfig": {
"defaultStrategy": {
"id": "no-ff"
},
"strategies": [
{
"id": "no-ff"
},
{
"id": "ff"
},
{
"id": "ff-only"
},
{
"id": "squash"
}
]
},
"requireIssue": true,
"webhooks": {
"pipelineTrigger": true
Expand Down

0 comments on commit 0dacc7a

Please sign in to comment.