Giter Club home page Giter Club logo

Comments (1)

Sinjo avatar Sinjo commented on June 2, 2024

Hey @ngoral, thanks for the bug report! This is a great catch and is very much a real issue.

Previously, before I added the code to correctly handle / in job names, we were getting away with the implicit conversion of symbols into strings by ERB::Util::url_encode:

irb(main):005:0> ERB::Util::url_encode(:hi)
=> "hi"

As you've noticed, symbols don't have include? defined on them. It's also worth noting that Base64.urlsafe_encode64 won't perform the same conversion.

irb(main):001:0> :foo.include?("/")
(irb):1:in `<main>': undefined method `include?' for :foo:Symbol (NoMethodError)
...
irb(main):006:0> Base64.urlsafe_encode64(:hi)
<internal:pack>:8:in `pack': no implicit conversion of Symbol into String (TypeError)

I think you're right about the solution: we should convert job into a string before using it inside this method. That matches what we do for metric labels (see also: the associated tests).

If you'd like to send us a PR to match that behaviour then I'll happily review it! If not, I'm happy to make the change on your behalf. Either way, thank you for bringing this to us rather than just working around it.

from client_ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.