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

some emoji missing or different set supported? #78

Open
drnic opened this issue Mar 11, 2020 · 2 comments
Open

some emoji missing or different set supported? #78

drnic opened this issue Mar 11, 2020 · 2 comments
Labels

Comments

@drnic
Copy link

drnic commented Mar 11, 2020

What is bk's relationship with https://github.com/buildkite/emojis?

In the example pipeline below, only :thumbsup: is supported by bk:

steps:
  - command: "sleep 2"
    label: ":thumbsup:"
  - command: "sleep 2"
    label: ":thumbsup::skin-tone-2:"
  - command: "sleep 2"
    label: ":+1:"
  - command: "sleep 2"
    label: ":+1::skin-tone-2:"

The output includes:

>>> Executing command step 👍
...
>>> Executing command step 👍:skin-tone-2:
...
>>> Executing command step :+1:
...
>>> Executing command step :+1::skin-tone-2:
@keithpitt
Copy link
Member

keithpitt commented Mar 11, 2020

Ah, I think I see what's happening. We're not taking into consideration the emoji variations.

The golang version is here:

cli/local/emoji.go

Lines 72 to 96 in e635a7d

func (el *emojiLoader) Render(line string) string {
return emojiRegexp.ReplaceAllStringFunc(line, func(s string) string {
bkEmojis, err := el.buildkiteEmojis()
if err != nil {
log.Printf("Err: %v", err)
return s
}
if e, ok := bkEmojis.Match(s); ok {
return e.Render(el.cache)
}
appleEmojis, err := el.appleEmojis()
if err != nil {
log.Printf("Err: %v", err)
return s
}
if e, ok := appleEmojis.Match(s); ok {
return e.Render()
}
return s
})
}

Which just looks up the emoji in the list, but in the Ruby version, there's some pre-processing going on: https://github.com/buildkite/docs/blob/master/app/models/emoji/catalogue.rb#L34-L49

I don't have time to craft a fix, but a PR would be welcome! :D:D

@drnic
Copy link
Author

drnic commented Mar 12, 2020

Ok will investigate later.

I want my pipelines to have randomized skin color :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants