[Discuss] Resolve `compile-test-assets as-if-jh` job failed in upstream pipeline

Problem to solve

Currently in the upstream pipeline, compile-test-assets as-if-jh job builds JH fixtures by add-jh-folder.

add-jh-folder will get main-jh branch from JiHu repo. Then moved jh folder to the project directory that is currently being built. This behavior resulted in the environment to jh(because of config/helpers/is_jh_env.js).

compile-test-assets as-if-jh failed link: https://gitlab.com/orozot/gitlab/-/jobs/1757726149 More context about this job: https://gitlab.com/gitlab-org/gitlab/-/issues/339248

add-jh-folder job: https://gitlab.com/orozot/gitlab/-/jobs/1757726188

// config/helpers/is_jh_env.js
const fs = require('fs');
const path = require('path');
const IS_EE = require('./is_ee_env');

const ROOT_PATH = path.resolve(__dirname, '../..');

// The `FOSS_ONLY` is always `string` or `nil`
// Thus the nil or empty string will result
// in using default value: false
//
// The behavior needs to be synchronised with
// lib/gitlab.rb: Gitlab.jh?
// Since IS_EE already satisifies the conditions of not being a FOSS_ONLY.
// const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false');
const isEEOnly = JSON.parse(process.env.EE_ONLY || 'false');
module.exports = IS_EE && !isEEOnly && fs.existsSync(path.join(ROOT_PATH, 'jh'));

So compile-test-assets as-if-jh will be failed since the create new file MR in jh has not yet been incorporated. image

Solution

  1. Create an MR that contains new files in jh folder which is used to override.
  2. Merge this MR to main-jh first.
  3. Create upstream MR for your issue.
  4. After upstream MR is merged, create another MR in jh for your issue.

Defect: This makes the process of merging requests more cumbersome.