Merge lp://qastaging/~mterry/snapcraft/yaml-info into lp://qastaging/~snappy-dev/snapcraft/abandoned-go-trunk

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 7
Merged at revision: 4
Proposed branch: lp://qastaging/~mterry/snapcraft/yaml-info
Merge into: lp://qastaging/~snappy-dev/snapcraft/abandoned-go-trunk
Diff against target: 497 lines (+399/-10)
10 files modified
cmd/snapcraft/cmd_scratch.go (+30/-0)
cmd/snapcraft/cmd_scratch_info.go (+66/-0)
cmd/snapcraft/cmd_scratch_info_test.go (+68/-0)
cmd/snapcraft/parse.go (+23/-4)
cmd/snapcraft/parse_test.go (+21/-5)
config/yaml.go (+70/-0)
config/yaml_test.go (+97/-0)
dependencies.tsv (+1/-0)
docs/yaml.md (+21/-1)
gen-coverage.sh (+2/-0)
To merge this branch: bzr merge lp://qastaging/~mterry/snapcraft/yaml-info
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Ted Gould Pending
Review via email: mp+261665@code.qastaging.launchpad.net

Commit message

Add basic yaml parsing and simple 'xscratch info' command.

This is just a code drop for some stuff I think we'll need in SOME form, even if it changes slightly down the road.

There are two main additions here. One is a config module that handles parsing our snappy.yaml format. Just basic stuff so far.

And the other is a new command to actually exercise that code, by dumping out the scratch build environment's configuration (which we don't have any code to actually manage yet, but one can fake it).

I've followed the example of our existing specification and used "x-" liberally to make sure everyone understands things are in flux. Even for the 'scratch' command, where I've used 'xscratch' instead.

And I've kept our unit test coverage at 100%. Woo!

Description of the change

Add basic yaml parsing and simple 'xscratch info' command.

This is just a code drop for some stuff I think we'll need in SOME form, even if it changes slightly down the road.

There are two main additions here. One is a config module that handles parsing our snappy.yaml format. Just basic stuff so far.

And the other is a new command to actually exercise that code, by dumping out the scratch build environment's configuration (which we don't have any code to actually manage yet, but one can fake it).

I've followed the example of our existing specification and used "x-" liberally to make sure everyone understands things are in flux. Even for the 'scratch' command, where I've used 'xscratch' instead.

And I've kept our unit test coverage at 100%. Woo!

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Nice work! I added some inline comments but its mostly nitpicking, feel free to ignore.

review: Approve
Revision history for this message
Michael Terry (mterry) :
Revision history for this message
Michael Terry (mterry) wrote :

OK, added comments to your nits, and switched from a custom test setup func to SetUpTest. Thanks!

Revision history for this message
Michael Vogt (mvo) wrote :

Nice update! Interessting that ErrorMatch/Matches does not work on multiline strings. Haven't used it for that yet myself.

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Hope its ok that I top-approved this - or is that something you want to handle inside your sub-project yourself, i.e. only one of the two of you should top-approve? I don't mind I just don't want to stop on toes here :)

Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~mterry/snapcraft/yaml-info into lp:snapcraft failed. Below is the output from the failed tests.

/bin/sh: 1: ./.tarmac.sh: Permission denied

Revision history for this message
Michael Terry (mterry) wrote :

Good question. I'm not sure? Maybe this early on, it would be good to have Ted look at it too. But in general, I'd like to be in the whole snappy umbrella review team. That way we get awesome Go advice from you folks (i.e. you stop us from doing stupid Go things) and keep conventions the same. :)

Revision history for this message
Michael Terry (mterry) wrote :

OK, Ted said he looked it over and said it's fine. Thanks for the review, mvo!

Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

The attempt to merge lp:~mterry/snapcraft/yaml-info into lp:snapcraft failed. Below is the output from the failed tests.

Checking docs
Checking formatting
Installing godeps
Install golint
Obtaining dependencies
update github.com/jessevdk/go-flags failed; trying to fetch newer version
update gopkg.in/check.v1 failed; trying to fetch newer version
github.com/jessevdk/go-flags now at 15347ef417a300349807983f15af9e65cd2e1b3a
gopkg.in/check.v1 now at 64131543e7896d5bcc6bd5a76287eb75ea96c673
Building

# we always run in a fresh dir in tarmac
export GOPATH=$(mktemp -d)
trap 'rm -rf "$GOPATH"' EXIT

# this is a hack, but not sure tarmac is golang friendly
mkdir -p $GOPATH/src/launchpad.net/snapcraft
cp -a . $GOPATH/src/launchpad.net/snapcraft/
cd $GOPATH/src/launchpad.net/snapcraft

./run-checks

if which goctest >/dev/null; then
    goctest="goctest"
else
    goctest="go test"
fi

echo Checking docs
./mdlint.py README.md docs/*.md

echo Checking formatting
fmt=$(gofmt -l .)

if [ -n "$fmt" ]; then
    echo "Formatting wrong in following files"
    echo $fmt
    exit 1
fi

echo Installing godeps
go get launchpad.net/godeps
export PATH=$PATH:$GOPATH/bin

echo Install golint
go get github.com/golang/lint/golint
export PATH=$PATH:$GOPATH/bin

echo Obtaining dependencies
godeps -u dependencies.tsv

echo Building
go build -v launchpad.net/snapcraft/...
config/yaml.go:26:2: cannot find package "gopkg.in/yaml.v2" in any of:
 /usr/lib/go/src/pkg/gopkg.in/yaml.v2 (from $GOROOT)
 /home/tarmac/tmp/tmp.5bGMFmzBB5/src/gopkg.in/yaml.v2 (from $GOPATH)

7. By Michael Terry

Add new yaml.v2 dependency

Revision history for this message
Leo Arias (elopio) :
Revision history for this message
Michael Terry (mterry) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches