daytonaio / daytona

The Open Source Dev Environment Manager.
https://daytona.io
Apache License 2.0
7.22k stars 744 forks source link

daytona profile add workflow is a little confusing #748

Closed SvenDowideit closed 4 weeks ago

SvenDowideit commented 1 month ago

Describe the bug

I setup a daytona service running as root on my Linux build server, and at that time, used daytona api-key new, but at that time, used the Save to default profile automatically flow, which (iirc) didn't print the api-key

daytona api-key list showed me

root@xeon:~/.config/daytona# daytona api-key list

    Name                                                              Type                                                                
    ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────    
    default                                                           client                                                              

    test                                                              client 

Issue 1: I don't yet know what the format of an api-key is, but i suspect it's not listed Issue 2: is looks like the --output option for daytona api-key list is currently outputing nothing at all?

oh, then we look at the help for daytona api-key, and new isn't even in the list (ok, so, in all seriousness, I'm not fond of cobra - last time I did things with it, command aliases were very difficult to trick it into displaying in the help)

root@xeon:~/.config/daytona# daytona api-key
Api Key commands

Usage:
  daytona api-key [command]

Available Commands:
  generate    Generate a new API key
  list        List API keys
  revoke      Revoke an API key

At this point, I'm back to a different desktop, trying out daytona profile add, and the only help it gives is to use daytona api-key new - when really, I want to know how to get the existing ones.

Issue 4: so far, the commands haven't told me where to look for the matching config files (I wonder if that can be added to the more descriptive --help output - but again, Cobra :) - for anyone following along still, ~/.config/daytona/config.json Issue 5: please don't put non-config files into a user's .config/ or "user config dir" - that way lie some really sad people who sync configs

YAY, all the info I need is in ~/.config/daytona/config.json - but imagine if we had some decent crypto, and used mdns for local networks :)

ok, from here, I'm trying to be too clever, and won't add to this report beyond:


[sven@p1gen4:~/src/daytona]$ ./daytona create https://github.com/SvenDowideit/dendron
WARN[0000] Version mismatch detected. CLI is on version v0.21.3, Daytona Server is on version v0.0.0-dev. To ensure maximum compatibility, please make sure the versions are aligned. 
FATA[0000] failed to get repository: GET https://api.github.com/repos/SvenDowideit/supersecret/commits?per_page=1: 404 Not Found [] 

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

idagelic commented 1 month ago

Thank you for the well structured ticket. I created a couple separate issue from the ones you listed:

Firstly you metioned the "Save to default profile automatically" flow is confusing - I agree. We initially kept that for users that hadn't yet generated an api key to make managing the breaking change easier. We will remove this option to reduce confusion as a part of this issue.

"Issue 1: I don't yet know what the format of an api-key is, but i suspect it's not listed"

"Issue 2: is looks like the --output option for daytona api-key list is currently outputing nothing at all?"

For implementing api keys we went for a "show once" approach so the "list" commands only displays the name, though the api key can still be "fetched" by reading ~/.config/daytona/config.json as you found. This is purely storage and the api key (similarly to tokens) really shouldn't be viewed more than once in our eyes and removing the "Save automatically" option will make this clearer. I'm guessing you tried viewing the real api key content with the "-o json" entry. This wouldn't work, but the output shouldn't be empty either way so I opened #751 to take care of this

"Issue 4: so far, the commands haven't told me where to look for the matching config files (I wonder if that can be added to the more descriptive --help output - but again, Cobra :) - for anyone following along still, ~/.config/daytona/config.json"

This is still referring to the api key listing - I hope the solution above is feasible for this.

"Issue 5: please don't put non-config files into a user's .config/ or "user config dir" - that way lie some really sad people who sync configs"

I agree, using the "~/.config" directory for non-config data looks strange. Would moving everything except for the config.json file to a new directory like "/var/lib/daytona" be a better location in your opinion? We will take a better look at the structure either way on #750

idagelic commented 1 month ago

I also opened #752 to take a look at the aliases used for Daytona commands and address the confusion coming from Cobra not displaying the relevant aliases when "help" is run.

idagelic commented 1 month ago

To reiterate - solving this specific issue should be in removing the "Save to default profile automatically" option to improve clarity

lbrecic commented 1 month ago

/bounty $20

algora-pbc[bot] commented 1 month ago

💎 $20 bounty • Daytona

Steps to solve:

  1. Start working: Comment /attempt #748 with your implementation plan
  2. Submit work: Create a pull request including /claim #748 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

If no one is assigned to the issue, feel free to tackle it, without confirmation from us, after registering your attempt. In the event that multiple PRs are made from different people, we will generally accept those with the cleanest code.

Please respect others by working on PRs that you are allowed to submit attempts to.

e.g. If you reached the limit of active attempts, please wait for the ability to do so before submitting a new PR.

If you can not submit an attempt, you will not receive your payout.

Thank you for contributing to daytonaio/daytona!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @abhishek818 #795
algora-pbc[bot] commented 1 month ago

💡 @abhishek818 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

abhishek818 commented 1 month ago

/attempt #748

algora-pbc[bot] commented 1 month ago

@abhishek818: We appreciate your enthusiasm but since you already have 2 active bounty attempts, we're going to keep this open for other contributors to attempt. 🫡

algora-pbc[bot] commented 4 weeks ago

🎉🎈 @abhishek818 has been awarded $20! 🎈🎊