Skip to content

[WIP] feat: don't disable pings without a license

Warren Gifford requested to merge checks into master

Created by: dadlerj

Management console and critical config question @slimsag:

(This is obviously still WIP, as I have a bunch of debug statements in here.) I'm seeing some weird behavior where updates to critical config aren't recognized initially on server start. I have to start it, wait for it to load, then shut it down and restart it again for the changes to be propagated.

This seems like a race condition, as my accessing of the critical config is occurring in a function called from a main() func.

Here's how it works:

  1. Starting with the default critical-config.json from dev-private (which has a valid licenseKey), start up Sourcegraph. As expected, my debug line at https://github.com/sourcegraph/sourcegraph/compare/checks?expand=1#diff-96efb391535cae0b63190f5e23ec0f82R220 correctly prints true.
  2. Shut down Sourcegraph
  3. Update critical-config.json to comment out the licenseKey property
  4. Restart Sourcegraph
  5. My debug line prints out true (incorrectly)
  6. Shut down the server, and then restart it
  7. My debug line prints out false (correctly)

Any ideas for how to overcome this? I'm only doing this check one time, at startup, but I could do it lazily instead if this is an inherent limitation of how/when critical config is loaded.

Test plan:

Merge request reports

Loading