Skip to content

Fix GitHub repositories mirror

Rodrigo Tomonari requested to merge rodrigo/fix-github-import-ci-cd into master

What does this MR do and why?

Update GitHub Import to use a different method to check if the import_state is not completed as the in_progress method can not be used as it is coupled to the repository mirror domain

Related to: #419532 (closed)

Context

The bug was introduced by !122141 (merged) which started to stop the execution of the workers if the import isn't in_progress.

The problem is that the in_progress method is overridden in EE in a way that prevents us from using in an import context.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enabled GitHub Import in http://gdk.test:3000/admin/application_settings/general -> Visibility and access controls -> Import Sources -> GitHub Import
  2. Go to New Project
  3. Select the option Run CI/CD for external repository
  4. Then Select GitHub
  5. Provide an access token
  6. Select the project to be imported
  7. Wait the import to finish
  8. Open the project
  9. Go to Settings -> Repository -> Mirroring repositories
  10. Check if the mirror status was updated

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rodrigo Tomonari

Merge request reports