diff --git a/.azure-pipelines/BuildTest.yml b/.azure-pipelines/BuildTest.yml index 380410754330..fbf034a8c0b1 100644 --- a/.azure-pipelines/BuildTest.yml +++ b/.azure-pipelines/BuildTest.yml @@ -3,35 +3,66 @@ jobs: strategy: matrix: Linux_Go112: - vm.image: 'Ubuntu 18.04' + vm.image: 'Ubuntu 16.04' go.version: '1.12' GOROOT: '/usr/local/go$(go.version)' Linux_Go113: - vm.image: 'Ubuntu 18.04' + vm.image: 'Ubuntu 16.04' go.version: '1.13' GOROOT: '/usr/local/go$(go.version)' pool: vmImage: $(vm.image) + variables: + GOPATH: '$(System.DefaultWorkingDirectory)/work' + sdkPath: '$(GOPATH)/src/github.com/Azure/azure-sdk-for-go' + steps: - - template: steps/InitWorkspace.yml - - template: steps/Vet.yml - parameters: - folder: '.' - - template: steps/Build.yml - parameters: - folder: '.' + - script: | + set -x + printenv + mkdir -p '$(GOPATH)/bin' + mkdir -p '$(sdkPath)' + shopt -s dotglob extglob + mv !(work) '$(sdkPath)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + echo '##vso[task.prependpath]$(GOPATH)/bin' + displayName: 'Create Go Workspace' + - script: | + set -e + go version + curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure -v + go get -u golang.org/x/lint/golint + workingDirectory: '$(sdkPath)' + displayName: 'Install Dependencies' + - script: go vet $(go list ./... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Vet' + - script: go build -v $(go list ./... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Build' - script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) workingDirectory: '$(sdkPath)' displayName: 'Run Tests' - script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt workingDirectory: '$(sdkPath)' displayName: 'Verify Package Directory' - - template: steps/CheckCopyrightHeader.yml - parameters: - folder: '.' - - template: steps/CheckFormat.yml - parameters: - folder: '.' - - template: steps/LinterCheck.yml + - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Copyright Header Check' + failOnStderr: true + condition: succeededOrFailed() + - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Format Check' + failOnStderr: true + condition: succeededOrFailed() + - script: | + golint ./storage/... >&2 + golint ./tools/... >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Linter Check' + failOnStderr: true + condition: succeededOrFailed() \ No newline at end of file diff --git a/.azure-pipelines/ModuleRelease.yml b/.azure-pipelines/ModuleRelease.yml index c24d8479a945..f03f231d5821 100644 --- a/.azure-pipelines/ModuleRelease.yml +++ b/.azure-pipelines/ModuleRelease.yml @@ -1,24 +1,61 @@ jobs: - job: pool: - vmImage: 'Ubuntu 18.04' + vmImage: 'Ubuntu 16.04' variables: GOROOT: '/usr/local/go1.12' + GOPATH: '$(system.defaultWorkingDirectory)/work' + sdkPath: '$(GOPATH)/src/github.com/Azure/azure-sdk-for-go' steps: - - template: steps/InitWorkspace.yml - - template: steps/SetGithub.yml - - template: steps/GenerateProfiles.yml - - template: steps/Vet.yml - parameters: - folder: './profiles' - - template: steps/CheckFormat.yml - parameters: - folder: './profiles' - - template: steps/CheckCopyrightHeader.yml - parameters: - folder: './profiles' + - script: | + # Enable bash verbose logging + set -x + mkdir -p '$(GOPATH)/bin' + mkdir -p '$(sdkPath)' + shopt -s dotglob extglob + mv !(work) '$(sdkPath)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + echo '##vso[task.prependpath]$(GOPATH)/bin' + displayName: 'Create Go Workspace' + - script: | + set -x + go version + curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure -v + go get -u golang.org/x/lint/golint + workingDirectory: '$(sdkPath)' + displayName: 'Install Dependencies' + - script: | + # Echo error if github-pat is empty + [ -z $(github-pat) ] && echo "github-pat is empty!" && exit -1 + echo $(Build.SourceBranchName) + # Enable bash verbose logging + set -x + git checkout $(Build.SourceBranchName) + git config user.email "azuresdkci@microsoft.com" + git config user.name "azuresdkci" + git config credential.helper store + echo https://$(github-pat):x-oauth-basic@github.com > ~/.git-credentials + displayName: 'Setup github' + workingDirectory: '$(sdkPath)' + - script: | + go generate ./profiles + gofmt -s -w ./profiles + workingDirectory: '$(sdkPath)' + displayName: 'Generate profiles' + - script: go vet $(go list ./profiles/... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Vet in profiles' + - script: go build -v $(go list ./profiles/... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Build' + - script: gofmt -s -l -w $(find ./profiles -path ./vendor -prune -o -name '*.go' -print) >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Format Check' + failOnStderr: true + condition: succeededOrFailed() - script: | # test if there are new profiles if [ -z "$(git status --porcelain)" ]; then @@ -28,7 +65,7 @@ jobs: git push origin $(Build.SourceBranchName) fi workingDirectory: '$(sdkPath)' - displayName: 'Push Profiles' + displayName: 'Push profiles' - script: go run ./tools/moduler/main.go ./services -v - displayName: 'Run Moduler' + displayName: 'Detecting new tag and push' workingDirectory: '$(sdkPath)' \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 71a8c470418c..a5d740abb453 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,10 +3,6 @@ trigger: include: - master -variables: - GOPATH: '$(System.DefaultWorkingDirectory)/work' - sdkPath: '$(GOPATH)/src/github.com/Azure/azure-sdk-for-go' - stages: - stage: Build_Test jobs: @@ -15,4 +11,4 @@ stages: - stage: Module_Release condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI')) jobs: - - template: .azure-pipelines/ModuleRelease.yml \ No newline at end of file + - template: .azure-pipelines/ModuleRelease.yml diff --git a/services/cognitiveservices/v3.0/luis/runtime/version.go b/services/cognitiveservices/v3.0/luis/runtime/version.go index 119db5d07cce..cf2314ceeb77 100644 --- a/services/cognitiveservices/v3.0/luis/runtime/version.go +++ b/services/cognitiveservices/v3.0/luis/runtime/version.go @@ -27,4 +27,4 @@ func Version() string { return "1.0.0" } -// tag: services/cognitiveservices/v3.0/luis/runtime/v1.0.0 +// tag: services/preview/cognitiveservices/v3.0/luis/runtime/v1.0.0 diff --git a/services/preview/cognitiveservices/v3.0/luis/runtime/CHANGELOG.md b/services/preview/cognitiveservices/v3.0/luis/runtime/CHANGELOG.md new file mode 100644 index 000000000000..4b553421a78a --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/runtime/CHANGELOG.md @@ -0,0 +1 @@ +No changes to exported content compared to the previous release. diff --git a/services/preview/cognitiveservices/v3.0/luis/runtime/go.mod b/services/preview/cognitiveservices/v3.0/luis/runtime/go.mod new file mode 100644 index 000000000000..6e89c1e364bc --- /dev/null +++ b/services/preview/cognitiveservices/v3.0/luis/runtime/go.mod @@ -0,0 +1,3 @@ +module github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v3.0/luis/runtime + +go 1.12 diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go index 1bc643740fbf..632d75aba2cf 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/datasetmappings.go @@ -45,7 +45,7 @@ func NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) // resourceGroupName - the resource group name. // accountName - the name of the share account. // shareSubscriptionName - the name of the share subscription which will hold the data set sink. -// dataSetMappingName - the Id of the source data set being mapped. +// dataSetMappingName - the name of the data set mapping to be created. // dataSetMapping - destination data set configuration details. func (client DataSetMappingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (result DataSetMappingModel, err error) { if tracing.IsEnabled() { diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go index 8fd86e2e13ae..e0ec0ecb6e44 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/models.go @@ -699,9 +699,9 @@ func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ADLSGen1FileDataSet an ADLS Gen 1 file dataset. +// ADLSGen1FileDataSet an ADLS Gen 1 file data set. type ADLSGen1FileDataSet struct { - // ADLSGen1FileProperties - ADLS Gen 1 file dataset properties. + // ADLSGen1FileProperties - ADLS Gen 1 file data set properties. *ADLSGen1FileProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -862,9 +862,9 @@ type ADLSGen1FileProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen1FolderDataSet an ADLS Gen 1 folder dataset. +// ADLSGen1FolderDataSet an ADLS Gen 1 folder data set. type ADLSGen1FolderDataSet struct { - // ADLSGen1FolderProperties - ADLS Gen 1 folder dataset properties. + // ADLSGen1FolderProperties - ADLS Gen 1 folder data set properties. *ADLSGen1FolderProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -1023,9 +1023,9 @@ type ADLSGen1FolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FileDataSet an ADLS Gen 2 file dataset. +// ADLSGen2FileDataSet an ADLS Gen 2 file data set. type ADLSGen2FileDataSet struct { - // ADLSGen2FileProperties - ADLS Gen 2 file dataset properties. + // ADLSGen2FileProperties - ADLS Gen 2 file data set properties. *ADLSGen2FileProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -1170,9 +1170,9 @@ func (ag2fds *ADLSGen2FileDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileDataSetMapping an ADLS Gen2 file dataset mapping. +// ADLSGen2FileDataSetMapping an ADLS Gen2 file data set mapping. type ADLSGen2FileDataSetMapping struct { - // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file dataset mapping properties. + // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file data set mapping properties. *ADLSGen2FileDataSetMappingProperties `json:"properties,omitempty"` // ID - READ-ONLY; The resource id of the azure resource ID *string `json:"id,omitempty"` @@ -1307,11 +1307,11 @@ func (ag2fdsm *ADLSGen2FileDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file dataset mapping property bag. +// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file data set mapping property bag. type ADLSGen2FileDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FilePath - File path within the file system. FilePath *string `json:"filePath,omitempty"` @@ -1343,9 +1343,9 @@ type ADLSGen2FileProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system dataset. +// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system data set. type ADLSGen2FileSystemDataSet struct { - // ADLSGen2FileSystemProperties - ADLS Gen 2 file system dataset properties. + // ADLSGen2FileSystemProperties - ADLS Gen 2 file system data set properties. *ADLSGen2FileSystemProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -1490,9 +1490,9 @@ func (ag2fsds *ADLSGen2FileSystemDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system dataset mapping. +// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system data set mapping. type ADLSGen2FileSystemDataSetMapping struct { - // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system dataset mapping properties. + // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system data set mapping properties. *ADLSGen2FileSystemDataSetMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -1627,11 +1627,11 @@ func (ag2fsdsm *ADLSGen2FileSystemDataSetMapping) UnmarshalJSON(body []byte) err return nil } -// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system dataset mapping property bag. +// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system data set mapping property bag. type ADLSGen2FileSystemDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FileSystem - The file system name. FileSystem *string `json:"fileSystem,omitempty"` @@ -1657,9 +1657,9 @@ type ADLSGen2FileSystemProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// ADLSGen2FolderDataSet an ADLS Gen 2 folder dataset. +// ADLSGen2FolderDataSet an ADLS Gen 2 folder data set. type ADLSGen2FolderDataSet struct { - // ADLSGen2FolderProperties - ADLS Gen 2 folder dataset properties. + // ADLSGen2FolderProperties - ADLS Gen 2 folder data set properties. *ADLSGen2FolderProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -1804,9 +1804,9 @@ func (ag2fds *ADLSGen2FolderDataSet) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder dataset mapping. +// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder data set mapping. type ADLSGen2FolderDataSetMapping struct { - // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder dataset mapping properties. + // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder data set mapping properties. *ADLSGen2FolderDataSetMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -1941,11 +1941,11 @@ func (ag2fdsm *ADLSGen2FolderDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder dataset mapping property bag. +// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder data set mapping property bag. type ADLSGen2FolderDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FileSystem - File system to which the folder belongs. FileSystem *string `json:"fileSystem,omitempty"` @@ -1975,9 +1975,9 @@ type ADLSGen2FolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobContainerDataSet an Azure storage blob container dataset. +// BlobContainerDataSet an Azure storage blob container data set. type BlobContainerDataSet struct { - // BlobContainerProperties - Blob container dataset properties. + // BlobContainerProperties - Blob container data set properties. *BlobContainerProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -2122,9 +2122,9 @@ func (bcds *BlobContainerDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobContainerDataSetMapping a Blob container dataset mapping. +// BlobContainerDataSetMapping a Blob container data set mapping. type BlobContainerDataSetMapping struct { - // BlobContainerMappingProperties - Blob container dataset mapping properties. + // BlobContainerMappingProperties - Blob container data set mapping properties. *BlobContainerMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -2259,13 +2259,13 @@ func (bcdsm *BlobContainerDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobContainerMappingProperties azure storage Blob container dataset mapping property bag. +// BlobContainerMappingProperties azure storage Blob container data set mapping property bag. type BlobContainerMappingProperties struct { // ContainerName - BLOB Container name. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // ResourceGroup - Resource group of storage account. ResourceGroup *string `json:"resourceGroup,omitempty"` @@ -2289,9 +2289,9 @@ type BlobContainerProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobDataSet an Azure storage blob dataset. +// BlobDataSet an Azure storage blob data set. type BlobDataSet struct { - // BlobProperties - Blob dataset properties. + // BlobProperties - Blob data set properties. *BlobProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -2436,9 +2436,9 @@ func (bds *BlobDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobDataSetMapping a Blob dataset mapping. +// BlobDataSetMapping a Blob data set mapping. type BlobDataSetMapping struct { - // BlobMappingProperties - Blob dataset mapping properties. + // BlobMappingProperties - Blob data set mapping properties. *BlobMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -2573,9 +2573,9 @@ func (bdsm *BlobDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderDataSet an Azure storage blob folder dataset. +// BlobFolderDataSet an Azure storage blob folder data set. type BlobFolderDataSet struct { - // BlobFolderProperties - Blob folder dataset properties. + // BlobFolderProperties - Blob folder data set properties. *BlobFolderProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -2720,9 +2720,9 @@ func (bfds *BlobFolderDataSet) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderDataSetMapping a Blob folder dataset mapping. +// BlobFolderDataSetMapping a Blob folder data set mapping. type BlobFolderDataSetMapping struct { - // BlobFolderMappingProperties - Blob folder dataset mapping properties. + // BlobFolderMappingProperties - Blob folder data set mapping properties. *BlobFolderMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -2857,13 +2857,13 @@ func (bfdsm *BlobFolderDataSetMapping) UnmarshalJSON(body []byte) error { return nil } -// BlobFolderMappingProperties azure storage Blob folder dataset mapping property bag. +// BlobFolderMappingProperties azure storage Blob folder data set mapping property bag. type BlobFolderMappingProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // Prefix - Prefix for blob folder Prefix *string `json:"prefix,omitempty"` @@ -2891,13 +2891,13 @@ type BlobFolderProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty"` } -// BlobMappingProperties azure storage Blob dataset mapping property bag. +// BlobMappingProperties azure storage Blob data set mapping property bag. type BlobMappingProperties struct { // ContainerName - Container that has the file path. ContainerName *string `json:"containerName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // FilePath - File path within the source data set FilePath *string `json:"filePath,omitempty"` @@ -3749,7 +3749,7 @@ func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetL return DataSetListPage{fn: getNextPage} } -// BasicDataSetMapping a dataset mapping data transfer object. +// BasicDataSetMapping a data set mapping data transfer object. type BasicDataSetMapping interface { AsBlobDataSetMapping() (*BlobDataSetMapping, bool) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) @@ -3762,7 +3762,7 @@ type BasicDataSetMapping interface { AsDataSetMapping() (*DataSetMapping, bool) } -// DataSetMapping a dataset mapping data transfer object. +// DataSetMapping a data set mapping data transfer object. type DataSetMapping struct { autorest.Response `json:"-"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' @@ -6487,9 +6487,9 @@ func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Conte return SourceShareSynchronizationSettingListPage{fn: getNextPage} } -// SQLDBTableDataSet a SQL DB table dataset. +// SQLDBTableDataSet a SQL DB table data set. type SQLDBTableDataSet struct { - // SQLDBTableProperties - SQL DB table dataset properties. + // SQLDBTableProperties - SQL DB table data set properties. *SQLDBTableProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -6634,9 +6634,9 @@ func (sdtds *SQLDBTableDataSet) UnmarshalJSON(body []byte) error { return nil } -// SQLDBTableDataSetMapping a SQL DB Table dataset mapping. +// SQLDBTableDataSetMapping a SQL DB Table data set mapping. type SQLDBTableDataSetMapping struct { - // SQLDBTableDataSetMappingProperties - Sql DB dataset mapping properties. + // SQLDBTableDataSetMappingProperties - Sql DB data set mapping properties. *SQLDBTableDataSetMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -6775,9 +6775,9 @@ func (sdtdsm *SQLDBTableDataSetMapping) UnmarshalJSON(body []byte) error { type SQLDBTableDataSetMappingProperties struct { // DatabaseName - DatabaseName name of the sink data set DatabaseName *string `json:"databaseName,omitempty"` - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // SQLServerResourceID - Resource id of SQL server SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` @@ -6797,9 +6797,9 @@ type SQLDBTableProperties struct { TableName *string `json:"tableName,omitempty"` } -// SQLDWTableDataSet a SQL DW table dataset. +// SQLDWTableDataSet a SQL DW table data set. type SQLDWTableDataSet struct { - // SQLDWTableProperties - SQL DW table dataset properties. + // SQLDWTableProperties - SQL DW table data set properties. *SQLDWTableProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindSQLDWTable', 'KindSQLDBTable' Kind Kind `json:"kind,omitempty"` @@ -6944,9 +6944,9 @@ func (sdtds *SQLDWTableDataSet) UnmarshalJSON(body []byte) error { return nil } -// SQLDWTableDataSetMapping a SQL DW Table dataset mapping. +// SQLDWTableDataSetMapping a SQL DW Table data set mapping. type SQLDWTableDataSetMapping struct { - // SQLDWTableDataSetMappingProperties - Sql DW dataset mapping properties. + // SQLDWTableDataSetMappingProperties - Sql DW data set mapping properties. *SQLDWTableDataSetMappingProperties `json:"properties,omitempty"` // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' Kind KindBasicDataSetMapping `json:"kind,omitempty"` @@ -7083,9 +7083,9 @@ func (sdtdsm *SQLDWTableDataSetMapping) UnmarshalJSON(body []byte) error { // SQLDWTableDataSetMappingProperties properties of the SQL DW table data set mapping. type SQLDWTableDataSetMappingProperties struct { - // DataSetID - Gets the id of source dataset. + // DataSetID - The id of the source data set. DataSetID *string `json:"dataSetId,omitempty"` - // DataSetMappingStatus - Gets the status of the dataset mapping. Possible values include: 'Ok', 'Broken' + // DataSetMappingStatus - Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` // DataWarehouseName - DataWarehouse name of the source data set DataWarehouseName *string `json:"dataWarehouseName,omitempty"` @@ -7107,37 +7107,37 @@ type SQLDWTableProperties struct { TableName *string `json:"tableName,omitempty"` } -// SynchronizationDetails synchronization details at dataset level +// SynchronizationDetails synchronization details at data set level type SynchronizationDetails struct { // DataSetID - READ-ONLY; id of dataSet DataSetID *string `json:"dataSetId,omitempty"` // DataSetType - READ-ONLY; type of DataSet. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SQLDBTable', 'SQLDWTable' DataSetType DataSetType `json:"dataSetType,omitempty"` - // DurationMs - READ-ONLY; duration of dataset level copy + // DurationMs - READ-ONLY; duration of data set level copy DurationMs *int32 `json:"durationMs,omitempty"` - // EndTime - READ-ONLY; End time of dataset level copy + // EndTime - READ-ONLY; End time of data set level copy EndTime *date.Time `json:"endTime,omitempty"` - // FilesRead - READ-ONLY; The number of files read from the source dataset. + // FilesRead - READ-ONLY; The number of files read from the source data set. FilesRead *int64 `json:"filesRead,omitempty"` - // FilesWritten - READ-ONLY; The number of files written into the sink dataset. + // FilesWritten - READ-ONLY; The number of files written into the sink data set. FilesWritten *int64 `json:"filesWritten,omitempty"` // Message - READ-ONLY; Error Message if any Message *string `json:"message,omitempty"` // Name - READ-ONLY; name of dataSet Name *string `json:"name,omitempty"` - // RowsCopied - READ-ONLY; The number of files copied into the sink dataset. + // RowsCopied - READ-ONLY; The number of files copied into the sink data set. RowsCopied *int64 `json:"rowsCopied,omitempty"` - // RowsRead - READ-ONLY; The number of rows read from the source dataset. + // RowsRead - READ-ONLY; The number of rows read from the source data set. RowsRead *int64 `json:"rowsRead,omitempty"` - // SizeRead - READ-ONLY; The size of the data read from the source dataset in bytes. + // SizeRead - READ-ONLY; The size of the data read from the source data set in bytes. SizeRead *int64 `json:"sizeRead,omitempty"` - // SizeWritten - READ-ONLY; The size of the data written into the sink dataset in bytes. + // SizeWritten - READ-ONLY; The size of the data written into the sink data set in bytes. SizeWritten *int64 `json:"sizeWritten,omitempty"` - // StartTime - READ-ONLY; start time of dataset level copy + // StartTime - READ-ONLY; start time of data set level copy StartTime *date.Time `json:"startTime,omitempty"` // Status - READ-ONLY; Raw Status Status *string `json:"status,omitempty"` - // VCore - READ-ONLY; The vCore units consumed for the dataset synchronization. + // VCore - READ-ONLY; The vCore units consumed for the data set synchronization. VCore *int64 `json:"vCore,omitempty"` } diff --git a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/version.go b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/version.go index 8b6a39d6cbd9..b9d91dcbfd29 100644 --- a/services/preview/datashare/mgmt/2018-11-01-preview/datashare/version.go +++ b/services/preview/datashare/mgmt/2018-11-01-preview/datashare/version.go @@ -19,12 +19,12 @@ package datashare // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/1.0.0 datashare/2018-11-01-preview" + return "Azure-SDK-For-Go/1.0.1 datashare/2018-11-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "1.0.0" + return "1.0.1" } -// tag: services/preview/datashare/mgmt/2018-11-01-preview/datashare/v1.0.0 +// tag: services/preview/datashare/mgmt/2018-11-01-preview/datashare/v1.0.1 diff --git a/tools/moduler/cmd/root_test.go b/tools/moduler/cmd/root_test.go index 6e7b42967ce9..84deddae4398 100644 --- a/tools/moduler/cmd/root_test.go +++ b/tools/moduler/cmd/root_test.go @@ -41,21 +41,6 @@ var ( "tools/testdata/scenarioe/foo/v1.1.0", "tools/testdata/scenarioe/foo/v2.0.0", "tools/testdata/scenarioe/foo/v2.1.0", - "tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/v1.0.0", - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.0.0", - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.1.0", - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.2.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.0.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.0.1", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.1", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.2", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.0.0", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.0.1", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.0", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.1", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.2", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2.0.0", } ) @@ -100,9 +85,6 @@ func Test_findAllVersionFiles(t *testing.T) { "../../testdata/scenariog/foo/mgmt/2019-10-11/foo/v2/version.go", "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/version.go", "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2/version.go", - "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo/version.go", - "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/version.go", - "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2/version.go", } root, err := filepath.Abs("../../testdata") if err != nil { @@ -182,9 +164,6 @@ func Test_readNewTags(t *testing.T) { "tools/testdata/scenariof/foo/v1.0.0", "tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/v2.0.0", "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2.0.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.2", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.2", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2.0.0", } root, err := filepath.Abs("../../testdata") if err != nil { diff --git a/tools/testdata/README.md b/tools/testdata/README.md index 69cf4900d3a6..7f2ecab23088 100644 --- a/tools/testdata/README.md +++ b/tools/testdata/README.md @@ -8,10 +8,4 @@ | d | Yes | Yes | v1, v2 | Yes | | e | Yes | No | v1, v2 | Yes | | f | Yes | No | None | Yes | -| g | Yes | Yes | v1 | Yes | -| h | Yes | Yes | v1 | Yes | -| i | No | No | v1 | Yes | -| j | No | No | v1, v2 | Yes | - -* For i, all files in v1 and stage are identical with each other. In this case, no version should be bumped. -* For j, all files in v2 and stage are identical with each other. In this case, no version should be bumped. \ No newline at end of file +| g | Yes | Yes | v1 | Yes | \ No newline at end of file diff --git a/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/go.mod b/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/go.mod index 82d6f4eca2e2..9ded283f48b3 100644 --- a/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/go.mod +++ b/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/go.mod @@ -1,3 +1,3 @@ -module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo +module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo go 1.12 diff --git a/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/stage/go.mod b/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/stage/go.mod index 82d6f4eca2e2..9ded283f48b3 100644 --- a/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/stage/go.mod +++ b/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/stage/go.mod @@ -1,3 +1,3 @@ -module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo +module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo go 1.12 diff --git a/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/go.mod b/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/go.mod index a4f9958840c9..4f5aef0031ea 100644 --- a/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/go.mod +++ b/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/go.mod @@ -1,3 +1,3 @@ -module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo +module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo go 1.12 diff --git a/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage/go.mod b/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage/go.mod index a4f9958840c9..4f5aef0031ea 100644 --- a/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage/go.mod +++ b/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage/go.mod @@ -1,3 +1,3 @@ -module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo +module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo go 1.12 diff --git a/tools/versioner/cmd/root_test.go b/tools/versioner/cmd/root_test.go index f8d9b8cc9ea4..a524ad98c580 100644 --- a/tools/versioner/cmd/root_test.go +++ b/tools/versioner/cmd/root_test.go @@ -46,8 +46,6 @@ func Test_findAllSubDirectories(t *testing.T) { "../../testdata/scenariof/foo/stage", "../../testdata/scenariog/foo/mgmt/2019-10-11/foo/stage", "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage", - "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo/stage", - "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/stage", } root, err := filepath.Abs("../../testdata") if err != nil { diff --git a/tools/versioner/cmd/unstage.go b/tools/versioner/cmd/unstage.go index 233282570f07..43dc027e5e5e 100644 --- a/tools/versioner/cmd/unstage.go +++ b/tools/versioner/cmd/unstage.go @@ -101,6 +101,9 @@ func theUnstageCommand(args []string) (string, error) { if err != nil { return "", fmt.Errorf("failed to create module info: %v", err) } + if err := writeChangelog(stage, mod); err != nil { + return "", fmt.Errorf("failed to write changelog: %v", err) + } var tag string if mod.BreakingChanges() { tag, err = forSideBySideRelease(stage, mod) @@ -140,10 +143,6 @@ func forSideBySideRelease(stage string, mod modinfo.Provider) (string, error) { if err := updateVersion(stage, tag); err != nil { return "", fmt.Errorf("failed to update version.go: %v", err) } - // write change log - if err := writeChangelog(stage, mod); err != nil { - return "", fmt.Errorf("failed to write changelog: %v", err) - } // move staging to new LMV directory if err = os.Rename(stage, mod.DestDir()); err != nil { return "", fmt.Errorf("failed to rename '%s' to '%s': %v", stage, mod.DestDir(), err) @@ -181,14 +180,6 @@ func forInplaceUpdate(lmv, stage string, mod modinfo.Provider) (string, error) { if err := updateVersion(stage, tag); err != nil { return "", fmt.Errorf("failed to update version.go: %v", err) } - // write changelog - if hasChange, err := mod.HasChanges(); err != nil { - return "", fmt.Errorf("failed to check changes: %v", err) - } else if hasChange { - if err := writeChangelog(stage, mod); err != nil { - return "", fmt.Errorf("failed to write changelog: %v", err) - } - } // move staging directory over the LMV by first deleting LMV then renaming stage if modinfo.HasVersionSuffix(lmv) { if err := os.RemoveAll(lmv); err != nil { @@ -494,13 +485,9 @@ func calculateModuleTag(tags []string, mod modinfo.Provider) (string, error) { n := sv.IncMinor() sv = &n } else { - // no new exports and has changes, this is a patch update - if hasChange, err := mod.HasChanges(); err != nil { - return "", err - } else if hasChange { - n := sv.IncPatch() - sv = &n - } + // no new exports, this is a patch update + n := sv.IncPatch() + sv = &n } return strings.Replace(tag, v, "v"+sv.String(), 1), nil } diff --git a/tools/versioner/cmd/unstage_test.go b/tools/versioner/cmd/unstage_test.go index 6dcf1f170e9e..5a364001e073 100644 --- a/tools/versioner/cmd/unstage_test.go +++ b/tools/versioner/cmd/unstage_test.go @@ -137,11 +137,6 @@ func (mock mockModInfo) GenerateReport() report.Package { return report.Package{} } -func (mock mockModInfo) HasChanges() (bool, error) { - // not needed by tests - return true, nil -} - func Test_calculateModuleTagMajorV1(t *testing.T) { pkg := mockModInfo{ dir: filepath.Join("work", "src", "github.com", "Azure", "azure-sdk-for-go", "services", "foo"), @@ -583,11 +578,11 @@ func Test_theCommandNewMgmtMajorV2(t *testing.T) { cleanTestData() defer cleanTestData() getTagsHook = func(root string, prefix string) ([]string, error) { - if !strings.HasSuffix(prefix, "testdata/scenariog/foo/mgmt/2019-10-11/foo") { + if !strings.HasPrefix(prefix, "/testdata/scenariog/foo") { return nil, fmt.Errorf("bad prefix '%s'", prefix) } return []string{ - "tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/v1.0.0", + "/testdata/scenariog/foo/mgmt/2019-10-11/foo/v1.0.0", }, nil } stage, err := filepath.Abs("../../testdata/scenariog/foo/mgmt/2019-10-11/foo/stage") @@ -602,7 +597,7 @@ func Test_theCommandNewMgmtMajorV2(t *testing.T) { if tag != expectedTag { t.Fatalf("bad tag, expected '%s' got '%s'", expectedTag, tag) } - expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo/mgmt/2019-10-11/foo/v2\n\n%s\n", goVersion) + expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenariog/foo/v2\n\n%s\n", goVersion) verifyGoMod(t, "../../testdata/scenariog/foo/mgmt/2019-10-11/foo/v2", expectedMod) verifyVersion(t, "../../testdata/scenariog/foo/mgmt/2019-10-11/foo/v2", "2.0.0", tag) verifyChangelog(t, "../../testdata/scenariog/foo/mgmt/2019-10-11/foo/v2") @@ -614,13 +609,13 @@ func Test_theCommandNewMgmtMajorV2WithOneLineImport(t *testing.T) { cleanTestData() defer cleanTestData() getTagsHook = func(root string, prefix string) ([]string, error) { - if !strings.HasSuffix(prefix, "testdata/scenarioh/foo/mgmt/2019-10-11/foo") { + if !strings.HasPrefix(prefix, "/testdata/scenarioh/foo") { return nil, fmt.Errorf("bad prefix '%s'", prefix) } return []string{ - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.0.0", - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.1.0", - "tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.2.0", + "/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.0.0", + "/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.1.0", + "/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v1.2.0", }, nil } stage, err := filepath.Abs("../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/stage") @@ -635,80 +630,9 @@ func Test_theCommandNewMgmtMajorV2WithOneLineImport(t *testing.T) { if tag != expectedTag { t.Fatalf("bad tag, expected '%s' got '%s'", expectedTag, tag) } - expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2\n\n%s\n", goVersion) + expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioh/foo/v2\n\n%s\n", goVersion) verifyGoMod(t, "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2", expectedMod) verifyVersion(t, "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2", "2.0.0", tag) verifyChangelog(t, "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo/v2") verifyGoVet(t, "../../testdata/scenarioh/foo/mgmt/2019-10-11/foo") } - -// scenarioi -func Test_theCommandNoAnyChange(t *testing.T) { - cleanTestData() - defer cleanTestData() - getTagsHook = func(root string, prefix string) ([]string, error) { - if !strings.HasSuffix(prefix, "testdata/scenarioi/foo/mgmt/2019-10-23/foo") { - return nil, fmt.Errorf("bad prefix '%s'", prefix) - } - return []string{ - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.0.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.0.1", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.0", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.1", - "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.2", - }, nil - } - stage, err := filepath.Abs("../../testdata/scenarioi/foo/mgmt/2019-10-23/foo/stage") - if err != nil { - t.Fatalf("failed: %v", err) - } - tag, err := theUnstageCommand([]string{stage}) - if err != nil { - t.Fatalf("failed: %v", err) - } - const expectedTag = "tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo/v1.1.2" - if tag != expectedTag { - t.Fatalf("bad tag, expected '%s' got '%s'", expectedTag, tag) - } - expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioi/foo/mgmt/2019-10-23/foo\n\n%s\n", goVersion) - verifyGoMod(t, "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo", expectedMod) - verifyVersion(t, "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo", "1.1.2", tag) - verifyNoChangelog(t, "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo") - verifyGoVet(t, "../../testdata/scenarioi/foo/mgmt/2019-10-23/foo") -} - -// scenarioj -func Test_theCommandNoAnyChangeV2(t *testing.T) { - cleanTestData() - defer cleanTestData() - getTagsHook = func(root string, prefix string) ([]string, error) { - if !strings.HasSuffix(prefix, "testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2") { - return nil, fmt.Errorf("bad prefix '%s'", prefix) - } - return []string{ - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.0.0", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.0.1", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.0", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.1", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v1.1.2", - "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2.0.0", - }, nil - } - stage, err := filepath.Abs("../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/stage") - if err != nil { - t.Fatalf("failed: %v", err) - } - tag, err := theUnstageCommand([]string{stage}) - if err != nil { - t.Fatalf("failed: %v", err) - } - const expectedTag = "tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2.0.0" - if tag != expectedTag { - t.Fatalf("bad tag, expected '%s' got '%s'", expectedTag, tag) - } - expectedMod := fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/tools/testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2\n\n%s\n", goVersion) - verifyGoMod(t, "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2", expectedMod) - verifyVersion(t, "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2", "2.0.0", tag) - verifyNoChangelog(t, "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2") - verifyGoVet(t, "../../testdata/scenarioj/foo/mgmt/2019-10-23/foo/v2") -}