Leverage new `enterprise` flag in Metadata endpoint for GitLab EE Instance Checks
We have a bunch of helper functions for testing to check wether the GitLab instance is an enterprise instance or not.
Right now, we parse the version
to have a -ee
suffix which not only is fragile, but also fails for the current omnibus docker nightly build which doesn't have that suffix.
In 15.6 an enterprise
field was introduced to the /metadata
endpoint which we could leverage.
I think it may also make sense for the tests to cache the /metadata
response once for a go test
run and re-use it instead of re-requesting it. This will reduce some spam from the logs, too.
Implementation Details
We still test against 15.5 and so the helper functions must be backwards compatible.
Iteration 1:
- Change version check helper functions to check the
enterprise
flag by default - If it's
true
: it's an enterprise instance and we can proceed accordingly - If it's
false
: it's may be a CE instance or it may be a EE instance prior to 15.6, thus check if there is a-ee
suffix in the version: 2. if yes, it's an enterprise instance 2. if no, it's a community edition instance - comment the above logic for
enterprise == false
with some reasoning why it's there and potential a comment and create an issue that it can be removed as soon as we release for %15.8 (because we only test N-2 releases).
Iteration 2:
Check what we can do to cache these version check results locally during testing. It clutters the logs quite a lot and there is never the situation that the test instance changes between test / test steps.