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

Cobrify profileBuilder #1054

Merged
merged 10 commits into from
Feb 8, 2018
Merged

Cobrify profileBuilder #1054

merged 10 commits into from
Feb 8, 2018

Conversation

marstr
Copy link
Member

@marstr marstr commented Feb 7, 2018

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:

go generate ./profiles/...

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:

  • I'm not making changes to Auto-Generated files which will just get erased next time there's a release.
  • I've tested my changes, adding unit tests where applicable.
  • I've added Apache 2.0 Headers to the top of any new source files.
  • I'm submitting this PR to the dev branch, or I'm fixing a bug that warrants its own release and I'm targeting the master branch.
  • If I'm targeting the master branch, I've also added a note to CHANGELOG.md.
  • I've mentioned any relevant open issues in this PR, making clear the context for the contribution.

@marstr marstr self-assigned this Feb 7, 2018
@ghost ghost added the review label Feb 7, 2018
@marstr
Copy link
Member Author

marstr commented Feb 7, 2018

Known issue: for some reason it isn't respecting arguments. (Obviously I intend on fixing this before merging)

@jhendrixMSFT
Copy link
Member

Let's rename the definition.go files to generate.go (there is prior art to this pattern).

@jhendrixMSFT
Copy link
Member

Also can you update the README with instructions and example command lines?

@vladbarosan
Copy link

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/...

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 ?

Copy link
Member Author

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing license info

Copy link
Member Author

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

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) .

Copy link
Member Author

@marstr marstr Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3943639.

@marstr
Copy link
Member Author

marstr commented Feb 8, 2018

@marstr says:
Known issue: for some reason it isn't respecting arguments. (Obviously I intend on fixing this before merging)

I worked around this in e225c66, but don't like what I did. I threw an issue in our backlog to go clean this up. (#1060)

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
@marstr
Copy link
Member Author

marstr commented Feb 8, 2018

@jhendrixMSFT says:
Also can you update the README with instructions and example command lines?

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.
@marstr
Copy link
Member Author

marstr commented Feb 8, 2018

@jhendrixMSFT says:
Let's rename the definition.go files to generate.go (there is prior art to this pattern).

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d7cb677

Copy link

@vladbarosan vladbarosan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the 2 issues remaining that were created

#1066

#1060

@marstr marstr merged commit 396b427 into Azure:dev Feb 8, 2018
@ghost ghost removed the review label Feb 8, 2018
@marstr marstr deleted the cobrify branch February 15, 2018 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants