[go: up one dir, main page]

Skip to content

JH only gems

Background

In gitlab-jh/gitlab!67 (closed) we need to install gems which only needed by JH edition, and how should we proceed with it?

For EE only gems, we generally just add it to Gemfile and FOSS will have to install those gems anyway.

But can we do the same for JH?

Selected solution:

Introduce jh/Gemfile:

Potential solutions

  1. Put JH only gems inside Gemfile and Gemfile.lock, just like what we did for EE, and potentially under :jh group.
    • Do we update all the building scripts so bundler will ignore :jh group for EE and FOSS?
    • Or do we just install those JH gems anyway?
    • Pros:
      • No conflicts
      • Easy to manage
    • Cons:
      • Install extra gems when not needed for EE, or we need to update a lot of build scripts to explicitly ignore :jh group
      • Changes will always need to be ported to EE rather than self-contained in JH
  2. Put JH only gems inside Gemfile but within Gitlab.jh block, so it'll only be installed when it's running under JH mode
    • Pros:
      • No need to install extra gems in EE, nor do we need to update build scripts
    • Cons:
      • This will cause JH Gemfile.lock conflicting with EE, leaving divergence, and extra manual work to resolve the conflicts when it happenes
      • Changes will always need to be ported to EE rather than self-contained in JH
  3. Do not put changes inside EE, just add them to JH
    • Pros:
      • No extra work for EE
      • Changes will be self-contained in JH
    • Cons:
      • This will cause JH Gemfile and Gemfile.lock conflicting with EE, leaving divergence, and extra manual work to resolve the conflicts when it happens
  4. Put JH only gems inside jh/Gemfile and jh/Gemfile.lock, and set env BUNDLE_GEMFILE=jh/Gemfile when we're running under JH mode
    • Pros:
      • No extra work for EE
      • Changes will be self-contained in JH
    • Cons:
      • Setting BUNDLE_GEMFILE=jh/Gemfile can be tricky and break a lot of build scripts. A lot of build scripts might need to be updated in order to properly reflect that
  5. Some magic bundler feature?
  6. Some GitLab brewed bundler feature?
Edited by Lin Jen-Shin