TritonDataCenter / TritonDataCenter/node-triton
`triton profile set NAME` and `TRITON_PROFILE` interaction is confusing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 36
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 1
Description
(From a conversation with @STRML on #joyent IRC.)
How a triton invocation determines the profile to use can be confusing. If you use the suggested eval $(triton env) technique to setup one's env for docker usage, one may not realize that the TRITON_PROFILE envvar is being set to the current profile. Subsequent attempts to "set" one's profile with triton profile set NAME will report success, but really you won't get that profile for triton commands because the TRITON_PROFILE envvar will win.
Further possible confusion is how the "env" profile works. The "env" profile automatically exists if one has SDC_ and/or TRITON_{URL|ACCOUNT|...} envvars set. So, in the case above one might not have had an "env" profile in triton profile list ... until eval $(triton env) was run. Now there is this new "env" profile. Are the SDC_ envvars now used by triton commands? The answer is: only if the "env" profile is the current one.
Suggested changes:
triton profile set-current(and itssetshortcut) are misleading. They are really about setting the default profile (if neither of a-p NAMEtop-level option orTRITON_PROFILEenvvar are used to explicitly choose the profile). We should change to theset-defaultname and have hiddensetandset-currentaliases for bwcompat (which we can remove at some later major rev).- The docs in all of
triton profile,triton env -h, andtriton profile set-default -hshould clarify how a profile is selected. triton profile set-default FOOshould emit a warning on stderr if it notices thatTRITON_PROFILEis set or if-p NAMEtop-level opt is used.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the triton profile set-current and set commands, then read the help output for triton profile, triton env -h, and triton profile set-default -h. Done means the default-profile behavior and precedence of -p NAME and TRITON_PROFILE are clear, compatibility aliases remain available, and set-default warns when an override is active.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100