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

fix(manifest.go): fix Name property, add Description, add test #104

Merged
merged 3 commits into from
Jan 16, 2019

Conversation

vdice
Copy link
Member

@vdice vdice commented Dec 28, 2018

The main change here (mapping Manifest.Name to name in yaml, as opposed to image), fixes the issue wherein the name field in the bundle.json would be rendered empty after a porter build. This empty field prevents successful installation of the bundle (it cannot be found.)

@carolynvs
Copy link
Member

Let's hold off on this for a sec until I can clear my head from vacation. I think there's a bit of a mixup between how porter resolves bundle dependencies, and how people expect it to that prompted this fix.

I want to make sure that we have that clear in our heads before we merge any fixes related to that.

Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

Just some rando comments. I'm glad you wrote a test. ❤️

I'm going to leave the rest to Jeremy since he wrote this.

@@ -80,3 +82,35 @@ func TestPorter_prepareDockerFilesystem(t *testing.T) {
require.NoError(t, err)
assert.True(t, execMixinExists, "The exec-runtime mixin wasn't copied into %s", wantExecMixin)
}

func TestPorter_buildBundle(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Whatever else happens, let's make sure to keep a new test. 👍

@@ -20,7 +20,8 @@ type Manifest struct {
path string
outputs map[string]string

Name string `yaml:"image,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Looks like image is no longer being populated anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, if there was an image field in the example porter.yaml at one point, it is no longer there. I've assumed this should point to the name field, which is populated.

@carolynvs
Copy link
Member

@vdice Just in case this was in response #108, just wanted you to see that I created #109 to give us a space to figure out how to resolve bundle dependencies.

I think this was to fix duffle list? If you could clarify, that would be helpful! 😀

@vdice
Copy link
Member Author

vdice commented Jan 7, 2019

@carolynvs this PR originated with my using porter to build a bundle (bundle.json) from a porter.yaml file. Without this change, I noticed that the resulting bundle.json had an empty string for the name property -- due to Manifest.Name mapping to image in the provided yaml (porter.yaml), when it should (or I assumed it should) map to name. (I referenced the following example porter.yaml to inform my own).

Later, upon reading the issue in #108, I theorized this user perhaps was experiencing the effects of the same issue described above. So, not so much around the larger issue(s) of how Porter resolves dependencies, but more just a simple bug fix to ensure the go struct (Manifest) gets the data it needs (from porter.yaml) to output a correctly-formed bundle (bundle.json). (It appears, aside from this bug fix, there indeed are other areas needing attention, as you've mentioned.)

@carolynvs
Copy link
Member

Thanks for clarifying! I'm going to let @jeremyrickard take this from here, since it's not dependency related then.

@ghost ghost assigned vdice Jan 16, 2019
@ghost ghost added the review label Jan 16, 2019
Copy link
Contributor

@jeremyrickard jeremyrickard left a comment

Choose a reason for hiding this comment

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

LGTM

@jeremyrickard jeremyrickard merged commit 45bd6df into getporter:master Jan 16, 2019
@ghost ghost removed the review label Jan 16, 2019
@vdice vdice deleted the fix/manifest-to-bundle branch January 16, 2019 22:51
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