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
Feature Clickable Template Links in Terminal azd template list
#2845
Conversation
Thank you for your contribution john0isaac! We will review the pull request and get back to you soon. |
After reviewing everything I removed termlink from the required packages, and applied clickable link formatting before printing the output only of This is the new output, I think this fix closes #2731 issue but it doesn't apply clickable links to the output of azd init. |
I pushed these changes to raise another issue (this is not a fix for the templates clickable links issue) 2032af9 Using Absolute as recommended by @weikanglim made all the links start with Azure Samples which doesn't make any sense when you look at it's implementation I will try to fix this only for the templates list but I wanted to bring this to your attention. There is a problem with the strings.Count() it always returns a zero. I also tried using regex but it also returns zero for the number of times it matches the term. I don't know why it's behaving like this I tried running this code (using an example username/reponame) in an online compiler and it worked for both count and regex. Plus, @vhvb1989 I didn't find any broken URLs (IIRC, RepositoryPath can be a full URL (for example, to AzureDevOps or some other Git-server)) when I added github.com to all the repositoryPaths I understand that what you said might happen using my approach which requires us to build some checks for it but for the current situation it's not an issue. Update 1:I got why it's behaving like this I was editing the template which doesn't have any data until the code is compiled so, it always checks an empty string ๐ Update 2:I added the clickable links in the template manager (The part where we are formatting the templates) Update 3:It seems to be breaking the template show command as it relies on the repoPath I will add it in the cmd/templates.go as suggested by Wei Lim to not mess with anything else but IMO, it needs to be a part of the formatting. |
@john0isaac , yeah, we can't call a function to set the value like this: That's because the They way we do this is by referencing the function within the string-template. |
OMG, you are right and it works no perfectly fine, I didn't know we had a transformer thanks!!!!! |
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.
I was forgetting about the Transformer func!! nice catch!
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
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.
We need to avoid the output formatting issue (aligning cols).
@vhvb1989 You said something about removing the Name column (the Name is not the same as the repository path) I have an issue here and the fix is very quick when someone uses the command |
/azp run azure-dev - ci |
No pipelines are associated with this pull request. |
/azp run azure-dev - cli |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIContainer
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
override checks as the issue is not releated |
/check-enforcer override |
The command azd template list gt the feature of clickable repository paths in release 1.4.2. This PR brings this feature also to the command azd template show xyz transfering the logic implemented in #2845 to the show command. To avoid code duplication the formatting logic is trenafered to the path.go file which looks like a good fit for this kind of logic. The sequence of the output of the template show command was not changed. If this should be aligned with the template list command, just comment and I add a commit
closes #2731
I have implemented and unimplemented the feature at the same time. ๐ฎโ๐จ
The clickable links provided by the library https://github.com/savioxavier/termlink doesn't work in the interactive terminal it displays the whole text without rendering + crashes the whole terminal so, I had to catch the oldText that we were displaying from the formatted text by termlink and display it.
The feature is easy to implement the problem is with the interactive terminal and I thought it would be better to implement it and fix it's implementation error and then work on the init output later.
Screenshot from output of
azd template list
Crashing Terminal for
azd init
[Also Fixed]It's worth mentioning that this library doesn't affect the formatting of the paths at all, I don't know why it's there it confused me at the beginning while the Absolute function defined in it is being used in 2 places in the code it doesn't affect the output of
azd template list
orazd init