apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
813 stars 271 forks source link

fix: emit connectors debugging log only once #6062

Closed lennyburdette closed 1 month ago

lennyburdette commented 1 month ago

with rover dev or hot reloading, plugins are initialized each supergraph update, leading to redundant logs


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

Exceptions

Note any exceptions here

Notes

[^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

pubmodmatt commented 1 month ago

If the debug_extensions value changes from false to true, and the config is reloaded, showing the warning again would be desirable because it has just been turned on again. That doesn't matter for dev since it defaults to true always there, but if there is a case outside of dev where the config would be reloaded, it seems preferable to emit the warning every time.

lennyburdette commented 1 month ago

I tested it this way:

  1. run router with --hot-reload and a config without connectors debugging: no warning message
  2. change the router to enable connectors debugging: the router reloads and emits the warning

if you were to switch it off and back on, you wouldn't see the warning again, but i think that's fine.

maybe in the future there could be a way to distinguish between supergraph updates and configuration updates, but until then i would prefer not to see this warning every time the supergraph updates.