sharetribe / flex-cli

Flex CLI
https://www.sharetribe.com/docs/tutorials/getting-started-with-flex-cli/
Apache License 2.0
4 stars 1 forks source link

so people can create/push process and create/update alias without knowing beforehand what the current state of the process/alias is #100

Closed jayenashar closed 2 months ago

rap1ds commented 2 months ago

Hi there! Could you describe briefly why do you think this should be in the CLI? What's the problem that it's solving? Why is it important to be able to create/push process and create/update alias without knowing the current state beforehand?

What alternatives did you consider? E.g. could this be achieved with the current set of commands?

jayenashar commented 2 months ago

the main problem it solves is that i can easily script updates to the transaction process when i deploy changes to a live environment. i don't need to know if the live environment is new or being updated. i don't need to know if the transaction process is updated or not. the new command works in all cases to automate transaction process deployment from path to alias. the new command is idempotent as well, which the create commands are not.

the could be achieved with the current set of commands by wrapping them with something that parses the output. i've effectively done the same thing here but i moved it down a level so the cli wraps the api rather than having a separate script wrap the cli.

rap1ds commented 2 months ago

Thanks for explaining the use case for this! 🙏

I understand that this indeed brings some convenience. However, to me, it feels that this should indeed be done by the user e.g. writing a script that uses the CLI commands, as you've done already. Currently, the CLI commands are rather nice and simple, they do only one thing per command and then map well with the Build API endpoints. This command instead does quite many things at the same time. I think it's better to keep the CLI commands simple and if there's need for invoking multiple commands and orchestrating them, that's something users should do on their end.

I'm going to close this PR but in case I missed something crucial, please let me know.

rap1ds commented 2 months ago

One more comment: In general our preference is to discuss new features first by opening an Issue. I'm sorry that we haven't communicated this well enough, that's definitely something where we could've done better.

I'm going to address this by adding a CONTRIBUTING.md file to our open source repositories.

jayenashar commented 2 months ago

That's ok, I wanted to learn clojure so this was a good introduction and my main purpose was fulfilled.

The CLI commands' implementation may be simple but the usage is not simple [in my opinion]. I've never created a process without also creating an alias. Also never [intentionally] pushed a process without also updating an alias. A single command improves the UX dramatically and also simplifies documentation for new users. I have seen a few [new-to-sharetribe] developers push a process without updating the alias, because using two commands instead of one is too complicated.

rap1ds commented 2 months ago

The CLI commands' implementation may be simple but the usage is not simple [in my opinion]. I've never created a process without also creating an alias. Also never [intentionally] pushed a process without also updating an alias.

Yeah, I understand the pain. I'll note this feedback. This is something we need to consider.

In theory, the current model with transaction processes and aliases separated is a very flexible model. Users can e.g. have one transaction process with two aliases, one for development, one for live marketplace, and they can update the process and only update the development alias, test it out and when everything is tested and works fine, then update the live alias with the separate command. However, I'm not sure if this is that useful in practice. As you said, what probably happens most of the time is that you have one process, one alias, and when you update the process you update the alias too.

jayenashar commented 2 months ago

I'm not suggesting to remove the separate commands. I'm just suggested a packaged/bundled option be available, especially when there's a 99% overlap when using one command you also use the other.

This is probably not a good reason to combine create+push or create-alias+update-alias but I still think 1 command is simpler for users than 2.

venmartin commented 2 months ago

I'd have to agree with @jayenashar on this. So far in our development I'd say every single the time we have created a process, we have also created an alias. The same would apply to pushing a process and updating an alias. It would definitely make it simpler to have the option to use a combined cli command.

I also say this from the perspective of someone a little more fresh to the sharetribe cli.