Upgrading from latest version to nightly fails

In gitlab!79815 (merged), for moving a feature from EE to Core, we had replaced some directories in an ee-specific directory with symlinks to their counterparts in the common directory. However, as per https://bugzilla.redhat.com/show_bug.cgi?id=447156 this is something rpm complains about. They even have a docs page for handling it - https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/.

This causes upgrades from latest version to nightly packages fail for users using rpm-based distros, and unless fixed upgrades to next version will also fail. This makes it a priority1 severity1 issue.

Error: Transaction test error:
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.0 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.1 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.2 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.3 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.4 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.5 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.0.6 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64
  file /opt/gitlab/embedded/service/gitlab-rails/ee/lib/ee/gitlab/ci/parsers/security/validators/schemas/14.1.0 from install of gitlab-ee-14.7.1+rfbranch.225293.4272f5b9-0.el8.x86_64 conflicts with file from package gitlab-ee-14.7.1-ee.0.el8.x86_64

We have three possible solutions that we can try

  1. Use a pretrans script through the lifecycle of 14.x which will do the necessary deletion
  2. Instead of symlinking, copy the necessary files to both the common and ee-specific locations. This was the original case, but we changed it so as not to waste space.
  3. Modify the code so that even EE can read the files from the common location (Note that I don't have much knowledge on what these files actually do. So, this might be a moot suggestion)
Edited by Balasankar 'Balu' C