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

porter mixin update command #30

Closed
jeremyrickard opened this issue Nov 13, 2018 · 11 comments
Closed

porter mixin update command #30

jeremyrickard opened this issue Nov 13, 2018 · 11 comments
Assignees
Labels
enhancement New code incoming! help wanted Good for someone who has contributed before user experience 🌈💖 Make it easier for everyone to use Porter

Comments

@jeremyrickard
Copy link
Contributor

jeremyrickard commented Nov 13, 2018

Porter should have a way to update mixins that are installed.

See full instructions on what needs to be implemented #30 (comment)

@carolynvs carolynvs changed the title Porter should have the ability to update it's mixins Porter should have the ability to update mixins Dec 7, 2018
@carolynvs carolynvs added the user experience 🌈💖 Make it easier for everyone to use Porter label Jan 24, 2019
@carolynvs carolynvs added this to the Easy Bake Oven Edition milestone Jan 24, 2019
@carolynvs carolynvs added the enhancement New code incoming! label Feb 11, 2019
@carolynvs
Copy link
Member

This is waiting on #150 to be implemented (installing mixins).

@carolynvs carolynvs removed this from the Easy Bake Oven Edition milestone May 3, 2019
@carolynvs carolynvs added the good first issue Good for new contributors label Sep 14, 2019
@carolynvs carolynvs added this to the Mixin Distribution milestone Sep 14, 2019
@carolynvs carolynvs removed the good first issue Good for new contributors label Sep 14, 2019
@carolynvs
Copy link
Member

carolynvs commented Sep 14, 2019

The new command should be

porter mixin update NAME [--version|v VERSION]

An alternate form of the command can update all mixins. See #848 for an explanation for how --all should work.

porter mixin update --all
  • NAME or --all is required, but both cannot be specified
  • --version defaults to latest, and also understands a semver and canary

The following code will need to be modified:

  • cmd/porter/mixins - define a new cobra command for the update command
  • pkg/porter/mixins.go - define a new function to handle the command
  • pkg/mixins/mixin.go - Add an update function to the MixinProvider interface
  • pkg/mixins/provider/NEWFILE - implement the functionality
  • Link to the new command from the doc nav

See the mixin provider package.

When a mixin is installed, it records where the mixin was installed from in ~/.porter/mixins/cache.json (This is all in pkg/mixins/mixin.go) You should use this file to know the FeedURL or URL to use to find updated binaries for the mixin. If there isn't an entry in the cache for the mixin, try to install it instead using the Install function. If that fails, error out saying you couldn't find the mixin's source, please upgrade using porter mixin install --version.

@carolynvs carolynvs added good first issue Good for new contributors help wanted Good for someone who has contributed before and removed good first issue Good for new contributors labels Sep 14, 2019
@carolynvs carolynvs pinned this issue Oct 10, 2019
@carolynvs carolynvs added good first issue Good for new contributors and removed help wanted Good for someone who has contributed before labels Nov 1, 2019
@carolynvs carolynvs changed the title Porter should have the ability to update mixins porter mixin update command Jan 8, 2020
@carolynvs
Copy link
Member

carolynvs commented Jan 8, 2020

I've updated this issue to include --all from #848

@dev-drprasad
Copy link
Contributor

@carolynvs I think we can close this as it is duplicate of #848 and feature has been implemented

@carolynvs
Copy link
Member

#848 was a duplicate of this issue, which is why I closed it. The feature though has not yet been implemented. So if anyone wants to work on it, just leave a comment and give it a go!

@scriptonist
Copy link
Contributor

Hey, @carolynvs I can give it shot!

@carolynvs
Copy link
Member

@scriptonist I hope you started without waiting for me to reply. 👍 In case anyone is wondering, please know that it's okay to just leave a comment so that others know that you are working on it but you don't need to wait for me to assign. Thanks for taking it on!

@scriptonist
Copy link
Contributor

Hey @carolynvs thanks! I was feeling a bit under the weather and haven't started working on it, but will find some time to hack on it in the weekend.

@scriptonist
Copy link
Contributor

Hey, @carolynvs did things change a bit after this #30 (comment), did pkg/mixins get renamed to pkg/mixin? Also, should the Update function be part of the PackageManager interface?

@carolynvs
Copy link
Member

@scriptonist Ah yes, sorry about that, I did refactor mixins after that comment to account for plugins.

  • Yes it is pkg/mixin. I think that was a typo on my part in that original comment. Sorry about that!
  • Both mixins and plugins share a common implementation for searching, downloading and installing binaries.

Here is the interface that Porter relies on for both mixins and plugins. So just as you noted, that's where Update should be defined.

https://github.com/deislabs/porter/blob/86cd302984ae01da693f535e7adba85bc02cc323/pkg/pkgmgmt/pkgmgmt.go#L11-L20

The implementation should be in the FileSystem struct.

@carolynvs carolynvs added help wanted Good for someone who has contributed before and removed good first issue Good for new contributors labels Nov 17, 2020
@carolynvs carolynvs unpinned this issue Mar 22, 2021
@carolynvs
Copy link
Member

Closing in favor of the mixin design in getporter/proposals#7. Instead of managing a global mixin version, each bundle will specify which mixin and version it uses. There may be a command in porter to bump the version of a mixin used in a bundle, but that will come from the PEP and replace this anyway.

VinozzZ pushed a commit to VinozzZ/porter that referenced this issue May 19, 2022
* Add support for cli login for storage plugin

Signed-off-by: Simon Davies <[email protected]>

* updates from review

Signed-off-by: Simon Davies <[email protected]>

* missed review comments

Signed-off-by: Simon Davies <[email protected]>

* fix error message

Signed-off-by: Simon Davies <[email protected]>

* updated BOM handling

Signed-off-by: Simon Davies <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New code incoming! help wanted Good for someone who has contributed before user experience 🌈💖 Make it easier for everyone to use Porter
Projects
None yet
Development

No branches or pull requests

4 participants