mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
wip on adding git connection type to schema
This commit is contained in:
parent
c201a5e1a9
commit
6b17a0daa0
8 changed files with 191 additions and 2 deletions
|
|
@ -504,6 +504,30 @@ const schema = {
|
|||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"title": "GitConnectionConfig",
|
||||
"properties": {
|
||||
"type": {
|
||||
"const": "git",
|
||||
"description": "Git Configuration"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "url",
|
||||
"description": "The URL to the git repository."
|
||||
},
|
||||
"revisions": {
|
||||
"$ref": "#/oneOf/0/properties/revisions"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ export type ConnectionConfig =
|
|||
| GithubConnectionConfig
|
||||
| GitlabConnectionConfig
|
||||
| GiteaConnectionConfig
|
||||
| GerritConnectionConfig;
|
||||
| GerritConnectionConfig
|
||||
| GitConnectionConfig;
|
||||
|
||||
export interface GithubConnectionConfig {
|
||||
/**
|
||||
|
|
@ -235,3 +236,14 @@ export interface GerritConnectionConfig {
|
|||
projects?: string[];
|
||||
};
|
||||
}
|
||||
export interface GitConnectionConfig {
|
||||
/**
|
||||
* Git Configuration
|
||||
*/
|
||||
type: "git";
|
||||
/**
|
||||
* The URL to the git repository.
|
||||
*/
|
||||
url: string;
|
||||
revisions?: GitRevisions;
|
||||
}
|
||||
|
|
|
|||
64
packages/schemas/src/v3/git.schema.ts
Normal file
64
packages/schemas/src/v3/git.schema.ts
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!
|
||||
const schema = {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"title": "GitConnectionConfig",
|
||||
"properties": {
|
||||
"type": {
|
||||
"const": "git",
|
||||
"description": "Git Configuration"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "url",
|
||||
"description": "The URL to the git repository."
|
||||
},
|
||||
"revisions": {
|
||||
"type": "object",
|
||||
"description": "The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.",
|
||||
"properties": {
|
||||
"branches": {
|
||||
"type": "array",
|
||||
"description": "List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"examples": [
|
||||
[
|
||||
"main",
|
||||
"release/*"
|
||||
],
|
||||
[
|
||||
"**"
|
||||
]
|
||||
],
|
||||
"default": []
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"description": "List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"examples": [
|
||||
[
|
||||
"latest",
|
||||
"v2.*.*"
|
||||
],
|
||||
[
|
||||
"**"
|
||||
]
|
||||
],
|
||||
"default": []
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
} as const;
|
||||
export { schema as gitSchema };
|
||||
26
packages/schemas/src/v3/git.type.ts
Normal file
26
packages/schemas/src/v3/git.type.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// THIS IS A AUTO-GENERATED FILE. DO NOT MODIFY MANUALLY!
|
||||
|
||||
export interface GitConnectionConfig {
|
||||
/**
|
||||
* Git Configuration
|
||||
*/
|
||||
type: "git";
|
||||
/**
|
||||
* The URL to the git repository.
|
||||
*/
|
||||
url: string;
|
||||
revisions?: GitRevisions;
|
||||
}
|
||||
/**
|
||||
* The revisions (branches, tags) that should be included when indexing. The default branch (HEAD) is always indexed. A maximum of 64 revisions can be indexed, with any additional revisions being ignored.
|
||||
*/
|
||||
export interface GitRevisions {
|
||||
/**
|
||||
* List of branches to include when indexing. For a given repo, only the branches that exist on the repo's remote *and* match at least one of the provided `branches` will be indexed. The default branch (HEAD) is always indexed. Glob patterns are supported. A maximum of 64 branches can be indexed, with any additional branches being ignored.
|
||||
*/
|
||||
branches?: string[];
|
||||
/**
|
||||
* List of tags to include when indexing. For a given repo, only the tags that exist on the repo's remote *and* match at least one of the provided `tags` will be indexed. Glob patterns are supported. A maximum of 64 tags can be indexed, with any additional tags being ignored.
|
||||
*/
|
||||
tags?: string[];
|
||||
}
|
||||
|
|
@ -583,6 +583,30 @@ const schema = {
|
|||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"title": "GitConnectionConfig",
|
||||
"properties": {
|
||||
"type": {
|
||||
"const": "git",
|
||||
"description": "Git Configuration"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "url",
|
||||
"description": "The URL to the git repository."
|
||||
},
|
||||
"revisions": {
|
||||
"$ref": "#/properties/connections/patternProperties/%5E%5Ba-zA-Z0-9_-%5D%2B%24/oneOf/0/properties/revisions"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ export type ConnectionConfig =
|
|||
| GithubConnectionConfig
|
||||
| GitlabConnectionConfig
|
||||
| GiteaConnectionConfig
|
||||
| GerritConnectionConfig;
|
||||
| GerritConnectionConfig
|
||||
| GitConnectionConfig;
|
||||
|
||||
export interface SourcebotConfig {
|
||||
$schema?: string;
|
||||
|
|
@ -301,3 +302,14 @@ export interface GerritConnectionConfig {
|
|||
projects?: string[];
|
||||
};
|
||||
}
|
||||
export interface GitConnectionConfig {
|
||||
/**
|
||||
* Git Configuration
|
||||
*/
|
||||
type: "git";
|
||||
/**
|
||||
* The URL to the git repository.
|
||||
*/
|
||||
url: string;
|
||||
revisions?: GitRevisions;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@
|
|||
},
|
||||
{
|
||||
"$ref": "./gerrit.json"
|
||||
},
|
||||
{
|
||||
"$ref": "./git.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
24
schemas/v3/git.json
Normal file
24
schemas/v3/git.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"title": "GitConnectionConfig",
|
||||
"properties": {
|
||||
"type": {
|
||||
"const": "git",
|
||||
"description": "Git Configuration"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "url",
|
||||
"description": "The URL to the git repository."
|
||||
},
|
||||
"revisions": {
|
||||
"$ref": "./shared.json#/definitions/GitRevisions"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"url"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
Loading…
Reference in a new issue