Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gcavanunez
Copy link

@gcavanunez gcavanunez commented Apr 2, 2025

Changes

  • Adds PullCommand that downloads recipes from the Mise webapp
  • Adds MiseService for API communication with mise.dev
  • Adds LocalRecipesService for local recipe management with lock file tracking (mise-lock.json)
  • Tweaks Recipes class to support recursive loading from local recipe directories

Demo

mise-pull-demo.mp4

Notes

We may want to hold off on this guy until we get the saas app uup and running.

Copy link
Member

@mattstauffer mattstauffer left a comment

Choose a reason for hiding this comment

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

Looks great so far!

@gcavanunez gcavanunez marked this pull request as ready for review April 4, 2025 15:08
@gcavanunez gcavanunez requested a review from mattstauffer April 4, 2025 15:09
if (empty($selectedRemoteRecipes)) {
return multiselect(
label: 'Which recipe(s) should I pull?',
options: app(MiseService::class)->allForSelect(),
Copy link
Member

Choose a reason for hiding this comment

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

OK, so there are a few things I have questions about.

How do we handle:

  • Recipes that we already have locally and haven't changed
  • Recipes that we already have locally and have changed
  • Recipes that we have a local one with the same name but it's not the same

Copy link
Author

@gcavanunez gcavanunez Jul 8, 2025

Choose a reason for hiding this comment

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

Recipes that we already have locally and haven't changed
Recipes that we already have locally and have changed

Added a check in the flow to validate whether we have selected new, unchanged or updated Recipes, we then prompt the user to either skip-unchanged or overwrite-all

Recipes that we have a local one with the same name but it's not the same

This one is a bit more tricky, currently have leaned that downloaded Recipes live under a chosen namespace, in practice however given the saas app will have a username, perhaps it's best to have downloaded Recipes live at {GithubHandle}\{Namespace}\{Recipes|Steps}


private function install($key)
{
info('Installing recipe: ' . $key);
Copy link
Member

Choose a reason for hiding this comment

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

I'm never totally sure about best practices here, but is there any value in us shipping a hash of the file contents? I know people do that, but I'm trying to figure out if there's any way that helps us in this context.

Copy link
Author

Choose a reason for hiding this comment

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

Have leaned into a simple sha512 integrity check, the api would return the the integrity check, and then we would also perform a hash check when we download the content/zip file

@mattstauffer
Copy link
Member

@gcavanunez ready for another review?

@mattstauffer
Copy link
Member

@gcavanunez Checking in--lmk when this is ready for a review!

here we're validating agaisnt the mise lock file to verify if changes to
versions or if the recipes already live locally
@gcavanunez gcavanunez requested a review from mattstauffer July 8, 2025 04:22
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.

2 participants