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

install mixin from url #265

Merged
merged 11 commits into from
Apr 15, 2019
Merged

install mixin from url #265

merged 11 commits into from
Apr 15, 2019

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Apr 12, 2019

This implements the first part of mixin installation

$ porter mixin install NAME --version VERSION --url URL

for now --url is required, but once we introduce subscriptions (i.e. being able to follow all the mixins from deislabs) it won't be anymore.

Docs available at https://deploy-preview-265--porter.netlify.com/mixin-distribution/

@ghost ghost assigned carolynvs Apr 12, 2019
@ghost ghost added the review label Apr 12, 2019
Previously these were in embedded fields which caused collisions, as
both mixins and cnab actions had "Install" or "Uninstall". Also it was
confusing when porter needed to also have a composite function that
handled installing a bundle that wrapped up functionality from the CNAB
InstallBundle function. It was hard to know what to call when.

So I've moved the interfaces for the CNAB and Mixin providers into
named fields so that it's more clear which are the methods owned by the
Porter struct (and should be used by the cli).
Explain how to publish a mixin that works with porter install
* Close gap between page title and initial content
* Title should be h1
Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

This is looking great. A few thoughts at this stage...

pkg/mixin/install.go Outdated Show resolved Hide resolved
pkg/mixin/install.go Outdated Show resolved Hide resolved
pkg/mixin/provider/install.go Outdated Show resolved Hide resolved
docs/content/mixin-distribution.md Show resolved Hide resolved
cmd/porter/mixins.go Outdated Show resolved Hide resolved
pkg/mixin/provider/install.go Outdated Show resolved Hide resolved
cmd/porter/mixins.go Show resolved Hide resolved
@carolynvs
Copy link
Member Author

Thanks for the solid review. I think all your comments have been addressed but it's now Friday at 5 sooooooooooooo 💨

Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

Nice! Just left a few more notes, but definitely good with attending either/all at a later date.

pkg/mixin/provider/install_test.go Show resolved Hide resolved
@carolynvs carolynvs marked this pull request as ready for review April 15, 2019 13:47
@carolynvs
Copy link
Member Author

I'm going to leave out updating the cli.md file for now. It's so momumentally out of date it's not even funny and later figure out how to code-gen it from cobra.

@carolynvs
Copy link
Member Author

The test is failing on brigade because it runs as root, so my little trick of making a file that the current user can't read doesn't work. We can either keep the test, and not run as root, or fix/remove the test. I'm not sure of how else to sabotage that test though. Thoughts?

@vdice
Copy link
Member

vdice commented Apr 15, 2019

Ah. Hmmm, I'm assuming running as a non-root user would require a non-trivial amount of work and affect all tests? Otherwise, my only idea would be to mock out and enable use of a test filesystem such that we can make sure Create returns an error...

Either way, it sounds a bit tricky and may not be worth the cost. I'll defer to your judgement here.

@carolynvs
Copy link
Member Author

I don't have an off the shelf fake tool for making those methods fail on demand. So for every variation of the test we'd have a hand rolled fake which is way too much effort for this test IMO. For now I vote to leave it off, unless someone else wants to try to tackle that later? We'd end up making a general purpose new type of AferoFS that can be told to sabotage any of its operations. I don't want to try to do that in this PR however, it could come in handy later if we wan to try to do fakes at that level in all of our tests.

@carolynvs carolynvs merged commit 02a67db into getporter:master Apr 15, 2019
@carolynvs carolynvs deleted the mixin-install branch April 15, 2019 19:09
@ghost ghost removed the review label Apr 15, 2019
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