Summary from chatting with @Joe today...
Background
the ClusterConfig utility class was recently added to wmf-config as part of change 749717 with the intention to ease configuration variance for MW-on-K8s, by avoiding duplicate logic and/or global variables that reflect $_SERVER['SERVERGROUP'].
To learn the possible values of this environment variable and what it is used for, refer to https://wikitech.wikimedia.org/wiki/MediaWiki_at_WMF#App_servers.
Change
this utility class abstracts the established "server group" concept through a list of one of more boolean "traits".
Examples of server group names:
- appserver
- kube-mw-web
- api_appserver
- kube-mw-api-ext
- kube-mw-api-int
- kube-mw-debug (servergroup)
- mwdebug#### (hostname)
Examples of traits:
- bool isK8s -> contains kube-
- bool isApi -> contains api
Among the traits is:
- bool isTest -> contains debug
Proposal
The "test" and "isTest" trait are imho confusingly named. Overall, given how we use these terms today, I'd say "This applies to test" feels to significantly different from (and much less scary/heavy weight) than "This is deployed to debug". Test feels expressly outside the production security realm. We tend to use "test" environment and "test" clusters in ways that is mutually exclusive with production traffic.
We instead tend to use the term "debug" for the above request contexts, for example:
We usually refer to WikimediaDebug backends as "debug" requests, not "test" requests. And within MediaWiki core, for example, we have various "debug" modes that can be used in production, however, "test" modes tend to refer to unit testing or CI/Jenkins context.
I suggest we rename isTest to isDebug to keep terminology more internally consistent, ease the learning curve, and to reduce chances of commits or changes being misinterpreted.
Behind the scenes, I also noticed that this trait actually returns true in kubernetes and not on the mwdebug hosts. This is because mwdebug currently provisions SERVERGROUP via cluster: appserver. I suggest we either provision this differently from Puppet (e.g. debug_appserver), or incorporate a hostname check in ClusterConfig::isDebug.
- Rename isTest to isDebug.
- Confirm it returns true via WikimediaDebug when selecting k8s.
- Confirm it returns true via WikimediaDebug when selecting mwdebug1002 (eqiad)
- Confirm it returns true via WikimediaDebug when selecting mwdebug2002 (codfw).