Closed farost closed 1 month ago
Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.
Trivial Change
Code
Architecture
I'd still think about a correctness
job to check that the only difference between config_release
and config_development
are the development-mode
options. Not sure if we want to add it here, not sure if we'll add it later if we don't right now...
Usage and product changes
development-mode
We add a new server's config parameter called
development-mode.enable
. This parameter can be used to separate real "release" application runs from our testing.In the future, this parameter can influence many different sides of the server (logging settings, networking behavior?.., anything we want), but the only current purpose of this field is to completely turn off diagnostics and error reporting:
development-mode.enable
is an optional parameter, and the absence of it in the config is equivalent todevelopment-mode.enable=false
. It is expected to be set totrue
for all theconfig.yml
files used by local environments, tests, and snapshots.--//server:config=[development/release] Bazel flag
We add a new Bazel build flag that helps choose the server configuration for all the build jobs, addressing the newly added
development-mode.enable
option.Example of a release configuration build:
Example of a development configuration build:
deployment-id
We remove
deployment-id
from thetypedb
config as it makes sense only forCloud
servers. Suppose it was set in anyone's config before. In that case, thedeployment-id
value will be forcefully set toserver-id
, changing its previous manually set value.It means that all the previous versions of
TypeDB Core
diagnostics submissions with differentserver-id
anddeployment-id
(not expected to be higher than 0 - 10 servers) will possibly want to change thedeployment-id
in the database to avoid misleading query results.Implementation
development-mode
We add new
Optional
KeyValue
s forYAMLParser
, acting exactly likePredefined
config options, but letting the configuration miss the key completely, setting its values to defaults inside the code. This way, declaringlets us set
development-mode.enable
totrue
this way:and set
development-mode.enable
tofalse
in these two ways:This flag is still available for CLI manual overrides.
For
TypeDBCoreRunner
uses, this flag is forcefully set totrue
, not respecting the providedconfig.yml
. However, it's possible to override this flag by passing it in the constructor if the runner user really wants to do it.--//server:config=[development/release] Bazel flag
This flag affects all the targets that depend on the configuration file, including transitive dependencies (e.g. creating an archive of the server's library). It only accepts two values. Providing a wrong value leads to an explicit and specific build error.
NOTE: This is a Bazel flag, so it needs to be specified before the
--
for application flags! For example, this works:This does not: