Skip to content
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

Azure DevOps enhancements #2472

Closed
wants to merge 2 commits into from
Closed

Azure DevOps enhancements #2472

wants to merge 2 commits into from

Conversation

kmontocam
Copy link

@kmontocam kmontocam commented Oct 30, 2023

Replaced AZURE_ICON because of mdi, appended proper VCS_GIT_AZURE_ICON using DevOps icon

@romkatv
Copy link
Owner

romkatv commented Oct 30, 2023

What problem are you trying to solve?

@kmontocam
Copy link
Author

The current nerdfont icons are depreciated or inadequate.
image

Both default Azure Icon and VCS have newer versions, I modified the icons for the "nerdfont-complete" catalog.

@kmontocam kmontocam changed the title chore: replacement of Azure's nerdfont-complete icons Azure DevOps enhancements Oct 31, 2023
@kmontocam
Copy link
Author

Although the Azure DevOps icon was listed, there was no case to match that this was being used as the remote server

@romkatv
Copy link
Owner

romkatv commented Oct 31, 2023

Is something not working for you? If so, please describe the issue in the following terms:

  1. What you do.
  2. What you expect to happen.
  3. What actually happens.

@kmontocam
Copy link
Author

kmontocam commented Oct 31, 2023

Working with the Azure Cloud, both with the CLI tools and DevOps have outdated/missing features.

First of all, p10k detects if the user is typing an Azure CLI command. When it does, it shows the Azure subscription Name, followed by an Azure Icon. The icon included in the current version of p10k for Azure is depreciated on today's nerdfont standard.

Currently (nf-mdi-azure) (outdated)
AZURE_ICON '\uFD03' # ﴃ

Proposed changes (nf-cod-azure)
AZURE_ICON '\uEBD8' # 

The same can be said for the DevOps icons. There is a more adequate one that can be replaced. Still on 'nerdfont-complete'|'nerdfont-fontconfig', we have:

Currently (nf-mdi-azure) (outdated)
VCS_GIT_AZURE_ICON '\uFD03 ' # ﴃ

Proposed changes:
VCS_GIT_AZURE_ICON '\uEBE8 ' # 

In both cases the new icons are expected to show of, but instead, the Uyghur? Alphabet character shows off

Finally, there is not a case to match that the git remote server that the user is working with is on Azure DevOps thru an HTTP method. This was only capable of matching SSH connections. The expression to match this case was modified like in the other Git Clouds.

Currently (forces it to be an SSH connection, and there is not a case to match it). So when it is an Azure connetion, it shows the default VCS_GIT_ICON

function +vi-vcs-detect-changes() {
  if [[ "${hook_com[vcs]}" == "git" ]]; then

    local remote="$(git ls-remote --get-url 2> /dev/null)"
    if [[ "$remote" =~ "github" ]] then
      vcs_visual_identifier='VCS_GIT_GITHUB_ICON'
    elif [[ "$remote" =~ "bitbucket" ]] then
      vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
    elif [[ "$remote" =~ "stash" ]] then
      vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
    elif [[ "$remote" =~ "gitlab" ]] then
      vcs_visual_identifier='VCS_GIT_GITLAB_ICON'
    else
      vcs_visual_identifier='VCS_GIT_ICON'
    fi
function _p9k_vcs_icon() {
  case "$VCS_STATUS_REMOTE_URL" in
    *github*)                          _p9k__ret=VCS_GIT_GITHUB_ICON;;
    *bitbucket*)                       _p9k__ret=VCS_GIT_BITBUCKET_ICON;;
    *stash*)                           _p9k__ret=VCS_GIT_BITBUCKET_ICON;;
    *gitlab*)                          _p9k__ret=VCS_GIT_GITLAB_ICON;;
    # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate
    (|*@)vs-ssh.visualstudio.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;;  # old
    (|*@)ssh.dev.azure.com(|:*))       _p9k__ret=VCS_GIT_AZURE_ICON;;  # new
    *)                                 _p9k__ret=VCS_GIT_ICON;;
  esac
}

Proposed changes

function +vi-vcs-detect-changes() {
  if [[ "${hook_com[vcs]}" == "git" ]]; then

    local remote="$(git ls-remote --get-url 2> /dev/null)"
    if [[ "$remote" =~ "github" ]] then
      vcs_visual_identifier='VCS_GIT_GITHUB_ICON'
    elif [[ "$remote" =~ "bitbucket" ]] then
      vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
    elif [[ "$remote" =~ "stash" ]] then
      vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
    elif [[ "$remote" =~ "gitlab" ]] then
      vcs_visual_identifier='VCS_GIT_GITLAB_ICON'
    elif [[ "$remote" =~ "visualstudio" || "$remote" =~ "azure" ]] then
      vcs_visual_identifier='VCS_GIT_AZURE_ICON'
    else
      vcs_visual_identifier='VCS_GIT_ICON'
    fi
function _p9k_vcs_icon() {
  case "$VCS_STATUS_REMOTE_URL" in
    *github*)                          _p9k__ret=VCS_GIT_GITHUB_ICON;;
    *bitbucket*)                       _p9k__ret=VCS_GIT_BITBUCKET_ICON;;
    *stash*)                           _p9k__ret=VCS_GIT_BITBUCKET_ICON;;
    *gitlab*)                          _p9k__ret=VCS_GIT_GITLAB_ICON;;
    # https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate
    (|*@)vs-ssh.visualstudio.com(|:*)) _p9k__ret=VCS_GIT_AZURE_ICON;;  # old
    *azure*)                           _p9k__ret=VCS_GIT_AZURE_ICON;;  # new
    *)                                 _p9k__ret=VCS_GIT_ICON;;
  esac
}

@romkatv
Copy link
Owner

romkatv commented Oct 31, 2023

What do the http remotes on Azure look like? Can you give an example?

What is the problem with the icon? Does it not display for you? If not, please run p10k configure and let me know if it helps.

@kmontocam
Copy link
Author

What do the http remotes on Azure look like? Can you give an example?

What is the problem with the icon? Does it not display for you? If not, please run p10k configure and let me know if it helps.

The HTTP remotes look with the default GIT icon instead of the Azure DevOps:

Example of DevOps (sorry I can not show the complete repo URL, i will censor a part of it):
Untitled
Side Note. Is it normal that the stages don't have a space next to the number? I saw that these are not given an extra space like

    icons[VCS_BOOKMARK_ICON]+=' '
    icons[VCS_COMMIT_ICON]+=' '
    icons[VCS_BRANCH_ICON]+=' '

Working with the Azure Client. The icon does display, but as this Uyghur? character. Example:
Untitled

@romkatv
Copy link
Owner

romkatv commented Oct 31, 2023

Thanks for the details.

Does the icon get fixed if you run p10k configure?

@kmontocam
Copy link
Author

Thanks for the details.

Does the icon get fixed if you run p10k configure?

No. If I use, MesloLGS NF I can see the old icon typing az, but with other Nerd Fonts I see ﴃ because they have depreciated that icon. And for Azure DevOps git issue, I still see the default git icon, not the DevOps one

@romkatv
Copy link
Owner

romkatv commented Oct 31, 2023

Could you post screenshots of the wizard screens related to icons along with your answers?

@kmontocam
Copy link
Author

kmontocam commented Oct 31, 2023

Could you post screenshots of the wizard screens related to icons along with your answers?

Okay, I got you. I had a p10k config with MelosNF which is a nerdfont-complete and I was using a nerdfont-v3. Now it all makes sense. I set it up again (with the font I use, which happens to be a v3) and now I see the current azure icon (not the weird char) when I type az. That is also why I did not see the spacing between the stashed and the numbers. Sorry for that.

However, I still think it will be good to update those icons at least in nerdfont-v3, as well as applying the changes for the Azure DevOps git indicator, because after the new config, I still see the default git icon because is not detecting the https remote server.

Replaced `AZURE_ICON` because of mdi, appended proper `VCS_GIT_AZURE_ICON`
using DevOps icon
There was no case to match an Azure's DevOps git repository. A detection
of an ssh or https remote server connection was included.
@romkatv
Copy link
Owner

romkatv commented Oct 31, 2023

I'll update the pattern for the azure remote.

It's not yet clear to me whether there is an issue with the icon. Do you have a font with which the icon does not render after you run p10k configure and truthfully answer all questions?

@kmontocam
Copy link
Author

I'll update the pattern for the azure remote.

It's not yet clear to me whether there is an issue with the icon. Do you have a font with which the icon does not render after you run p10k configure and truthfully answer all questions?

Yes, but it was my bad because I had a p10k configuration answering with yes all question, but then I switched to a font that didn't meet that requirement (had a no in the upper arrow). So yeah, the only "issue" right now with the icons is that the Azure DevOps one is the same as the Azure Icon, and there is an specialized one for DevOps (code: ebe8 in nerdfonts), and there a new one for Azure icon (code: ebd8) because of the change of logo in Azure.

In the fork I introduced the new logos for "nerdfont-v3", as well as the changes for the pattern for the azure remote

@romkatv
Copy link
Owner

romkatv commented Nov 1, 2023

I've updated the remote URL pattern for Azure devops and changed Azure and Azure DevOps icons when using NerdFonts v3. Thanks for bringing these issues to my attention.

In the future please file an issue instead of sending a PR. It'll save us both time.

@romkatv romkatv closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants