Importing project via Git repo by URL creates Disabled repo mirror
Importing a project from git repo by URL creates a disabled Pull mirror entry in
Settings > Repository > Mirror a repository/Mirroring repositories
This behavior is confirmed in 11.11.0+ for both self-managed instances and GitLab.com
This issue occurs for self-managed instances regardless of whether the instance has an EE license, despite Pull mirroring being labeled as only available in Starter.
For unlicensed self-managed GitLab 11.11.0+ users, the disabled pull mirror is created every time a repository is imported using Git repo by URL.
For unlicensed/licensed GitLab.com users and licensed self-managed GitLab users, this issue occurs specifically when the Mirror repository box is left unchecked.
I feel that creating a mirror under these circumstances, disabled or otherwise, is unexpected behavior.
The behavior is identical to #64367 (moved)
Curiously, a pull mirror is created but disabled, with an alert that reads
Disabled mirrors can only be enabled by instance owners. It is recommended that you delete them..
with the exception that this applies to _any _ source repo imported using
Import Git repo by URL and does not involve GitHub integration or authentication.
This unexpected behavior can be confusing for GitLab users when attempting to set up or configure a Pull mirror after importing a project via
Git repo by URL.
Although the project owner will not be blocked from creating any Pull mirrors, clicking to delete the disabled pull mirror sets Repository mirrors to (-1) in the UI, similar to: https://gitlab.com/gitlab-org/gitlab-ee/issues/12871. These changes do not persist, and upon refresh the disabled repository mirror has returned.
Steps to reproduce
- Create a "new" project on GitHub.com or a self managed GitLab 11.11.0+ instance.
- Import any project to GitLab using the
Import project from: git Repo by URLmethod
- imported from public repo on self-managed GitLab install: https://gregmyers.me/root/import-test
What is the current bug behavior?
Importing repository to GitLab using Import repo by URL creates an unexpected and auto-disabled Pull mirror
What is the expected correct behavior?
Importing git repo by URL creates a working entry in Repository Mirroring, only if specified by the checkbox. Pull mirrors should only be created in self-managed instances if the user has access to Pull mirror features.
Relevant logs and/or screenshots
Disabled Pull mirror entry:
Pull mirroring only available self-managed Starter and up:
Option to "Mirror repository" on import screen left unchecked:
Output of checks
This bug happens on GitLab.com and self-managed installations using version 11.11.0 and newer
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknown
GitLab information Version: 12.1.0-ee Revision: 1f2e6f3f6d8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.7 URL: http://18.104.22.168 HTTP Clone URL: http://22.214.171.124/some-group/some-project.git SSH Clone URL: firstname.lastname@example.org:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 9.3.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 1/1 ... yes 1/2 ... yes 1/4 ... yes 1/5 ... yes 1/6 ... yes 1/7 ... yes 2/25 ... yes 2/31 ... yes 2/33 ... yes 2/34 ... yes 2/35 ... yes 2/37 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 2 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
(If you can, link to the line of code that might be responsible for the problem)