Merge pull request #10190 from hmacr/1we24-auto-suggest-default-branch

Add defaultBranch in getRepository response
This commit is contained in:
Matej Bačo 2025-07-24 17:25:51 +02:00 committed by GitHub
commit d0b04cd61b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 91 additions and 0 deletions

View file

@ -4489,6 +4489,30 @@
}
],
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console."
},
{
"name": "createDocuments",
"auth": {
"Admin": [],
"Key": []
},
"parameters": [
"databaseId",
"collectionId",
"documents"
],
"required": [
"databaseId",
"collectionId",
"documents"
],
"responses": [
{
"code": 201,
"model": "#\/components\/schemas\/documentList"
}
],
"description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console."
}
],
"auth": {

View file

@ -39698,6 +39698,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39710,6 +39715,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt"
]
},
@ -39742,6 +39748,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39759,6 +39770,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt",
"framework"
]
@ -39792,6 +39804,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39809,6 +39826,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt",
"runtime"
]

View file

@ -4626,6 +4626,30 @@
}
],
"description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console."
},
{
"name": "createDocuments",
"auth": {
"Admin": [],
"Key": []
},
"parameters": [
"databaseId",
"collectionId",
"documents"
],
"required": [
"databaseId",
"collectionId",
"documents"
],
"responses": [
{
"code": 201,
"model": "#\/definitions\/documentList"
}
],
"description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console."
}
],
"auth": {

View file

@ -39874,6 +39874,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39886,6 +39891,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt"
]
},
@ -39918,6 +39924,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39935,6 +39946,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt",
"framework"
]
@ -39968,6 +39980,11 @@
"description": "Is VCS (Version Control System) repository private?",
"x-example": true
},
"defaultBranch": {
"type": "string",
"description": "VCS (Version Control System) repository's default branch name.",
"x-example": "main"
},
"pushedAt": {
"type": "string",
"description": "Last commit date in ISO 8601 format.",
@ -39985,6 +40002,7 @@
"organization",
"provider",
"private",
"defaultBranch",
"pushedAt",
"runtime"
]

View file

@ -1137,6 +1137,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro
$repository['pushedAt'] = $repository['pushed_at'] ?? '';
$repository['organization'] = $installation->getAttribute('organization', '');
$repository['provider'] = $installation->getAttribute('provider', '');
$repository['defaultBranch'] = $repository['default_branch'] ?? '';
$response->dynamic(new Document($repository), Response::MODEL_PROVIDER_REPOSITORY);
});

View file

@ -41,6 +41,12 @@ class ProviderRepository extends Model
'default' => false,
'example' => true,
])
->addRule('defaultBranch', [
'type' => self::TYPE_STRING,
'description' => "VCS (Version Control System) repository's default branch name.",
'default' => '',
'example' => 'main',
])
->addRule('pushedAt', [
'type' => self::TYPE_DATETIME,
'description' => 'Last commit date in ISO 8601 format.',