Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK Automation Doc Update #11422

Merged
merged 8 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions documentation/sdkautomation/GenerateInputSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"type": "object",
"properties": {
"dryRun": {
// If dryRun is true, generateScript is expected to parse readme.md
// and output the package list with package name and related readme.md.
// Should not run codegen at this time.
// ** Not supported yet **
"type": "boolean"
},
"specFolder": {
// Path to local spec folder.
"type": "string"
},
"headSha": {
// Git head sha.
"type": "string"
},
"headRef": {
// Git head ref.
// Format will be "refs/pull/<number>/merge" or "refs/heads/<branch>".
"type": "string"
},
"repoHttpsUrl": {
// Spec repo url in https without auth.
"type": "string"
},
"trigger": {
"$ref": "TriggerType#"
},
"changedFiles": {
// Changed file list in spec PR.
"type": "array",
"items": {
"type": "string"
}
},
"relatedReadmeMdFiles": {
// Related readme.md files that pending generation.
"type": "array",
"items": {
"type": "string"
}
},
"installInstructionInput": {
// See #InstallInstructionScriptInput
"$ref": "InstallInstructionScriptInput#"
}
},
"required": ["specFolder", "headSha", "headRef", "repoHttpsUrl", "trigger", "changedFiles", "relatedReadmeMdFiles"]
}
65 changes: 65 additions & 0 deletions documentation/sdkautomation/GenerateOutputSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"type": "object",
"properties": {
"packages": {
"type": "array",
"items": {
"$ref": "#/definitions/PackageResult"
}
}
},
"required": ["packages"],
"definitions": {
"PackageResult": {
"properties": {
"packageName": {
// Name of package. Will be used in branch name and PR title.
// By default it's folder name of first entry in path.
"type": "string"
},
"path": {
// List of package content paths.
// If the path points to a folder then
// all the content under the folder will be included.
"type": "array",
"items": {
"type": "string"
}
},
"readmeMd": {
// List of related readmeMd of this package.
// Must provide this field if dryRun is true.
"type": "array",
"items": {
"type": "string"
}
},
"changelog": {
"type": "object",
"properties": {
"content": {
// Content of changelog in markdown
"type": "string"
},
"hasBreakingChange": {
// Does the new package has breaking change
"type": "boolean"
}
},
"required": ["content"]
},
"artifacts": {
"type": "array",
"items": {
"type": "string"
}
},
"installInstructions": {
// See #InstallInstructionScriptOutput
"$ref": "InstallInstructionScriptOutput"
}
},
"required": ["path"]
}
}
}
11 changes: 11 additions & 0 deletions documentation/sdkautomation/InitOutputSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "object",
"properties": {
"envs": {
// Environment variable to be set in following scripts.
"additionalProperties": {
"type": "string"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$id": "InstallInstructionScriptInput",
"type": "object",
"properties": {
"packageName": {
// The package name. May be skipped if sdk automation don't know the info yet.
"type": "string"
},
"artifacts": {
// List of artifact's path. May be skipped if sdk automation don't know the info yet.
"type": "array",
"items": {
"type": "string"
}
},
"isPublic": {
// Is the download url public accessible.
// If it's false, the download command template will be
// az rest --resource <client-id> -u "{URL}" --output-file {FILENAME}
"type": "boolean"
},
"downloadUrlPrefix": {
// All the artifacts will be uploaded and user could access the artifact via
// a link composed by this prefix and artifact filename.
"type": "string"
},
"downloadCommandTemplate": {
// Download command template. Replace {URL} and {FILENAME} to get the real command.
"type": "string"
},
"trigger": {
"$ref": "TriggerType#"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$id": "InstallInstructionScriptOutput",
"type": "object",
"properties": {
"full": {
// Full version of install instruction will be shown in generated SDK PR.
// Should be in markdown format.
"type": "string"
},
"lite": {
// Lite version of install instruction will be shown in generated SDK PR.
// Should be in markdown format.
"type": "string"
}
},
"required": ["full"]
}
82 changes: 82 additions & 0 deletions documentation/sdkautomation/SpecConfigSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"type": "object",
"properties": {
"sdkRepositoryMappings": {
// A mapping of SDK repository names to the names of the SDK repositories
// that all interaction should go to instead.
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "#/definitions/SdkRepositoryConfig"
},
{
"type": "string"
}
]
},
"propertyNames": {
// The property name is the sdk name identifier.
"type": "string"
}
},
"overrides": {
// Override config for specific repository.
"type": "object",
"additionalProperties": {
"$ref": "#/"
},
"propertyNames": {
// The property name is the sdk repo ref.
"$ref": "#/definitions/RepositoryName"
}
}
},
"required": ["sdkRepositoryMappings"],
"definitions": {
"RepositoryName": {
// Reference to a repository on github. Could be <repo> or <owner>/<repo>.
// By default the <owner> is the same as the owner of the spec repo.
"type": "string"
},
"SdkRepositoryConfig": {
"type": "object",
"properties": {
"mainRepository": {
// The repository that the final release PR will targeting.
"$ref": "#/definitions/RepositoryName"
},
"mainBranch": {
// Base branch of codegen branches
"default": "master",
"type": "string"
},
"integrationRepository": {
// The repository that hold generation branch, generation PR and integration branch.
// By default it's the same as mainRepository
"$ref": "#/definitions/RepositoryName"
},
"secondaryRepository": {
// Codegen runs on this repository.
// By default it's the same as 'mainRepository' but it could be different.
"$ref": "#/definitions/RepositoryName"
},
"secondaryBranch": {
// Codegen runs on this branch on secondaryRepository.
// By default it's the same as 'mainBranch' but it could be different.
"type": "string"
},
"integrationBranchPrefix": {
// The prefix that will be applied to the beginning of integration branches
"type": "string",
"default": "sdkAutomation"
},
"configFilePath": {
// Path to swagger-to-sdk config in sdk repo
"default": "swagger_to_sdk_config.json"
}
},
"required": ["mainRepository"]
}
}
}
Loading