Skip to content

Commit 710b99e

Browse files
brendan-kellammsukkari
authored andcommitted
Connection management (#183)
1 parent 0dbae89 commit 710b99e

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

packages/backend/src/connectionManager.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ export class ConnectionManager implements IConnectionManager {
9393
return [];
9494
}
9595
}
96-
})();
96+
)();
97+
98+
// Filter out any duplicates by external_id and external_codeHostUrl.
99+
repoData.filter((repo, index, self) => {
100+
return index === self.findIndex(r =>
101+
r.external_id === repo.external_id &&
102+
r.external_codeHostUrl === repo.external_codeHostUrl
103+
);
104+
})
97105

98106
// Filter out any duplicates by external_id and external_codeHostUrl.
99107
repoData.filter((repo, index, self) => {

packages/schemas/src/v3/connection.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ const schema = {
226226
},
227227
"token": {
228228
"$ref": "#/oneOf/0/properties/token",
229-
"description": "A Personal Access Token (PAT).",
229+
"description": "An authentication token.",
230230
"examples": [
231231
"secret-token",
232232
{

packages/schemas/src/v3/connection.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export interface GitlabConnectionConfig {
104104
*/
105105
type: "gitlab";
106106
/**
107-
* A Personal Access Token (PAT).
107+
* An authentication token.
108108
*/
109109
token?:
110110
| string

packages/schemas/src/v3/gitlab.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const schema = {
99
"description": "GitLab Configuration"
1010
},
1111
"token": {
12-
"description": "A Personal Access Token (PAT).",
12+
"description": "An authentication token.",
1313
"examples": [
1414
"secret-token",
1515
{

packages/schemas/src/v3/gitlab.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface GitlabConnectionConfig {
66
*/
77
type: "gitlab";
88
/**
9-
* A Personal Access Token (PAT).
9+
* An authentication token.
1010
*/
1111
token?:
1212
| string

schemas/v3/gitlab.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"token": {
1111
"$ref": "./shared.json#/definitions/Token",
12-
"description": "A Personal Access Token (PAT).",
12+
"description": "An authentication token.",
1313
"examples": [
1414
"secret-token",
1515
{
@@ -46,7 +46,9 @@
4646
"type": "string"
4747
},
4848
"examples": [
49-
["my-group"],
49+
[
50+
"my-group"
51+
],
5052
[
5153
"my-group/sub-group-a",
5254
"my-group/sub-group-b"
@@ -60,8 +62,12 @@
6062
"type": "string"
6163
},
6264
"examples": [
63-
["my-group/my-project"],
64-
["my-group/my-sub-group/my-project"]
65+
[
66+
"my-group/my-project"
67+
],
68+
[
69+
"my-group/my-sub-group/my-project"
70+
]
6571
],
6672
"description": "List of individual projects to sync with. The project's namespace must be specified. See: https://docs.gitlab.com/ee/user/namespace/"
6773
},
@@ -73,7 +79,10 @@
7379
"minItems": 1,
7480
"description": "List of project topics to include when syncing. Only projects that match at least one of the provided `topics` will be synced. If not specified, all projects will be synced, unless explicitly defined in the `exclude` property. Glob patterns are supported.",
7581
"examples": [
76-
["docs", "core"]
82+
[
83+
"docs",
84+
"core"
85+
]
7786
]
7887
},
7988
"exclude": {
@@ -109,7 +118,10 @@
109118
},
110119
"description": "List of project topics to exclude when syncing. Projects that match one of the provided `topics` will be excluded from syncing. Glob patterns are supported.",
111120
"examples": [
112-
["tests", "ci"]
121+
[
122+
"tests",
123+
"ci"
124+
]
113125
]
114126
}
115127
},

0 commit comments

Comments
 (0)