-
Notifications
You must be signed in to change notification settings - Fork 841
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
Cobrify profileBuilder
#1054
Cobrify profileBuilder
#1054
Conversation
Known issue: for some reason it isn't respecting arguments. (Obviously I intend on fixing this before merging) |
Let's rename the definition.go files to generate.go (there is prior art to this pattern). |
Also can you update the README with instructions and example command lines? |
Like I mentioned in a previous PR, to respect the new repo status we need to use the list strategy using the file at https://github.com/Azure/azure-sdk-for-go/blob/dev/profiles/latest/stableApis.txt that gets generated when generating the code. Refers to: profiles/preview/definition.go:4 in c426bb6. [](commit_id = c426bb6c93ac89b2bba224606b0497a1d3cfda56, deletion_comment = False) |
@@ -1,5 +1,5 @@ | |||
#!bin/bash | |||
set -ev | |||
if [[ ! "${TRAVIS_GO_VERSION}" < "1.9" ]]; then | |||
go test -v github.com/Azure/azure-sdk-for-go/tools/profileBuilder | |||
go test -v github.com/Azure/azure-sdk-for-go/tools/profileBuilder/... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a go vet here also ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 99a687b
// profileBuilder. | ||
// | ||
// This package is not governed by the SemVer associated with the rest of the | ||
// Azure-SDK-for-Go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing license info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3debc48.
|
||
var packageName = regexp.MustCompile(`services[/\\](?P<provider>[\w\-\.\d_\\/]+)[/\\](?:(?P<arm>` + armPathModifier + `)[/\\])?(?P<version>v?\d{4}-\d{2}-\d{2}[\w\d\.\-]*|v?\d+\.\d+[\.\d\w\-]*)[/\\](?P<group>[/\\\w\d\-\._]+)`) | ||
|
||
// BuildProfile takes a list of packages and creates a profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume transforms
and transforms_test
are mostly a copy paste from program
and program_test
would have been good if we can keep the history ( i.e. move and rename the file -> commit -> modify -> commit) .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3943639.
This should considerably ease the usage of the profileBuilder.
The `profileBuilder` lives in the same repository as the Azure-SDK-for-Go, but is a logically separate enough tool that it warrants having its own `dep` manifest. For further reading on how `dep` handles multiple manifests, read here: https://golang.github.io/dep/docs/glossary.html#project-root
Fixed in 531faa8 |
An extra special character was breaking CI. I removed it to squelch the message. Also, renaming the profile `definition.go` files to `generate.go` files as per review feedback.
Fixed in 9c3ee4f |
// Package model holds the business logic for the operations made available by | ||
// profileBuilder. | ||
// | ||
// This package is not governed by the SemVer associated with the rest of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go in the README instead? I think it gets lost among the license header. It's a small issue though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it here so that it shows up in GoDoc.org, I'll copy it into the README as well though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d7cb677
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring
profileBuilder
to use cobra/viper. The ultimate idea being to make it easier to run.With the addition of the
defintion.go
files in the profiles, we should even be able to just run:Fixes #1044
Thanks you for your contribution to the Azure-SDK-for-Go! We will triage and review it as quickly as we can.
As part of your submission, please make sure that you can make the following assertions:
dev
branch, or I'm fixing a bug that warrants its own release and I'm targeting themaster
branch.master
branch, I've also added a note to CHANGELOG.md.