Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Adds pull command#21

Open
gcavanunez wants to merge 10 commits into
tighten:mainfrom
gcavanunez:gc/pull-recipe
Open

Adds pull command#21
gcavanunez wants to merge 10 commits into
tighten:mainfrom
gcavanunez:gc/pull-recipe

Conversation

@gcavanunez

@gcavanunez gcavanunez commented Apr 2, 2025

Copy link
Copy Markdown

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.

@mattstauffer mattstauffer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great so far!

Comment thread composer.json Outdated
Comment thread config/filesystems.php
@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
Comment thread stubs/recipe.stub Outdated
Comment thread app/Commands/PullCommand.php Outdated
if (empty($selectedRemoteRecipes)) {
return multiselect(
label: 'Which recipe(s) should I pull?',
options: app(MiseService::class)->allForSelect(),

Copy link
Copy Markdown
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

@gcavanunez gcavanunez Jul 8, 2025

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@gcavanunez ready for another review?

@mattstauffer

Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants