Skip to content

Commit 577d81e

Browse files
committed
feat: git connector
1 parent 19659c3 commit 577d81e

File tree

8 files changed

+358
-62
lines changed

8 files changed

+358
-62
lines changed

.github/workflows/dry-run-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
node-version-file: '.nvmrc'
3131
- name: Install dependencies
32-
run: npm ci
32+
run: npm install
3333
- name: Dry-run release
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
node-version-file: '.nvmrc'
2121
- name: Install dependencies
22-
run: npm ci
22+
run: npm install
2323
- name: Release
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ build
77
/specifications/merged.yaml
88
/version.txt
99
node_modules
10+
/specifications/*.tgz

api-server-stubs-ktor/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ fabrikt {
3636
}
3737
generate("mavenConnector") {
3838
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/maven-connector-v1.yaml")
39-
basePackage = "org.modelix.services.maven_connector.stubs"
39+
basePackage = "org.modelix.services.mavenconnector.stubs"
40+
}
41+
generate("gitConnector") {
42+
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/git-connector-v1.yaml")
43+
basePackage = "org.modelix.services.gitconnector.stubs"
4044
}
4145
generate("repository") {
4246
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/repository-v3.yaml")

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ fun computeVersion(): String {
1717
} else {
1818
val gitVersion: groovy.lang.Closure<String> by extra
1919
gitVersion()
20+
.replace("""\.dirty$""".toRegex(), "-dirty")
2021
.let {
2122
// Normalize the version so that is always a valid NPM version.
2223
if (it.matches("""\d+\.\d+.\d+-.*""".toRegex())) it else "0.0.1-$it"

redocly/redocly.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ apis:
1212
output: ./bundled/maven-connector-v1.yaml
1313
decorators:
1414
plugin/use-server-path: {}
15+
git-connector@v1:
16+
root: ../specifications/git-connector/v1/git.yaml
17+
output: ./bundled/git-connector-v1.yaml
18+
decorators:
19+
plugin/use-server-path: {}
1520
workspaces@v1:
1621
root: ../specifications/workspaces/v1/workspaces.yaml
1722
output: ./bundled/workspaces-v1.yaml
Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
openapi: "3.1.0"
2+
info:
3+
title: "Modelix Git Connector"
4+
version: "1.0.0"
5+
servers:
6+
- url: '/modelix/git-connector'
7+
description: Import MPS project from Git repositories
8+
tags:
9+
- name: GitConnector
10+
- name: GitRepositories
11+
- name: GitBranches
12+
- name: Drafts
13+
paths:
14+
/repositories/:
15+
get:
16+
operationId: listGitRepositories
17+
tags: [GitRepositories]
18+
parameters:
19+
- name: includeStatus
20+
in: query
21+
required: false
22+
schema:
23+
type: boolean
24+
responses:
25+
"200":
26+
description: OK
27+
content:
28+
application/json:
29+
schema:
30+
$ref: '#/components/schemas/GitRepositoryConfigList'
31+
post:
32+
operationId: createGitRepository
33+
tags: [GitRepositories]
34+
requestBody:
35+
content:
36+
application/json:
37+
schema:
38+
$ref: '#/components/schemas/GitRepositoryConfig'
39+
responses:
40+
"200":
41+
description: OK
42+
content:
43+
application/json:
44+
schema:
45+
$ref: '#/components/schemas/GitRepositoryConfig'
46+
47+
/repositories/{repositoryId}:
48+
get:
49+
operationId: getGitRepository
50+
tags: [GitRepositories]
51+
parameters:
52+
- name: repositoryId
53+
in: path
54+
required: true
55+
schema:
56+
type: string
57+
- name: includeStatus
58+
in: query
59+
required: false
60+
schema:
61+
type: boolean
62+
responses:
63+
"200":
64+
description: OK
65+
content:
66+
application/json:
67+
schema:
68+
$ref: '#/components/schemas/GitRepositoryConfig'
69+
put:
70+
operationId: updateGitRepository
71+
tags: [GitRepositories]
72+
parameters:
73+
- name: repositoryId
74+
in: path
75+
required: true
76+
schema:
77+
type: string
78+
requestBody:
79+
content:
80+
application/json:
81+
schema:
82+
$ref: '#/components/schemas/GitRepositoryConfig'
83+
responses:
84+
"200":
85+
description: OK
86+
delete:
87+
operationId: deleteGitRepository
88+
tags: [GitRepositories]
89+
parameters:
90+
- name: repositoryId
91+
in: path
92+
required: true
93+
schema:
94+
type: string
95+
responses:
96+
"200":
97+
description: OK
98+
99+
/repositories/{repositoryId}/status:
100+
get:
101+
operationId: getGitRepositoryStatus
102+
tags: [GitRepositories, GitBranches]
103+
parameters:
104+
- name: repositoryId
105+
in: path
106+
required: true
107+
schema:
108+
type: string
109+
responses:
110+
"200":
111+
description: OK
112+
content:
113+
application/json:
114+
schema:
115+
$ref: '#/components/schemas/GitRepositoryStatusData'
116+
117+
/repositories/{repositoryId}/branches/:
118+
get:
119+
operationId: listBranches
120+
tags: [GitBranches]
121+
parameters:
122+
- name: repositoryId
123+
in: path
124+
required: true
125+
schema:
126+
type: string
127+
responses:
128+
"200":
129+
description: OK
130+
content:
131+
application/json:
132+
schema:
133+
$ref: '#/components/schemas/GitBranchList'
134+
135+
/repositories/{repositoryId}/branches/update:
136+
post:
137+
operationId: updateBranches
138+
tags: [GitBranches]
139+
parameters:
140+
- name: repositoryId
141+
in: path
142+
required: true
143+
schema:
144+
type: string
145+
responses:
146+
"200":
147+
description: OK
148+
content:
149+
application/json:
150+
schema:
151+
$ref: '#/components/schemas/GitBranchList'
152+
153+
/repositories/{repositoryId}/drafts/:
154+
get:
155+
operationId: listDraftsInRepository
156+
tags: [Drafts]
157+
parameters:
158+
- name: repositoryId
159+
in: path
160+
required: true
161+
schema:
162+
type: string
163+
responses:
164+
"200":
165+
description: OK
166+
content:
167+
application/json:
168+
schema:
169+
$ref: '#/components/schemas/DraftConfigList'
170+
post:
171+
operationId: createDraftInRepository
172+
tags: [Drafts]
173+
parameters:
174+
- name: repositoryId
175+
in: path
176+
required: true
177+
schema:
178+
type: string
179+
requestBody:
180+
content:
181+
application/json:
182+
schema:
183+
$ref: '#/components/schemas/DraftConfig'
184+
responses:
185+
"200":
186+
description: OK
187+
content:
188+
application/json:
189+
schema:
190+
$ref: '#/components/schemas/DraftConfig'
191+
192+
/drafts/{draftId}:
193+
get:
194+
operationId: getDraft
195+
tags: [Drafts]
196+
parameters:
197+
- name: draftId
198+
in: path
199+
required: true
200+
schema:
201+
type: string
202+
responses:
203+
"200":
204+
description: OK
205+
content:
206+
application/json:
207+
schema:
208+
$ref: '#/components/schemas/DraftConfig'
209+
delete:
210+
operationId: deleteDraft
211+
tags: [Drafts]
212+
parameters:
213+
- name: draftId
214+
in: path
215+
required: true
216+
schema:
217+
type: string
218+
responses:
219+
"200":
220+
description: OK
221+
222+
components:
223+
schemas:
224+
GitRepositoryConfigList:
225+
type: object
226+
required: [repositories]
227+
properties:
228+
repositories:
229+
type: array
230+
items:
231+
$ref: '#/components/schemas/GitRepositoryConfig'
232+
233+
GitRepositoryConfig:
234+
type: object
235+
required: [id, url]
236+
properties:
237+
id:
238+
type: string
239+
format: uuid
240+
name:
241+
type: string
242+
remotes:
243+
type: array
244+
items:
245+
$ref: '#/components/schemas/GitRemoteConfig'
246+
modelixRepository:
247+
type: string
248+
status:
249+
$ref: '#/components/schemas/GitRepositoryStatusData'
250+
251+
GitRemoteConfig:
252+
type: object
253+
required: [name, url, hasCredentials]
254+
properties:
255+
name:
256+
type: string
257+
url:
258+
type: string
259+
hasCredentials:
260+
type: boolean
261+
credentials:
262+
$ref: '#/components/schemas/GitCredentials'
263+
264+
GitCredentials:
265+
type: object
266+
properties:
267+
username:
268+
type: string
269+
password:
270+
type: string
271+
272+
GitRepositoryStatusData:
273+
type: object
274+
properties:
275+
branches:
276+
type: array
277+
items:
278+
$ref: '#/components/schemas/GitBranchStatusData'
279+
280+
GitBranchList:
281+
type: object
282+
required: [branches]
283+
properties:
284+
branches:
285+
type: array
286+
items:
287+
$ref: '#/components/schemas/GitBranchStatusData'
288+
289+
GitBranchStatusData:
290+
type: object
291+
required: [remoteRepositoryName, name]
292+
properties:
293+
remoteRepositoryName: { type: string }
294+
name: { type: string }
295+
gitCommitHash: { type: string }
296+
modelixBranchName: { type: string }
297+
modelixCommitHash: { type: string }
298+
lastImportedGitCommitHash: { type: string }
299+
300+
DraftConfigList:
301+
type: object
302+
required: [drafts]
303+
properties:
304+
drafts:
305+
type: array
306+
items:
307+
$ref: '#/components/schemas/DraftConfig'
308+
309+
DraftConfig:
310+
type: object
311+
required: [id, gitRepositoryId, modelixBranchName, gitBranchName, baseGitCommit]
312+
properties:
313+
id: { type: string }
314+
name: { type: string }
315+
gitRepositoryId: { type: string }
316+
gitBranchName: { type: string }
317+
baseGitCommit: { type: string }
318+
modelixBranchName: { type: string }
319+
defaultWorkspace: { type: string }
320+
321+
securitySchemes:
322+
modelixJwtAuth:
323+
type: http
324+
scheme: bearer
325+
bearerFormat: JWT
326+
327+
security:
328+
- modelixJwtAuth: []

0 commit comments

Comments
 (0)