-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring aliases to be more generic, add function support #65
Conversation
Once you get the tests working, I would suggest adding to the notes.md file with any explanation of how the functions should be used ... assuming there is some user-facing work to do. It is not really clear to me if this is meant to replace the aliases or supplement them to support a different scenario. If they can replace the functionality without impact, then why not just drop the option and make this the new way to do things? If they are doing something different than why not just make this an additive option as opposed to replacing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, this is all probably fine. But I have a couple comments and questions:
- Let's change the version to 2.0.0. Even though I think this is ultimately a safe change, given that it is hard to do real world testing it makes sense to just up the major version number since we are changing the fundamental way this works
- Switching from alias to function. I think I understand this. For the primary use case it should not result in any change in behavior, and it makes some other custom scenarios a bit easier to do
- New option for
defaulEnableAlias
. I cannot figure out what adding this accomplishes. What is the point in this feature if all the aliases are disabled? I would suggest removing this, but if it stays it needs to have a section added to NOTES.md to explain why it exists and when you would use it - New
targetFiles
option. I can guest what maybe this is for, but it needs to be spelled out in NOTES.md as documentation
Thanks for the reviews @markphip - I'll try and address all the questions here, but let me know if I missed anything :) Some background for this change: For codespaces repos we ran into issues with the auth helper not working for an edge case where we ran Even if I explicitly
What I ended up doing was to convert all the aliases into functions and add them to a standalone auth helper script (not the So to directly answer some questions from experience:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 suggestion.
Files not reviewed (2)
- src/artifacts-helper/devcontainer-feature.json: Language not supported
- src/artifacts-helper/install.sh: Language not supported
Comments skipped due to low confidence (3)
src/artifacts-helper/NOTES.md:2
- [nitpick] The phrase 'which dynamically sets an authentication token' should be 'that dynamically sets an authentication token' for consistency.
and optionally configures functions which shadow `dotnet`, `nuget`, `npm`, `yarn`, and `rush` which dynamically sets an authentication token
src/artifacts-helper/NOTES.md:3
- [nitpick] The phrase 'for pulling artifacts from a feed before running the command' is repeated and might be redundant.
for pulling artifacts from a feed before running the command.
src/artifacts-helper/README.md:36
- [nitpick] The term 'shadow' might be unclear to some users. Consider using 'override' or 'replace' instead.
and optionally configures functions which shadow `dotnet`, `nuget`, `npm`, `yarn`, and `rush` which dynamically sets an authentication token
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
@@ -24,6 +24,7 @@ Configures Codespace to authenticate with Azure Artifact feeds | |||
| npxAlias | Create alias for npx | boolean | true | | |||
| rushAlias | Create alias for rush | boolean | true | | |||
| python | Install Python keyring helper for pip | boolean | false | | |||
| targetFiles | Comma-separated list of files to write aliases to | string | DEFAULT (`/etc/bash.bashrc,/etc/zsh/zshrc` for `root`, otherwise `~/.bashrc,~/.zshrc`) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for targetFiles
should mention that it writes functions instead of aliases.
| targetFiles | Comma-separated list of files to write aliases to | string | DEFAULT (`/etc/bash.bashrc,/etc/zsh/zshrc` for `root`, otherwise `~/.bashrc,~/.zshrc`) | | |
| targetFiles | Comma-separated list of files to write functions to | string | DEFAULT (`/etc/bash.bashrc,/etc/zsh/zshrc` for `root`, otherwise `~/.bashrc,~/.zshrc`) | |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
A few usability improvements for
artifacts-helper
after digging into edge cases with the feature in codespacessource
ing that functions don't)