https://www.puppet.com/community logo
Join Slack
Powered by
# voxpupuli
  • v

    VoxBot

    06/21/2022, 2:39 PM
    afisher++ for the redundant Optional puppet-lint plugin
  • d

    Dr Bunsen Honeydew

    06/21/2022, 2:39 PM
    afisher is on the rise! (Karma: 4)
  • v

    VoxBot

    06/21/2022, 2:39 PM
    finding a few examples in theforeman-* modules now that I'm updating to voxpupuli-test 5 :)
  • v

    VoxBot

    06/21/2022, 2:40 PM
    yeah, thanks for all the super long diffs :P
  • v

    VoxBot

    06/21/2022, 2:41 PM
    you're welcome :D
  • v

    VoxBot

    06/21/2022, 2:46 PM
    redundant optional?
  • v

    VoxBot

    06/21/2022, 2:50 PM
    Optional[String] $foo = 'bar'
  • v

    VoxBot

    06/21/2022, 2:50 PM
    it has a default value, thus the "Optional" is redundant
  • v

    VoxBot

    06/21/2022, 2:51 PM
    ah that, yes
  • v

    VoxBot

    06/21/2022, 2:51 PM
    brought up a shitload of broken code at $customer :D
  • v

    VoxBot

    06/21/2022, 2:52 PM
    broken in what way?
  • v

    vchepkov

    06/21/2022, 2:53 PM
    imho, this isn't useful
    Copy code
    Optional[String] $foo = 'bar'
    You can't pass undef to a class
  • v

    vchepkov

    06/21/2022, 2:53 PM
    Normal application is this
    Copy code
    Optional[String] $foo = undef
  • v

    VoxBot

    06/21/2022, 2:53 PM
    that's exactly what the lint plugin yells at you about
    👍 1
  • v

    VoxBot

    06/21/2022, 2:53 PM
    it's either String $foo = 'bar' or Optional[String] $foo = undef
  • v

    VoxBot

    06/21/2022, 2:54 PM
    and the lint plugin can't decide which is correct so there's no autofix, but at least it complains about it
  • a

    Alex Fisher

    06/21/2022, 3:06 PM
    @bastelfreak Are you using webhook-go yet?
  • v

    VoxBot

    06/21/2022, 3:06 PM
    had no time yet to set it up for my private infra and all customers are on PE at the moment
  • v

    VoxBot

    06/21/2022, 3:07 PM
    do we already have a puppet module to configure webhook-go?
  • a

    Alex Fisher

    06/21/2022, 3:08 PM
    Don't think so. Just trying to get it going manually at the moment. Seems to run r10k, but even with the
    verbose
    option set, I can' actually see any output from r10k being logged.
  • a

    Alex Fisher

    06/21/2022, 3:15 PM
    ah. I think the command output is returned to the caller, and gitlab times out after 10 seconds whilst this r10k operation took 60s for me (lots of environments). https://github.com/voxpupuli/webhook-go/blob/c03c8fa940255285e7233e7a7067114d0ed4f195/api/module.go#L80
  • a

    Alex Fisher

    06/21/2022, 3:15 PM
    ah. I think the command output is returned to the caller, and gitlab times out after 10 seconds whilst this r10k operation took 60s for me (lots of environments). https://github.com/voxpupuli/webhook-go/blob/c03c8fa940255285e7233e7a7067114d0ed4f195/api/module.go#L80
  • a

    Alex Fisher

    06/21/2022, 3:20 PM
    From the gitlab docs... "Your endpoint should send its HTTP response as fast as possible. You should aim for sub-second response times in all circumstances."
  • a

    Alex Fisher

    06/21/2022, 3:20 PM
    and "If a webhook fails repeatedly, it may be disabled automatically."
  • v

    VoxBot

    06/21/2022, 3:21 PM
    you could implement a timeout where it returns HTTP 202 after x seconds
  • a

    Alex Fisher

    06/21/2022, 3:22 PM
    Interestingly, it's already configured to respond with a 202, but after the work has actually been done, and with the command output.
  • v

    VoxBot

    06/21/2022, 3:24 PM
    that's an interesting approach
  • a

    Alex Fisher

    06/21/2022, 3:25 PM
    Doesn't seem to be what 202 is for.
  • v

    VoxBot

    06/21/2022, 3:25 PM
    indeed, I'd expect it to return HTTP 200 after all the work or 202 if it hasn't completed yet
  • a

    Alex Fisher

    06/21/2022, 3:34 PM
    Not sure if it's ever going to be worth trying to give r10k enough time to complete if we're supposed to aim for sub-second responses.
1...858687...648Latest