Documentation ¶
Index ¶
- Constants
- func AddChangelogToFile(changelog *Changelog, version *semver.Version, ...) (string, error)
- func AddTagSet(path, tag string) error
- func ChangeConfigWithCommitID(path, repoURL, commitID, specRPName string) error
- func ChangeConfigWithLocalPath(path, readmeFile, readmeGoFile string) error
- func CleanSDKGeneratedFiles(path string) error
- func ContainsPreviewAPIVersion(packagePath string) (bool, error)
- func EnumFilter(changelog *Changelog)
- func ExecuteAddIssueComment(path, repoOwner, repoName, issueNumber, comment, authToken string) error
- func ExecuteAddIssueLabels(path, repoOwner, repoName, issueNumber, authToken string, labels []string) error
- func ExecuteCreatePullRequest(...) (string, error)
- func ExecuteExampleGenerate(path, packagePath, flag string) error
- func ExecuteGitPush(path, remoteName, branchName string) (string, error)
- func ExecuteGo(dir string, args ...string) error
- func ExecuteGoFmt(dir string, args ...string) error
- func ExecuteGoGenerate(path string) error
- func ExecuteGoimports(path string) error
- func ExecuteTspClient(path string, args ...string) error
- func ExecuteTypeSpecGenerate(ctx *GenerateContext, emitOptions string, tspClientOptions []string) error
- func FilterChangelog(changelog *Changelog, opts ...func(changelog *Changelog))
- func FuncFilter(changelog *Changelog)
- func GetAllVersionTags(packageModuleRelativePath string) ([]string, error)
- func GetAlwaysSetBodyParamRequiredFlag(path string) (string, error)
- func GetExportsFromTag(sdkRepo repo.SDKRepository, packagePath, tag string) (*exports.Content, error)
- func GetPreviousVersionTag(isCurrentPreview bool, allReleases []string) string
- func GetSDKRepo(sdkRepoParam, sdkRepoURL string) (repo.SDKRepository, error)
- func GetSpecCommit(specRepoParam string) (string, error)
- func GetSpecRpName(packageRootPath string) (string, error)
- func GetTag(path string) (string, error)
- func InterfaceToAnyFilter(changelog *Changelog)
- func IsBetaVersion(v string) (bool, error)
- func LROFilter(changelog *Changelog)
- func MarshalUnmarshalFilter(changelog *Changelog)
- func NonExportedFilter(changelog *Changelog)
- func PageableFilter(changelog *Changelog)
- func ReadV2ModuleNameToGetNamespace(path string) (map[string][]PackageInfo, error)
- func RemoveTagSet(path string) error
- func ReplaceConstModuleVersion(packagePath string, newVersion string) error
- func ReplaceImport(sourceFile string, baseModule string, majorVersion int64) error
- func ReplaceModule(newVersion *semver.Version, packagePath, baseModule string, suffixs ...string) error
- func ReplaceNewClientNamePlaceholder(packageRootPath string, exports exports.Content) error
- func ReplaceReadmeNewClientName(packageRootPath string, exports exports.Content) error
- func ReplaceVersion(packageRootPath string, newVersion string) error
- func SortFuncItem[T delta.FuncSig | exports.Func](change map[string]T) []string
- func UpdateModuleDefinition(packageRootPath, packageModuleRelativePath string, version *semver.Version) error
- func UpdateOnboardChangelogVersion(packageRootPath, versionNumber string) error
- type Changelog
- type GenerateContext
- func (ctx *GenerateContext) GenerateForAutomation(readme, repo, goVersion string) ([]GenerateResult, []error)
- func (ctx *GenerateContext) GenerateForSingleRPNamespace(generateParam *GenerateParam) (*GenerateResult, error)
- func (ctx *GenerateContext) GenerateForTypeSpec(generateParam *GenerateParam, packageModuleRelativePath string) (*GenerateResult, error)
- type GenerateParam
- type GenerateResult
- type PackageInfo
- type PullRequestLabel
Constants ¶
const (
ChangelogFileName = "CHANGELOG.md"
)
Variables ¶
This section is empty.
Functions ¶
func AddChangelogToFile ¶
func AddChangelogToFile(changelog *Changelog, version *semver.Version, packageRootPath, releaseDate string) (string, error)
add new changelog md to changelog file
func ChangeConfigWithCommitID ¶
replace repo URL and commit id in autorest.md file
func ChangeConfigWithLocalPath ¶
replace repo commit with local path in autorest.md file
func CleanSDKGeneratedFiles ¶
remove all sdk generated files in given path
func EnumFilter ¶
func EnumFilter(changelog *Changelog)
func ExecuteAddIssueComment ¶
func ExecuteAddIssueLabels ¶
func ExecuteExampleGenerate ¶
execute `pwsh Invoke-MgmtTestgen` command and fetch result
func ExecuteGitPush ¶
func ExecuteGoFmt ¶
func ExecuteGoGenerate ¶
execute `go generate` command and fetch result
func ExecuteGoimports ¶
execute `goimports` command and fetch result
func ExecuteTspClient ¶
execute tsp-client command
func ExecuteTypeSpecGenerate ¶
func ExecuteTypeSpecGenerate(ctx *GenerateContext, emitOptions string, tspClientOptions []string) error
func FilterChangelog ¶
func FuncFilter ¶
func FuncFilter(changelog *Changelog)
func GetAllVersionTags ¶
func GetExportsFromTag ¶
func GetPreviousVersionTag ¶
func GetSDKRepo ¶
func GetSDKRepo(sdkRepoParam, sdkRepoURL string) (repo.SDKRepository, error)
func GetSpecCommit ¶
func GetSpecRpName ¶
get swagger rp folder name from autorest.md file
func InterfaceToAnyFilter ¶
func InterfaceToAnyFilter(changelog *Changelog)
func IsBetaVersion ¶
func MarshalUnmarshalFilter ¶
func MarshalUnmarshalFilter(changelog *Changelog)
func NonExportedFilter ¶
func NonExportedFilter(changelog *Changelog)
func PageableFilter ¶
func PageableFilter(changelog *Changelog)
PageableFilter PageableFilter after OperationFilter
func ReadV2ModuleNameToGetNamespace ¶
func ReadV2ModuleNameToGetNamespace(path string) (map[string][]PackageInfo, error)
reads from readme.go.md, parses the `track2` section to get module and package name
func ReplaceImport ¶
func ReplaceModule ¶
func ReplaceNewClientNamePlaceholder ¶
replace `{{NewClientName}}` placeholder in README.md by first func name according to `^New.+Method$` pattern
func ReplaceVersion ¶
replace version: use `module-version: ` prefix to locate version in autorest.md file, use version = "v*.*.*" regrex to locate version in constants.go file
func UpdateModuleDefinition ¶
Types ¶
type Changelog ¶
type Changelog struct { // NewPackage is true if this package does not exist in the old version NewPackage bool // RemovedPackage is true if this package does not exist in the new version RemovedPackage bool // Modified contains the details of a modified package. This is nil when either NewPackage or RemovedPackage is true Modified *report.Package }
Changelog describes the changelog generated for a package.
func GetChangelogForPackage ¶
GetChangelogForPackage generates the changelog report with the given two Contents
func (Changelog) GetBreakingChangeItems ¶
GetBreakingChangeItems returns an array of the breaking change items
func (Changelog) GetChangeSummary ¶
Seperate change summary text get
func (Changelog) HasBreakingChanges ¶
HasBreakingChanges returns if this report of changelog contains breaking changes
func (Changelog) ToCompactMarkdown ¶
ToCompactMarkdown returns the markdown string of this changelog but more compact
func (Changelog) ToMarkdown ¶
ToMarkdown returns the markdown string of this changelog
type GenerateContext ¶
type GenerateContext struct { SDKPath string SDKRepo *repo.SDKRepository SpecPath string SpecCommitHash string SpecReadmeFile string SpecReadmeGoFile string SpecRepoURL string UpdateSpecVersion bool // typespec TypeSpecConfig *typespec.TypeSpecConfig }
func (*GenerateContext) GenerateForAutomation ¶
func (ctx *GenerateContext) GenerateForAutomation(readme, repo, goVersion string) ([]GenerateResult, []error)
func (*GenerateContext) GenerateForSingleRPNamespace ¶
func (ctx *GenerateContext) GenerateForSingleRPNamespace(generateParam *GenerateParam) (*GenerateResult, error)
func (*GenerateContext) GenerateForTypeSpec ¶
func (ctx *GenerateContext) GenerateForTypeSpec(generateParam *GenerateParam, packageModuleRelativePath string) (*GenerateResult, error)
type GenerateParam ¶
type GenerateParam struct { RPName string NamespaceName string NamespaceConfig string SpecificVersion string SpecificPackageTitle string SpecRPName string ReleaseDate string SkipGenerateExample bool GoVersion string RemoveTagSet bool ForceStableVersion bool TypeSpecEmitOption string TspClientOptions []string }
type GenerateResult ¶
type PackageInfo ¶
type PullRequestLabel ¶
type PullRequestLabel string
const ( StableLabel PullRequestLabel = "Stable" BetaLabel PullRequestLabel = "Beta" FirstGALabel PullRequestLabel = "FirstGA" FirstGABreakingChangeLabel PullRequestLabel = "FirstGA,BreakingChange" FirstBetaLabel PullRequestLabel = "FirstBeta" StableBreakingChangeLabel PullRequestLabel = "Stable,BreakingChange" BetaBreakingChangeLabel PullRequestLabel = "Beta,BreakingChange" )
func CalculateNewVersion ¶
func CalculateNewVersion(changelog *Changelog, previousVersion string, isCurrentPreview bool) (*semver.Version, PullRequestLabel, error)
calculate new version by changelog using semver package